User Tag List

Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2012
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)

    Handle a popup in selenium webdriver using c#

    When I click on a button on a page, a popup is displayed. This is not a windows popup. It is the application popup.. The popup I get in my application is similar to the one i have shown in the image with a X button. now How do I move the driver control to the popup and then click on the close button available on the popup and then move back my control back to the original page..

    I have to do this using Selenium Webdriver and C#
    Attached Images Attached Images
    Last edited by ajay600; 12-25-2013 at 02:42 AM.

  2. #2
    SQA Knight bklabel1's Avatar
    Join Date
    Sep 2012
    Kew Gardens, United States
    Post Thanks / Like
    Blog Entries
    2 Post(s)
    2 Thread(s)
    I'm getting a 404 error when trying to look at the image from the link.

    I am starting to learn Selenium so I probably cannot be of value here. I just wanted to let you know that something seems wrong with the link.



  3. #3
    SQA Knight
    Join Date
    May 2006
    Playa Del Rey, California, United States
    Post Thanks / Like
    17 Post(s)
    1 Thread(s)
    That image link is broken. I think the site admin needs to check their Web host setting.

    Off the top of my head, some things i can think of.

    If it's an Alert, a modal dialog that's displayed by the Browser Chrome, not the webpage (these are usually simple yes/no prompts, or OK prompts, no custom styling just a plain browser prompt. You have to use the Alert() class to deal with this.

    selenium.webdriver.common.alert ? Selenium 2.0 documentation

    If it's a dialog that's part of the WebPage itself using an iframe, As in the developer draws and iframe on the screen ontop of your webpage (the way to tell is if you can't drag the window outside of the browser window). Then what you need to do is switch to the iframe context, do your operation, then use switchToDefault to switch back into the parent window.

    selenium.webdriver.remote.webdriver ? Selenium 2.0 documentation
    selenium.webdriver.remote.webdriver ? Selenium 2.0 documentation

    Sorry I don't have the c# refrence on hand, I'm mostly a Java/Python programmer.
    David Lai
    SDET / Consultant
    LinkedIn profile

  4. #4
    New Member
    Join Date
    Jan 2014
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)


    Hi friend:

    I'm new to automation testing.

    I'm using TestNG for learning selenium and Twitter as a test website.

    Please help with the following scenario:

    Pre-Requisite: Login into Twitter

    1. Click on icon on top right side of screen to open a pop-up (This pop-up is to create a New tweet)
    2. Click inside the text box on pop up (the cursor gets highlighted and Tweet button gets enabled)
    3. Enter some text in text box
    4. Click on Tweet button

    I'm using the below code to get the above scenario run, but got stuck in point 3 i.e. im not able to enter text.

    String popUpHandle = driver.getWindowHandle();
    driver.findElement(By.xpath("(//button[@type='button'])[123]")).sendKeys("test tweet");




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 04:32 PM.

Copyright BetaSoft Inc.