I have a html page with a button and a link.
On clicking the button, a javascript alert is programmed, and the same for the link.
no the issue is that Jameleon script is able the click the Ok on the alert spawned by the button with the help of <ie-send-keys> tag.
but <ie-send-keys> is not working for the alert spawned by the link.
<jm:ie-send-keys
functionId="Click OK."
windowTitle="Windows Internet Explorer"
keys="{ENTER}"
/>
...
I did the following to debug this problem:
- set 'trace' to true in jameleon.conf via the GUI.
- ran the test and saw that it was getting hung up on the ie-click-link tag. It wasn't returning. I then tried setting 'WAIT="false"' on that tag, but that didn't matter.
- tried the trusty ole ie-click-html-element, setting eventToFire='onclick' and it worked.
- I then removed eventToFire setting and it still worked.
It looks like the problem is the ie-click-link tag is not calling the 'onclick' javascript event. To be safe, you might want to add 'eventToFire="onclick"' to the ie-click-html-element tag.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
I have a html page with a button and a link.
On clicking the button, a javascript alert is programmed, and the same for the link.
no the issue is that Jameleon script is able the click the Ok on the alert spawned by the button with the help of <ie-send-keys> tag.
but <ie-send-keys> is not working for the alert spawned by the link.
pls help me out here..
Here is the code.
page121.htm
***********
<html>
<head>
<title>aaa</title>
</head>
<body>
<form name="f1">
<input type="button" name="b1" value="click" onclick="javascript:alert('ok')">
<a href="javascript:alert('link')">click link</a>
</form>
</body>
</html>
sendKeysDemo.xml
****************
<jm:testcase xmlns:jm="jelly:jameleon">
<jm:test-case-summary>Playing with jameleon</jm:test-case-summary>
<jm:test-case-author></jm:test-case-author>
<jm:test-case-level>UNIT</jm:test-case-level>
<jm:test-case-bug>001</jm:test-case-bug>
<jm:test-case-requirement>REQ001</jm:test-case-requirement>
<jm:functional-point-tested>Feature A</jm:functional-point-tested>
<jm:application-tested>MyTestApplication</jm:application-tested>
<jm:ie-session baseUrl="D:\Jam-tests\page121.htm" beginSession="true" sessionDelay="1000">
<jm:ie-click-button
functionId="Click"
value="click"
form="f1"
functionDelay="1000"
/>
<jm:ie-send-keys
functionId="Click OK."
windowTitle="Windows Internet Explorer"
keys="{ENTER}"
functionDelay="1000"
/>
<jm:ie-click-link
functionId="click link"
link="click link"
functionDelay="1000"
/>
<jm:ie-send-keys
functionId="Click OK."
windowTitle="Windows Internet Explorer"
keys="{ENTER}"
/>
</jm:ie-session>
</jm:testcase>
Try the following:
...
<jm:ie-click-button
functionId="Click button"
value="click"
form="f1"
functionDelay="1000"
/>
<jm:ie-send-keys
functionId="Click OK."
windowTitle="Windows Internet Explorer"
keys="{ENTER}"
/>
<jm:ie-click-html-element
functionId="Click link"
xpath="//A[text()='click link']"
functionDelay="1000"
/>
<jm:ie-send-keys
functionId="Click OK."
windowTitle="Windows Internet Explorer"
keys="{ENTER}"
/>
...
I did the following to debug this problem:
- set 'trace' to true in jameleon.conf via the GUI.
- ran the test and saw that it was getting hung up on the ie-click-link tag. It wasn't returning. I then tried setting 'WAIT="false"' on that tag, but that didn't matter.
- tried the trusty ole ie-click-html-element, setting eventToFire='onclick' and it worked.
- I then removed eventToFire setting and it still worked.
It looks like the problem is the ie-click-link tag is not calling the 'onclick' javascript event. To be safe, you might want to add 'eventToFire="onclick"' to the ie-click-html-element tag.
thanks a lot..