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
sunny mehndiratta
Regular Participant
Regular Participant
Posts : 25
Join date : 2013-03-22

Transfer the focus on pop up Empty Transfer the focus on pop up

Thu Apr 04, 2013 2:19 pm
how can i transfer the focus to the newly opened pop up

i have used selectwindow but its not working there..

please help me out of the problem.

THANKS
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Thu Apr 04, 2013 11:33 pm
I will repost this for you again:

It sounds like your new window does not have an ID. When this happens, Selenium is creating a random name for that window. What does storeAllWindowNames return?
try:

storeAllWindowNames | windowNames
echo | ${windowNames}

storeAllWindowIds | windowIds
echo | ${windowIds}

storeAllWindowTitles | windowtitles
echo | ${windowtitles}

These are 3 different options to get the identifiers for this window. I believe these will store this in an array. Then you should be able to take the window's identifier as a variable from that array and select it. I've never done this before, but let me know what you get from these 3 echo commands.

-Cameron
avatar
sunny mehndiratta
Regular Participant
Regular Participant
Posts : 25
Join date : 2013-03-22

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Mon Apr 08, 2013 11:46 am
i have used these commands its giving me window name like selenium_911234 but i m talking about pop up not window....OR both r same??????
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Mon Apr 08, 2013 9:47 pm
That IS the pop-up window. You are getting something back by doing these commands. Since it doesn't have a static defined id associated to it, you will need to store whatever Selenium gives you. Like I said, use the window's identifier as a variable and select it.

try:

storeAllWindowNames | windowName
selectWindow | ${windowName}
avatar
sunny mehndiratta
Regular Participant
Regular Participant
Posts : 25
Join date : 2013-03-22

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Tue Apr 09, 2013 4:42 pm
will u please open icicilombard.com & go to chat button on the top of homepage... then fill ur details & then run with rc server,,,,, and then let me knw that u r able to take the focus on the chat window or not.......
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Tue Apr 09, 2013 9:53 pm
Code:
public void testPopUp() throws Exception {
      selenium.open("/");
      selenium.click("css=html");
      selenium.click("//img[@alt='Live Chat']");
      selenium.waitForPopUp("chat", "30000");
      selenium.selectWindow("title=Chat Window");
      Thread.sleep(1000);
      selenium.type("id=q1", "john");
   }

This works fine in Selenium IDE(This is posted in the IDE section of the forum). I don't use Selenium RC, but here is the code in JUnit4/RC if you want to give it a shot
avatar
sunny mehndiratta
Regular Participant
Regular Participant
Posts : 25
Join date : 2013-03-22

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Wed Apr 10, 2013 11:38 am
i m also able to do it in selenium ide but in rc select window is not working... n focus is not going to the new popup.....bdw thanks for ur efforts
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Wed Apr 10, 2013 9:39 pm
Put in a pause before doing anything on the window. In the example you gave me, the pop-up does have a name and a title. In the examples you showed before this was not the case. If the pop up does not have a defined name/id you will need to use the window handles.

I would post/search in the RC forum if you can't figure it out since this is the IDE forum.
avatar
sathiyarengarajan
Active particpant
Active particpant
Posts : 20
Join date : 2013-08-08

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Thu Aug 08, 2013 8:43 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

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

Thu Aug 29, 2013 11:39 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

Transfer the focus on pop up Empty Re: Transfer the focus on pop up

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