Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

Selenium selecting a new Window Empty Selenium selecting a new Window

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



Selenium selecting a new Window CF_exit




Selenium selecting a new Window CF_exit



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)
avatar
rkearney
Posts : 6
Join date : 2011-09-20

Selenium selecting a new Window Empty Multiple windows , cannot close current window

Mon Oct 10, 2011 6:10 pm
Hi,

Can anyone help?

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

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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

Selenium selecting a new Window Empty focus on window

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
pushpendra
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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.


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

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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.
pushpendra
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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
avatar
rsumankumar1
Posts : 7
Join date : 2011-10-18

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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.
pushpendra
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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
pushpendra
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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
avatar
sathiyarengarajan
Active particpant
Active particpant
Posts : 20
Join date : 2013-08-08

Selenium selecting a new Window Empty To Focus on a newly opened window

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
avatar
sathiyarengarajan
Active particpant
Active particpant
Posts : 20
Join date : 2013-08-08

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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

Selenium selecting a new Window Empty Re: Selenium selecting a new Window

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