Support Requests item #1849169, was opened at 2007-12-12 08:51
Message generated for change (Comment added) made by henryju
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1849169&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: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: atop85 (atop85)
Assigned to: Julien HENRY (henryju)
Summary: Can't find a link - although its there
Initial Comment:
Hello everybody,
I have a problem with testing a website. I just wanted to assure that links
are there and I can click on them - but it fails. For information I'm using
JWebUnit 1.4.1.
Here is the code:
<table>
..
<TABLE width="100%" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD class="navigation1Aktiv">
TextOne</TD>
</TR>
<TR>
<TD class="navigation2Aktiv">
TextTwo</TD>
</TR>
<TR>
<TD class="navigation2" id="unav1"
onMouseOver="P7_swapClass(1,'unav1','navigation2Over',
'navigation2Over','td')"
onMouseOut="P7_swapClass(1,'unav1','navigation2',
'navigation2','td')"
onClick="window.location.href='dispatch.do;
jsessionid=******************:-1
?ref=****_***&rai=0&bt_TXN=do'">
<NOSCRIPT>
<A href="dispatch.do;
jsessionid=*******************:-1?ref=1500_****&+
rai=0&bt_TXN=do" class="nav2"
onfocus="if(this.blur)this.blur()">LinkName</A>
</NOSCRIPT>
<script language="JavaScript"> document.write("<a
class='nav2'>LinkName</a>")</script></TD>
</TR>
----------------------------------------------------
And here is the JWebUnit-Code:
package ******;
import net.sourceforge.jwebunit.junit.WebTestCase;
import org.junit.After;
import org.junit.Before;
public class CheckContentMainPage extends WebTestCase{
public CheckContentMainPage(String name){
super(name);
}
public void main(String[] args){
junit.textui.TestRunner.run(CheckContentMainPage.class);
}
@Before
public void setUp() throws Exception{
super.setUp();
getTestContext().setBaseUrl("http://*****/****/");
}
@After
public void tearDown() throws Exception {
}
public void testKreditkartenOnlineLinks(){
setScriptingEnabled(true);
beginAt("/");
assertFormPresent("***");
setWorkingForm("****");
assertSubmitButtonPresent("logon");
submit("logon");
gotoWindow(1); // everything works until this point
assertLinkPresentWithText("LinkName");
// Now I'll get an AssertionFailedError
}
}
----------------------------------------------------
I hope you can help me, because I've tried some things but nothing worked.
Don't know what to do now. ;)
Bye Atop85
----------------------------------------------------------------------
>Comment By: Julien HENRY (henryju)
Date: 2007-12-12 09:25
Message:
Logged In: YES
user_id=1235926
Originator: NO
OK,
Now please send me the result of getPageSource() after gotoWindow(1);
++
Julien
----------------------------------------------------------------------
Comment By: atop85 (atop85)
Date: 2007-12-12 09:20
Message:
Logged In: YES
user_id=1957383
Originator: YES
Hi,
I forgot to say that I first logon and then the browser opens a new window
I switch to. There I've got the problems. Now here is the content of
getPageSource() after submit("logon") from the first page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="IBM WebSphere Studio">
<TITLE> Title </TITLE>
<link rel="stylesheet" href="/****/css/standard.css" type="text/css">
</HEAD>
<BODY>
<H2>****</H2>
<form name="standard"
action="/***/dispatch.do?bt_PRELOGON=1&ticket=***&ref=***"
target=_blank method="POST">
<input type="hidden" name="keepAliveSessionId" value="4712">
<table>
<tr>
<th colspan="2">*** (STD)</th>
</tr>
<tr>
<td><b>*****</b> ****</td>
<td><input type="text" name="*****" value="******"></td>
</tr>
<tr>
<td>*******</td>
<td><input type="text" name="******" value="********"></td>
</tr>
<tr>
<td>********</td>
<td><input type="text" name="*****" value="*******"></td>
</tr>
<tr>
<td>*******</td>
<td><input type="text" name="******" value="******"></td>
</tr>
<tr>
<td>******</td>
<td><input type="text" name="******" value="*****"></td>
</tr>
<tr>
<td>Registration</td>
<td><input type="checkbox" name="registration"
value="true"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" class="button" name="logon" value="Log
on"></td>
</tr>
</table>
</form>
</BODY>
</HTML>
--------------------------
Bye Atop85
----------------------------------------------------------------------
Comment By: Julien HENRY (henryju)
Date: 2007-12-12 09:05
Message:
Logged In: YES
user_id=1235926
Originator: NO
Hi,
Could you please use getPageSource() to display HTML source just after
submit("logon");
++
Julien
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1849169&group_id=61302
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development