开发者

Selenium IDE: problems calling javascript from within a pop-up

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 | | 


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 | |  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜