2
votes

I am having problems testing a pop-up menu in Selenium IDE.

Within the pop-up there is a button that calls a JavaScript function (that updates a list )and closes the pop-up.

The test will click on the button but the JavaScript function doesn’t get called and the pop-up doesn’t close.

If I double click the command myself it works, If spilt the test in two (having the button click in a different case) and run them separately it works

Has anyone encountered this problem before and explain what is happening?

verifyElementPresent | //td[2]/a/img | |
click | //td[2]/a/img | |
waitForPopUp | lookup | 30000 |
selectWindow | name=lookup | |
click | Checkbox1 | |
click | //table[@id='Table2']/tbody/tr/td[1]/a/img | | 
1
Are there any issues with executing a test case that calls a javascript function add(1) that generates a pop-up then (in the same execution) within the pop-up call another javascript function save() - David Cunningham
Do I need to provide more information - David Cunningham

1 Answers

0
votes

I have solved the problem myself, simply get the element by tag name and use the runSrcipt command!

|verifyElementPresent | //td[2]/a/img | |
|click | //td[2]/a/img | |
|waitForPopUp | lookup | 30000 |
|selectWindow | name=lookup | |
|click | Checkbox1 | |
|storeEval | selenium.browserbot.getCurrentWindow().document.getElementsByTagName('a')[3]|test |
|echo | ${test} | |
|echo: javascript:save();
|runScript | ${test} | |
|close | |