English 中文(简体)
How to record popup windows with selenium IDE
原标题:

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




相关问题
Javascript communication with Selenium (RC)

My Application has a lot of calculation being done in JavaScript according to how and when the user acts on the application. The project prints out valuable information (through console calls) as to ...

Running automated Web browser tests under Hudson

I m running Hudson for my automated builds and love it. I d now like to create automated Web browser tests using either WaTiN (preferred) or Selenium. As my Hudson runs as a Windows service (under ...

Using a Java library with Scala reserved words

I m using an external library written in Java (Selenium). One of the function calls has the signature type(String, String), and I keep getting compiler errors when trying to call it from Scala, that ...

Heightened privilege selenium browsers on Windows 7 (x64)

I make use of *firefox and *iexplore etc. within my selenium tests to get around the issue of self-signed SSL certificates on my local machine. Unfortunately, now that I ve moved from XP over to 7, ...

Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Selenium IDE: Incrementing values by 1 and 71

Currently I m incrementing a value called wert by 1 with the following code: getEval storedVars[ wert ]=${wert}+1; The value wert is something like 80401299. I want to add 1 to the value, if it ...

热门标签