SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Apprentice
    Join Date
    Oct 2006
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to handle URL redirection new browser window

    Hi Everyone,

    I have situation, where I am not able to figure out what to do?

    Please kindly help me to solve this

    When I enter a URL in the address bar and HIT ENTER OR Click "Go" button this url redirects to a new browser window currently selenium unable to work on the newly opened browser window. Selenium stuck with the MAIN browser window and throws error "Element is not found" the element I am trying to locate is in New browser window.

    I tried to get all window names, title and ID but no use Selenium is not recognizing the new browser window (probably coz of onload redirect method)

    Any suggestions much appreciated

    Thanks
    Sri

  2. #2
    Junior Member
    Join Date
    Aug 2006
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle URL redirection new browser window

    Hi Sri,

    I have handled such situation in URL-redirection test.
    I think if you do the following, then it will work.

    once you click on "GO" button,
    1. put thread.sleep (though,optional)
    2. selenium.selectWindow("SQAForum"); //title of the window
    3. selenium.windowFocus();

    At least, this has worked for me.

  3. #3
    Apprentice
    Join Date
    Oct 2006
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle URL redirection new browser window

    Hi Sanjeet,

    Thanks for the reply, I tried that way but no use, selenium still not able recognize the new browser window (popup) if the url is redirected

    I will try to put sample html with onload url redirect method in it may be you can try with that.

    Thanks
    Sri

  4. #4
    Member
    Join Date
    Sep 2008
    Location
    India
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle URL redirection new browser window

    Hi Sri,

    Try with selenium.getAllWindowNames() and iterate in a loop and find your window by using window name/title and focus it.

    Thanks,
    Vivek
    ~Vivek
    -------------------------------------------
    Software Testing Interview Question and Answer
    --------------------------------------------

  5. #5
    Apprentice
    Join Date
    Oct 2006
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to handle URL redirection new browser window

    Hi Vivek,

    Thanks for the reply I tried all the combination's as below

    String[] allwind = selenium.getAllWindowIds();
    String[] allwindotitle = selenium.getAllWindowTitles();
    String[] allwindownames = selenium.getAllWindowNames();

    non of them identifying child browser window with the above lines of code and still returns parent window only.

    No traces found for the new opened browser.

    I read (some of the forums) that selenium.start("captureNetworkTraffic=true");
    will display all the http requests and responses, I have used this line and it displays the requests made and responses received (when i run Junit tests in debug mode) but I don't know how to drive my code from there?

    Any suggestions much appreciated

    Just want to let you know guys I am tester not a developer so please try to understand that my level of knowledge with programming is minimal that to I am new with selenium and JAVA. However, I am able to manage in understanding any programing language and can modify that for my purposes.

    Thanks
    Sri

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:21 PM.

Copyright BetaSoft Inc.