How to record popup windows with selenium IDE

自闭症网瘾萝莉.ら 提交于 2019-11-28 12:47:28

If that pop up window has name, like opening from javascript window.open(URL, name). Then it is possible to add the command to check the content of the popup. Like following command: waitForPopUp | winId | 30000 selectWindow | winId ... close

However, if the window has no name, like opened from <a target="_blank"> then you are out of luck.

Go to http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ#SeleniumCoreFAQ-HowdoIworkwithapopupwindow%3F for further details.

Selenium IDE does not recognize any kind of popup, either you have to add it manually or Use Selenium RC, pop are handled there.

Mahesh

You must use the command WaitForPopUp and value 30000

Try this and record properly.

Unfortunately Selenium IDE record/replay doesn't always record everything. It tries it best to do that but if there is an AJAX call it may not record this.

Best practise is to use the record to get a the main body of the test and then adapt it to handle the parts that it missed

I suggest manually adding those extra lines to your tests.

Selenium IDE can record popup, below is my code I record Popup through selenium, check and let me know

 <tr>
<td>click</td>
<td>id=edit-legal-accept</td> // click on this then pop up is open
<td></td>
</tr>
<tr>
<td>waitForPopUp</td>
<td>CtrlWindow</td>
<td>30000</td>
</tr>
<tr>
<td>selectWindow</td> 
<td>name=CtrlWindow</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Terms And Conditions</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Terms &amp; Conditions of Use</td>
<td></td>
</tr>
<tr>
<td>close</td>
<td></td>
<td></td>
</tr>
<tr>
<td>selectWindow</td>  // This command used to select our main windows
<td>null</td>  
<td></td>
</tr>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!