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
shrutika
Posts : 4
Join date : 2014-09-26

how to switch to a new window Empty how to switch to a new window

Thu Oct 02, 2014 4:11 pm
hi, I have written a script in selenium rc. I m facing one problem regarding new window selection.
my script issue is when I click on a button the page gets open in new firefox window for which I have written a verification code (i.e waitForCondition("element xpath")..) but my script fails here. iI think since it doesnt switch the window my script may be failing over here.so please help me how to switch window .I tried using selenium.selectWindow("windowtitle/windowname"), still it fails
avatar
Job46
Posts : 3
Join date : 2015-05-22

how to switch to a new window Empty Re: how to switch to a new window

Wed Aug 05, 2015 9:50 pm
Hello , 
this is a C# code that answer your question:

driver.Navigate().GoToUrl("Your URL");

String homePage = driver.CurrentWindowHandle;

//change the window then:

ReadOnlyCollection windows= driver.WindowHandles;
            
           
            String currentWindowId;
            foreach(String window in windows)
            {
                currentWindowId = window.ToString();
                if(currentWindowId.Equals(homePage))
                {
                    driver.SwitchTo().Window(currentWindowId);                 
                    
                }
            }
avatar
Micheal William
Posts : 1
Join date : 2016-05-30

how to switch to a new window Empty Read More

Mon May 30, 2016 3:03 pm
Maximum students in classes or while sitting in the coffee shop or other places frequently ask their mates, “Is there anyone who will write my assignment for me?”Unfortunately, they cannot find anyone who would write their assignments. But now they don’t need to request their friends or relatives to write their assignments for them. Because excellentacademichelp.com will write your assignments and will help you get best academic grades. And you will proudly say that ‘Excellent Academic Help’ made my grade.
avatar
janbaskt
Active particpant
Active particpant
Posts : 11
Join date : 2016-11-21
https://www.janbasktraining.com/selenium-testing-course

how to switch to a new window Empty Re: how to switch to a new window

Mon Nov 21, 2016 6:43 pm
this is best code for New Windows
Sponsored content

how to switch to a new window Empty Re: how to switch to a new window

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