Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Selenium selecting a new Window

View previous topic View next topic Go down

Selenium selecting a new Window

Post by rkearney 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

Back to top Go down

Multiple windows , cannot close current window

Post by rkearney on Mon Oct 10, 2011 6:10 pm

Hi,

Can anyone help?

thjanks

rkearney

Posts : 6
Join date : 2011-09-20

Back to top Go down

Re: Selenium selecting a new Window

Post by freesky on Tue Oct 11, 2011 10:28 am

try to use ' selectPopUp '

freesky
Amateur
Amateur

Posts : 72
Join date : 2011-04-13

Back to top Go down

focus on window

Post by ram1221 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

ram1221

Posts : 4
Join date : 2011-10-13

Back to top Go down

Re: Selenium selecting a new Window

Post by pushpendra 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.



pushpendra
Active particpant
Active particpant

Posts : 23
Join date : 2011-09-26

Back to top Go down

Re: Selenium selecting a new Window

Post by rsumankumar1 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.

rsumankumar1

Posts : 7
Join date : 2011-10-18

Back to top Go down

Re: Selenium selecting a new Window

Post by pushpendra 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

pushpendra
Active particpant
Active particpant

Posts : 23
Join date : 2011-09-26

Back to top Go down

Re: Selenium selecting a new Window

Post by rsumankumar1 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.

rsumankumar1

Posts : 7
Join date : 2011-10-18

Back to top Go down

Re: Selenium selecting a new Window

Post by pushpendra 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

pushpendra
Active particpant
Active particpant

Posts : 23
Join date : 2011-09-26

Back to top Go down

Re: Selenium selecting a new Window

Post by pushpendra 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

pushpendra
Active particpant
Active particpant

Posts : 23
Join date : 2011-09-26

Back to top Go down

To Focus on a newly opened window

Post by sathiyarengarajan 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

Back to top Go down

Re: Selenium selecting a new Window

Post by sathiyarengarajan 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.

sathiyarengarajan
Active particpant
Active particpant

Posts : 20
Join date : 2013-08-08

Back to top Go down

Re: Selenium selecting a new Window

Post by Sponsored content Today at 11:57 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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