Bugs item #1827701, was opened at 2007-11-07 11:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1827701&group_id=61302

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core API
Group: Release 1.4.1
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tavis Bones (tavisbones)
Assigned to: Nobody/Anonymous (nobody)
Summary: assertLinkPresentWithText works but clickLinkWithText doesn'

Initial Comment:
My jwebunit test has these lines of code
 
assertLinkPresentWithText("General Preferences");
clickLinkWithText("General Preferences");
 
It fails with the Click Failed error on the clickLinkWithText line.

Attached is the jsp code.
Here is the jwebunit test:

public void testPartStoreHomeOnGeneralPreferences()
{
  clickLinkWithText("Preferences");
  assertLinkPresentWithText("General Preferences");
  clickLinkWithText("General Preferences");
  assertButtonPresentWithText("PartStore Home");
  clickButtonWithText("PartStore Home");
  assertLinkPresentWithText("Express Order");
}

this is the compiled jsp line in question:
<TR>
<TD VALIGN="TOP" WRAP="NOWRAP" WIDTH="1%">
<IMG SRC="/partstore/images/triangle.gif">&nbsp;</TD>
                                
                                
<TD WIDTH="485" valign="top" ALIGN="left">
<SPAN CLASS="black10Bold">
<a 
href="/partstore/generalPreferencesAction.do?actionName=initial&amp;prevButtonLabel=PartStore+Home&amp;prevState=psmain"
 class="href">
<STRONG>General Preferences
</STRONG></a>
</SPAN>
<BR>

here is the junit stack trace:
java.lang.RuntimeException: Click failed
        at 
net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.clickLinkWithText(HtmlUnitDialog.java:1478)
        at 
net.sourceforge.jwebunit.junit.WebTester.clickLinkWithText(WebTester.java:1950)
        at 
net.sourceforge.jwebunit.junit.WebTestCase.clickLinkWithText(WebTestCase.java:1503)
        at 
cat.dcs.partstore.main.tests.GeneralPreferencesTest.testPartStoreHomeOnGeneralPreferences(GeneralPreferencesTest.java:33)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
        at java.lang.reflect.Method.invoke(Method.java:391)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at 
net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:58)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:436)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:311)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: sun.io.MalformedInputException
        at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java(Compiled Code))
        at 
sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:287)
        at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:318)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)
        at java.io.InputStreamReader.read(InputStreamReader.java:208)
        at org.cyberneko.html.HTMLScanner.load(HTMLScanner.java:1082)
        at org.cyberneko.html.HTMLScanner.read(HTMLScanner.java(Compiled Code))
        at 
org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java(Compiled 
Code))
        at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809)
        at 
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478)
        at 
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at 
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:311)
        at 
com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:226)
        at 
com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:112)
        at 
com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:85)
        at 
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:431)
        at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:335)
        at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:362)
        at 
com.gargoylesoftware.htmlunit.html.HtmlAnchor.doClickAction(HtmlAnchor.java:115)
        at 
com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:114)
        at 
net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.clickLinkWithText(HtmlUnitDialog.java:1476)
        ... 18 more




 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1827701&group_id=61302

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to