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