Share
Go down
rkearney
Posts : 6
Join date : 2011-09-20

Selenium selecting a new Window

on Wed Sep 28, 2011 12:03 am
Hi,.

We have started usng Selenium but running into problems selecting a new window and closing it. It simple does not recongnize it at all,. I have tried various opton like getallwindows name/id etc but it still seems to pick up the main windiow. I have treid select frame , window focus, storeattributes , loads of things but to no avail. It is probably straight forward but cannot get an resolution

here is the code for the close report attached. For some reason I cannot copy it here

Code:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<frameset border="1" framespacing="1" rows="40,*">
<frame id="Reporttoolbar" scrolling="No" noresize="" src="rtoolbar.htm?Id=01B2_02923E90_01A852F9_00000000" name="Reporttoolbar">
<html>
<head>
</head>
<body class="REPTOOLBAR" marginheight="3" topmargin="3" onfocus="ClosePopup();return true;">
<script type="text/javascript">
</script>
<table class="InnerWindow" cols="9" cellspacing="0" cellpadding="0" border="0" width="1">
<tbody>
<tr>
<td>
</td>
<td nowrap="">
<a title="Close Report" href="/Report/Report.htm?Id=01B2_02923E90_01A852F9_00000000&Close"></a>
</td







































thanks












Last edited by rkearney on Mon Oct 03, 2011 11:45 pm; edited 4 times in total (Reason for editing : I added an attachment with the code)
rkearney
Posts : 6
Join date : 2011-09-20

Multiple windows , cannot close current window

on Mon Oct 10, 2011 6:10 pm
Hi,

Can anyone help?

thjanks
freesky
Amateur
Amateur
Posts : 72
Join date : 2011-04-13

Re: Selenium selecting a new Window

on Tue Oct 11, 2011 10:28 am
try to use ' selectPopUp '
ram1221
Posts : 4
Join date : 2011-10-13

focus on window

on Fri Oct 14, 2011 5:49 pm
I think this might help. As i am into videos. The mail is sent to the E-Mail, where i have to get the link and its dynamic.

storeEval / alert
chooseOkOnNextConfirmation
click / link=wwwcom
selectwindow / window id . Now it will pop another window with the blank window. now use
Selectwindow / null
windowFocus . Hope this is what u expected.

Thankyou
avatar
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

Re: Selenium selecting a new Window

on Tue Oct 18, 2011 6:53 pm
which language you r using and in which browser u want to run it in IE and Firefox.
in both browser there are different ways to focus on pop ups or new window.


rsumankumar1
Posts : 7
Join date : 2011-10-18

Re: Selenium selecting a new Window

on Thu Oct 20, 2011 9:39 pm
I am also facing exactly the same problem. Unable to bring focus onto the new window using selenium.selectWindow(), selectFrame etc.

I am using it from java and running on firefox.

Please help.
avatar
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

Re: Selenium selecting a new Window

on Thu Oct 20, 2011 10:06 pm
hi,
when there is any another web page opens to focus on new window first

use
thread.currentThread().sleep(1000)

and then use selenium.

to get focus in firefox u can use
selenium.selectWindow(selenium.getAllWindowNames()[selenium.getAllWindowNames().length-1])

and for IE
selenium.selectWindow("Window title");

hope this can help u
all d bst
rsumankumar1
Posts : 7
Join date : 2011-10-18

Re: Selenium selecting a new Window

on Fri Oct 21, 2011 12:46 pm
Hi,

Thanks for the quick reply. Actually when i execute
selenium.click("pt1:pc1:t1:1:gi1::icon"); (this is my component id) and this opens up a new page and this page is a javascript enabled page i guess ..it is fundementally showing zip file's content (which is deployed on same domain).

so after this page opens up, i executed the i used the one u mentioned and it gave below error: "Could not find window with title 2118w71q1_1".

Actually if i use selenium.open(with the direct URL here, ) and then do selenium.selectWindow(Mywin) then the focus seems to be coming ... but i cannot use selenium.open() because i would not know the complete URL everytime.

Also the 2nd problem after i get focus on the window is to search for a given string in the page for which i have to get focus on the 2nd frame. That is also not happening Sad

Could you please help ?

Thanks.
avatar
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

Re: Selenium selecting a new Window

on Fri Oct 21, 2011 1:19 pm
hi
I think you need to use selenium.getWindowTitle() method name and pass the title name as i explained u last time.

if u r using Firefox then it works but it might give sme problem in IE.

one more think you can use

String baseUrl="";
and later u can set the url in this method so that current url will always available to u.

Try this.

All d bst
avatar
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

Re: Selenium selecting a new Window

on Wed Nov 23, 2011 8:04 pm
hi,
i am facing problem in handling validation pop up window.
getAllWindowTitle() , getAllWindowNames() and isAlertPresent() .
Nothing is wrkin for me.

Can you help me another way to handle validation alert.

Thanks
sathiyarengarajan
Active particpant
Active particpant
Posts : 20
Join date : 2013-08-08

To Focus on a newly opened window

on Thu Aug 08, 2013 8:31 pm
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
sathiyarengarajan
Active particpant
Active particpant
Posts : 20
Join date : 2013-08-08

Re: Selenium selecting a new Window

on Thu Aug 29, 2013 11:42 pm
Selenium IDE is a firefox plugin.
Firefox blocks the newly opening windows/tabs when you replay the scripts recorded in selenium IDE.
You should change the firefox settings to allow opening of new windows/tabs.
Hope this helps.

Thanks.
Sponsored content

Re: Selenium selecting a new Window

Back to top
Permissions in this forum:
You cannot reply to topics in this forum