How to record popup windows with selenium IDE

♀尐吖头ヾ 提交于 2019-11-27 07:21:22

问题


While recording through Selenium IDE, When a pop up window opens it is not getting recorded. "At the time of executing an error message is displayed.Please help me out.


回答1:


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.




回答2:


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




回答3:


You must use the command WaitForPopUp and value 30000

Try this and record properly.




回答4:


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.




回答5:


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>


来源:https://stackoverflow.com/questions/2092149/how-to-record-popup-windows-with-selenium-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!