i have stuck in one point in selenium ide
the scenario is like this
Login-----
go to dashboard page---------
mouse over any menu on the top navigational bar----
on mouseover sub menu will appear as drop down--
now click any link from the drop down --
after clicking link will open in new tab
now from that point on-wards we have to shift our focus to that new tab because rest of the testing will be done on that new tab.
The code i have written is given below
<tr>
<td>open</td>
<td>/magma/dev/</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=user_id</td>
<td>abcd</td>
</tr>
<tr>
<td>type</td>
<td>name=pass</td>
<td>1234</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=btnLogin</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Costing List</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Fuel</td>
<td></td>
</tr>
<tr>
<td>mouseOver</td>
<td>//div[@id='smoothmenu1']/ul/li[3]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Fuel Cost</td>
<td></td>
</tr>
<tr>
<td>selectWindow</td>
<td>http://10.0.1.101/magma/dev/fuelcost/</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Manage Fuel Cost</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Logout</td>
<td></td>
</tr>
This code is working correctly upto clicking the sub menu from the dropdown after that it is not working and a error is showing in the log
so when ever i am trying to run that test case it is showing error
[warn] Link has target '_blank', which is not supported in Selenium! Randomizing target to be: selenium_blank84419
can any one please help me to write the code properly
I use
storeAttribute
incombination withopen
.Link: http://www.seleniumwiki.com/software-testing/how-to-solve-the-link-has-target-_blank-which-is-not-supported-in-selenium/
I use it like this:
use
selectPopUp
, but notstoreEval
andselectWindow
, both of them are too complicated.selectPopUp:
Arguments: windowID - an identifier for the popup window, which can take on a number of different meanings
Simplifies the process of selecting a popup window (and does not offer functionality beyond what selectWindow() already provides).
The code below ( selenium script, I copied from the selenium IDE ) indicates the action of:
1.click a 'edit' link
2.wait for 2 seconds ( waiting for the new window opened)
3.focus on the new window
I am using the following and it works for me, hope it helps! :)
I hope this helps someone out there! It worked well for me. You do still get the warning in the log, but the test works.
Please add waitForPopUp and selectPopUp event after clicking the new tab event. It's worked for me.
Try with option selectWindow() Just provide the window title name withing (). For Ex: Window Title is Testing, then command : selectWindow title : Testing
To know the title of the newly opened window follow the steps: Go to the new window Right click->view page source Press ctrl+F. Type title and serch. You will get the title of the new window