Hi,

I am using selenium webdriver to automate a web application.
In the application thee are some 'Modal pop up' windows and some are 'Ajax
pop up' windows.
I have tried with:
driver.switchto().window() and
Alert alert = driver.switchto().alert()
But none of them are working.
Please suggest a solution for this.


Regards,
Rajesh
Email: raj224in@gmail.com

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Akki at Sep 15, 2012 at 4:38 pm
    AJAX modal pop ups are not handled in the same way as browser alerts. You
    can easily find locators for the web elements on AJAX modals and perform
    the desired action on them like you do on any other web element.

    P.S: I am working on a site with a lots of these AJAX modals.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/NCd8tZihN9sJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Lolz ha ha ha at Sep 16, 2012 at 8:11 am
    Hi akki,

    Can you plz provide a sample code, as am also facing the same problem what
    Rajesh is facing.

    Regards
    Nitin Rajpal
    On Saturday, 15 September 2012 22:08:53 UTC+5:30, akki wrote:

    AJAX modal pop ups are not handled in the same way as browser alerts. You
    can easily find locators for the web elements on AJAX modals and perform
    the desired action on them like you do on any other web element.

    P.S: I am working on a site with a lots of these AJAX modals.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/CSpZ4QQZXoYJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Akki at Sep 17, 2012 at 12:52 am
    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element. So
    you can perform all those actions which you can perform on a normal web
    element.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/28DyvI5tDw8J.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 17, 2012 at 3:09 pm
    Locating the buttons or fields in a pop up window using xpath or id is not
    working, as the button is in a new window.
    And the control is still in the main window and not in the pop up window. I
    am facing issue with handling a pop up window inside a pop up window.
    As i am not able to set the control in the 2nd pop up window, find element
    is failing.




    Regards,
    Rajesh
    Email: raj224in@gmail.com
    On Mon, Sep 17, 2012 at 6:22 AM, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/28DyvI5tDw8J.

    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Nitin Rajpal at Sep 17, 2012 at 4:32 pm
    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal
    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 17, 2012 at 4:44 pm
    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin62002@gmail.com
    To: selenium-users@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html"); Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();
    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing
    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.



    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Nitin Rajpal at Sep 17, 2012 at 4:49 pm
    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk
    wrote:
    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html
    ");
    Thread.sleep(3000l);

    driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 17, 2012 at 4:51 pm
    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com
    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.
    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:



    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html"); Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();
    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing
    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.




    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.

    For more options, visit https://groups.google.com/groups/opt_out.









    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 17, 2012 at 5:04 pm
    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,
    Rajesh
    Email: raj224in@gmail.com
    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com
    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 17, 2012 at 4:59 pm
    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter

    Date: Mon, 17 Sep 2012 22:26:17 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".

    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,

    Rajesh

    Email: raj224in@gmail.com


    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:





    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com

    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.


    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.

    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:




    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com

    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");
    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();

    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:
    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing

    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.





    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.

    For more options, visit https://groups.google.com/groups/opt_out.









    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 17, 2012 at 5:15 pm
    I have tried with :driver.switchTo().window("popup") to switch the control
    to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So i
    just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
    <script type="text/javascript" language="javascript"> function
    RefreshParentPage(msg) { alert(msg); if
    (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor(); else if
    (window.opener) window.opener.ReloadTranscriptEditor();
    self.close(); } </script>



    Regards,
    Rajesh
    Email: raj224in@gmail.com
    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,
    Rajesh
    Email: raj224in@gmail.com

    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com
    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 17, 2012 at 5:44 pm
    Looks like you have dealt with the "alert(msg);" popup.
    You could be gettign eother of these two windows/dialogs appearing:
    parent.dialogArguments.ReloadTranscriptEditor();
    window.opener.ReloadTranscriptEditor();

    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.
    Date: Mon, 17 Sep 2012 22:44:56 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So i just tried with 'popup' and it worked.

    But now clicking on a button i am getting one more window, which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch the control to this second window, change the combo box value, click on update button. And switch back the control to first pop up window.

    <head><title>
    Change WorkType
    </title>
    <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />

    <script type="text/javascript" language="javascript">
    function RefreshParentPage(msg) {

    alert(msg);

    if (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor();
    else if (window.opener)
    window.opener.ReloadTranscriptEditor();

    self.close();
    }

    </script>

    Regards,

    Rajesh

    Email: raj224in@gmail.com


    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:





    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter

    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com

    To: selenium-users@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".


    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,

    Rajesh

    Email: raj224in@gmail.com


    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:





    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com


    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.



    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.


    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:





    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com


    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:

    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");

    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();


    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing


    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.






    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.









    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 17, 2012 at 5:38 pm
    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.

    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.ReloadTranscriptEditor();
    window.opener.ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.

    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control
    to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.ReloadTranscriptEditor(); else if (window.opener) window.opener.ReloadTranscriptEditor(); self.close(); } </script>



    Regards,
    Rajesh
    Email: raj224in@gmail.com

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,
    Rajesh
    Email: raj224in@gmail.com

    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com
    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 17, 2012 at 5:48 pm
    which IE driver u r using??



    On Monday, September 17, 2012 11:08:42 PM UTC+5:30, Rajesh Ranjan wrote:

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.ReloadTranscriptEditor();

    window.opener.ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.

    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    I have tried with :driver.switchTo().window("popup") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.ReloadTranscriptEditor(); else if (window.opener) window.opener.ReloadTranscriptEditor(); self.close(); } </script>



    Regards,
    Rajesh
    Email: raj2...@gmail.com <javascript:>

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,
    Rajesh
    Email: raj2...@gmail.com <javascript:>

    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/jVCxJ7aKwKgJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 17, 2012 at 6:22 pm
    2.25.3.0
    On Mon, Sep 17, 2012 at 11:18 PM, Manoj Hans wrote:

    which IE driver u r using??



    On Monday, September 17, 2012 11:08:42 PM UTC+5:30, Rajesh Ranjan wrote:

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadTranscriptEditor();

    window.opener.**ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.

    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**popup") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked.
    So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadTranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscriptEditor(); self.close(); } </script>



    Regards,
    Rajesh
    Email: raj2...@gmail.com

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,
    Rajesh
    Email: raj2...@gmail.com

    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit**.org/reference-**guide/1.8/**
    dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".****//*[@id='docs_MiniGlass_0']/a[****
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of
    the emails and click on the report spam icon. It will make an alert modal
    pop up. Now use firebug/firepath to find locators of the elements on the
    modal. Lets say you want to click on 'Report Spam' button. You can do that
    just by writing

    driver.findElement(By.xpath("**h**tml/body/div[8]/div[3]/**button[**
    1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**
    ms**g/selenium-users/-/**DqnzBvlH0uk**J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**45EHykZfzl4J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/jVCxJ7aKwKgJ.

    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 17, 2012 at 5:53 pm
    I can only see one popup window, and it looks like a html page that has been opened in a new window ... you should be able to use the getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then normal WebDriver methods to deal with the html elements of the page.

    Date: Mon, 17 Sep 2012 23:08:34 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:





    Looks like you have dealt with the "alert(msg);" popup.
    You could be gettign eother of these two windows/dialogs appearing:
    parent.dialogArguments.ReloadTranscriptEditor();

    window.opener.ReloadTranscriptEditor();

    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.

    Date: Mon, 17 Sep 2012 22:44:56 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control to first pop up window.

    I tried with the window title in place of 'popup'. But nothing worked. So i just tried with 'popup' and it worked.

    But now clicking on a button i am getting one more window, which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch the control to this second window, change the combo box value, click on update button. And switch back the control to first pop up window.


    <head><title>
    Change WorkType
    </title>
    <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />

    <script type="text/javascript" language="javascript">
    function RefreshParentPage(msg) {

    alert(msg);

    if (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor();
    else if (window.opener)
    window.opener.ReloadTranscriptEditor();

    self.close();
    }

    </script>

    Regards,

    Rajesh

    Email: raj224in@gmail.com


    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:





    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter

    Date: Mon, 17 Sep 2012 22:26:17 +0530


    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com


    To: selenium-users@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".



    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,

    Rajesh

    Email: raj224in@gmail.com


    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:





    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com



    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.




    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.



    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:






    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com



    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:


    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");


    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();



    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:


    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing



    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.







    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 17, 2012 at 5:58 pm
    I think ur case is like that .....

    1.Main window
    2. Popup window
    3. combo box

    m i right??


    On Monday, September 17, 2012 11:23:25 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:
    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.ReloadTranscriptEditor();

    window.opener.ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.

    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    I have tried with :driver.switchTo().window("popup") to switch the control
    to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.ReloadTranscriptEditor(); else if (window.opener) window.opener.ReloadTranscriptEditor(); self.close(); } </script>



    Regards,
    Rajesh
    Email: raj2...@gmail.com <javascript:>

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.


    Regards,
    Rajesh
    Email: raj2...@gmail.com <javascript:>

    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/2UVld6AJWYYJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 17, 2012 at 6:00 pm
    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.
    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:

    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.ReloadTranscriptEditor();


    window.opener.ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.

    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control
    to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.ReloadTranscriptEditor(); else if (window.opener) window.opener.ReloadTranscriptEditor(); self.close(); } </script>



    Regards,
    Rajesh
    Email: raj224in@gmail.com

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com
    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 17, 2012 at 6:02 pm
    Have you tried getWindowHandles()?

    Date: Mon, 17 Sep 2012 23:30:39 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:









    I can only see one popup window, and it looks like a html page that has been opened in a new window ... you should be able to use the getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then normal WebDriver methods to deal with the html elements of the page.



    Date: Mon, 17 Sep 2012 23:08:34 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com


    To: selenium-users@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this would be enough.




    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:





    Looks like you have dealt with the "alert(msg);" popup.
    You could be gettign eother of these two windows/dialogs appearing:
    parent.dialogArguments.ReloadTranscriptEditor();



    window.opener.ReloadTranscriptEditor();

    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.



    Date: Mon, 17 Sep 2012 22:44:56 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control to first pop up window.



    I tried with the window title in place of 'popup'. But nothing worked. So i just tried with 'popup' and it worked.

    But now clicking on a button i am getting one more window, which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch the control to this second window, change the combo box value, click on update button. And switch back the control to first pop up window.




    <head><title>
    Change WorkType
    </title>
    <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />

    <script type="text/javascript" language="javascript">
    function RefreshParentPage(msg) {

    alert(msg);

    if (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor();
    else if (window.opener)
    window.opener.ReloadTranscriptEditor();

    self.close();
    }

    </script>

    Regards,

    Rajesh

    Email: raj224in@gmail.com


    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:





    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter

    Date: Mon, 17 Sep 2012 22:26:17 +0530




    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com




    To: selenium-users@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".





    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:







    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com





    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.






    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.





    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:








    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com





    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:




    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");




    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();





    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:




    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing





    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.









    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 17, 2012 at 6:06 pm
    last one not a combo box...its modal dialog....


    try this

    String WinNameA=driver.getWindowHandle();//get id of WinNameA
    System.out.println(WinNameA);
    driver.findElement(By.id("Click for pop up")).click();

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;
    }

    System.out.println(availableWindows.size());
    String WinNameB=null;
    for(String win:availableWindows){
    if(!win.equals(WinNameA)){
    WinNameB=win;
    driver.switchTo().window(WinNameB);
    System.out.println(driver.getTitle());

    driver.findElement(By.xpath("click for modal dialog")).click();
    java.util.Set<String> availableWindows1;
    while(true){
    availableWindows1=driver.getWindowHandles();
    if(availableWindows1.size()==3)
    break;
    }

    System.out.println(availableWindows1.size());
    String modal=null;
    for(String win1:availableWindows1){
    if(!win1.equals(WinNameA)){
    if(!win1.equals(WinNameB)){
    modal=win1;
    }
    }
    driver.switchTo().window(modal);
    System.out.println(driver.getTitle());

    System.out.println(driver.getcurrentUrl());
    }}}


    --Manoj Hans

    On Monday, September 17, 2012 11:32:28 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:
    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.ReloadTranscriptEditor();



    window.opener.ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.


    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    I have tried with :driver.switchTo().window("popup") to switch the control
    to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.ReloadTranscriptEditor(); else if (window.opener) window.opener.ReloadTranscriptEditor(); self.close(); } </script>



    Regards,
    Rajesh
    Email: raj2...@gmail.com <javascript:>

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/EwDjd5d4FWcJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 17, 2012 at 6:07 pm
    yes..i have tried this also
    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.ReloadTranscriptEditor();



    window.opener.ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.


    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control
    to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.ReloadTranscriptEditor(); else if (window.opener) window.opener.ReloadTranscriptEditor(); self.close(); } </script>



    Regards,
    Rajesh
    Email: raj224in@gmail.com

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com
    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj224in@gmail.com

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 17, 2012 at 6:10 pm
    So show us the code you have tried and any error messages you got ... it' not very helpful just to say it doesn't work without telling us what yo tried.

    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:





    Have you tried getWindowHandles()?

    Date: Mon, 17 Sep 2012 23:30:39 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with the same.

    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:










    I can only see one popup window, and it looks like a html page that has been opened in a new window ... you should be able to use the getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then normal WebDriver methods to deal with the html elements of the page.




    Date: Mon, 17 Sep 2012 23:08:34 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com



    To: selenium-users@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this would be enough.





    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:





    Looks like you have dealt with the "alert(msg);" popup.
    You could be gettign eother of these two windows/dialogs appearing:
    parent.dialogArguments.ReloadTranscriptEditor();




    window.opener.ReloadTranscriptEditor();

    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.




    Date: Mon, 17 Sep 2012 22:44:56 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control to first pop up window.




    I tried with the window title in place of 'popup'. But nothing worked. So i just tried with 'popup' and it worked.

    But now clicking on a button i am getting one more window, which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch the control to this second window, change the combo box value, click on update button. And switch back the control to first pop up window.





    <head><title>
    Change WorkType
    </title>
    <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />

    <script type="text/javascript" language="javascript">
    function RefreshParentPage(msg) {

    alert(msg);

    if (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor();
    else if (window.opener)
    window.opener.ReloadTranscriptEditor();

    self.close();
    }

    </script>

    Regards,

    Rajesh

    Email: raj224in@gmail.com


    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:





    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter

    Date: Mon, 17 Sep 2012 22:26:17 +0530





    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com





    To: selenium-users@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".






    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:








    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin62002@gmail.com






    To: selenium-users@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.







    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.






    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:









    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com






    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:





    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");





    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();






    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:





    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing






    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.









    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.







    --
    Regards,

    Rajesh

    Mob: 9535268715

    Email: raj224in@gmail.com





    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 17, 2012 at 6:51 pm
    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???

    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:
    So show us the code you have tried and any error messages you got ... it'
    not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.ReloadTranscriptEditor();




    window.opener.ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.



    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    I have tried with :driver.switchTo().window("popup") to switch the control
    to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.ReloadTranscriptEditor(); else if (window.opener) window.opener.ReloadTranscriptEditor(); self.close(); } </script>



    Regards,
    Rajesh
    Email: raj2...@gmail.com <javascript:>

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit.org/reference-**
    guide/1.8/dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**//*[@id='docs_MiniGlass_0']/a[**
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**html/body/div[8]/div[3]/**
    button[1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**DqnzBvlH0ukJ<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.






    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com <javascript:>

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 18, 2012 at 3:26 pm
    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the
    code to switch the control to the modal pop up window:

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnChangeWorkType")).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHandle);

    }

    System.*out*.println(driver.getTitle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVisibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(newwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)

    at java.util.LinkedHashMap$KeyIterator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnChangeWorkType")).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePopUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*);





    Exception : *java.lang.NullPointerException*: String initializer must be
    non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:
    So show us the code you have tried and any error messages you got ...
    it' not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadTranscriptEditor();





    window.opener.**ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.




    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**popup") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadTranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscriptEditor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit**.org/reference-**guide/1.8/**
    dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".****//*[@id='docs_MiniGlass_0']/a[****
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**h**tml/body/div[8]/div[3]/**button[**
    1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**ms
    **g/selenium-users/-/**DqnzBvlH0uk**J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**45EHykZfzl4J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.

    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 18, 2012 at 3:48 pm
    Rajesh

    We need to uinderstand how these lines:
    parent.dialogArguments.ReloadTranscriptEditor();

    window.opener.ReloadTranscriptEditor();

    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter

    Date: Tue, 18 Sep 2012 20:49:12 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the code to switch the control to the modal pop up window:

    1.

    String winHandleBefore = driver.getWindowHandle();



    driver.findElement(By.id("btnChangeWorkType")).click();



    Thread.sleep(1000);



    for(String winHandle : driver.getWindowHandles()){




    driver.switchTo().window(winHandle);



    }



    System.out.println(driver.getTitle());







    new Select(driver.findElement(By.id("ddlWorkType"))).selectByVisibleText("NOTE");









    Exception: org.openqa.selenium.NoSuchElementException: Unable to find element by id
    using "ddlWorkType"



    System info: os.name:
    'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();



    Iterator<String> it = handles.iterator();



    //iterate through your windows



    while (it.hasNext()){



    String parent
    = it.next();

    String newwin = it.next();



    driver.switchTo().window(newwin);







    driver.close();








    }



    This code is
    switching control to the main window.

    Exception : java.util.NoSuchElementException



    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)

    at java.util.LinkedHashMap$KeyIterator.next(Unknown
    Source)







    3. Set<String> beforePopUp = driver.getWindowHandles();



    driver.findElement(By.id("btnChangeWorkType")).click();



    Thread.sleep(1000);



    //Get all the window handles in a set



    //get window handles after the click



    Set<String>
    afterPopup = driver.getWindowHandles();





    //remove all window
    handles before the popup

    afterPopup.removeAll(beforePopUp);



    if(afterPopup.size() == 1) {



    popUp = (String) afterPopup.toArray()[0];



    } else {





    }



    //switch to popUp



    driver.switchTo().window(popUp);







    Exception : java.lang.NullPointerException: String initializer must be
    non-null

    at com.sun.jna.WString.<init>(WString.java:23)







    Regards,
    Rajesh

    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:


    show the error msg...most probably exception is unhandlemodaldialog....
    but i want to know about the title, console printed all title or not???



    On Monday, September 17, 2012 11:40:17 PM UTC+5:30, PeterJef...@Hotmail.co.uk wrote:





    So show us the code you have tried and any error messages you got ... it' not very helpful just to say it doesn't work without telling us what yo tried.

    Date: Mon, 17 Sep 2012 23:37:33 +0530


    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:





    Have you tried getWindowHandles()?

    Date: Mon, 17 Sep 2012 23:30:39 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.



    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    I have tried with the same.

    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:












    I can only see one popup window, and it looks like a html page that has been opened in a new window ... you should be able to use the getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then normal WebDriver methods to deal with the html elements of the page.






    Date: Mon, 17 Sep 2012 23:08:34 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.


    From: raj2...@gmail.com



    To: seleniu...@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this would be enough.





    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:





    Looks like you have dealt with the "alert(msg);" popup.
    You could be gettign eother of these two windows/dialogs appearing:
    parent.dialogArguments.ReloadTranscriptEditor();






    window.opener.ReloadTranscriptEditor();

    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.






    Date: Mon, 17 Sep 2012 22:44:56 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.



    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control to first pop up window.





    I tried with the window title in place of 'popup'. But nothing worked. So i just tried with 'popup' and it worked.

    But now clicking on a button i am getting one more window, which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch the control to this second window, change the combo box value, click on update button. And switch back the control to first pop up window.







    <head><title>
    Change WorkType
    </title>
    <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />

    <script type="text/javascript" language="javascript">
    function RefreshParentPage(msg) {

    alert(msg);

    if (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor();
    else if (window.opener)
    window.opener.ReloadTranscriptEditor();

    self.close();
    }

    </script>

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:







    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter


    Date: Mon, 17 Sep 2012 22:26:17 +0530





    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com





    To: seleniu...@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".








    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:










    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com






    To: seleniu...@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.







    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.








    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:











    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com








    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:







    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");







    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();








    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:







    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing








    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.



    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.









    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.


    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.







    --Forwarded Message Attachment--





    Change WorkType




















    Note:- Change of Work Type will Reload the Editor Window.


    Work Type:

    Select
    CONSULT NOTE
    GENERAL
    PROGRESS NOTE



















    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 18, 2012 at 3:54 pm
    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale
    wrote:
    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadTranscriptEditor();

    window.opener.**ReloadTranscriptEditor();

    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the
    code to switch the control to the modal pop up window:

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnChangeWorkType")).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHandle);

    }

    System.*out*.println(driver.getTitle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVisibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(newwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)

    at java.util.LinkedHashMap$KeyIterator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnChangeWorkType")).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePopUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*);





    Exception : *java.lang.NullPointerException*: String initializer must be
    non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ... it'
    not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:

    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadTranscriptEditor();






    window.opener.**ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.





    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**popup") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadTranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscriptEditor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit**.org/reference-**guide/1.8/**
    dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".****//*[@id='docs_MiniGlass_0']/a[****
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**h**tml/body/div[8]/div[3]/**button[**
    1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**ms*
    *g/selenium-users/-/**DqnzBvlH0uk**J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**45EHykZfzl4J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.

    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 18, 2012 at 5:58 pm
    Rajesh

    You've said that several times already and it doesn't help. People here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    In this pop up window, changing the combo box value and clicking on 'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and control will go to the first pop uo window.



    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale wrote:





    Rajesh

    We need to uinderstand how these lines:
    parent.dialogArguments.ReloadTranscriptEditor();

    window.opener.ReloadTranscriptEditor();

    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.


    Nothing in your attachment tells us that that I can see.

    Peter

    Date: Tue, 18 Sep 2012 20:49:12 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the code to switch the control to the modal pop up window:

    1.

    String winHandleBefore = driver.getWindowHandle();




    driver.findElement(By.id("btnChangeWorkType")).click();




    Thread.sleep(1000);




    for(String winHandle : driver.getWindowHandles()){





    driver.switchTo().window(winHandle);




    }




    System.out.println(driver.getTitle());









    new Select(driver.findElement(By.id("ddlWorkType"))).selectByVisibleText("NOTE");










    Exception: org.openqa.selenium.NoSuchElementException: Unable to find element by id
    using "ddlWorkType"




    System info: os.name:
    'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();




    Iterator<String> it = handles.iterator();




    //iterate through your windows




    while (it.hasNext()){




    String parent
    = it.next();

    String newwin = it.next();




    driver.switchTo().window(newwin);









    driver.close();










    }



    This code is
    switching control to the main window.

    Exception : java.util.NoSuchElementException




    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)

    at java.util.LinkedHashMap$KeyIterator.next(Unknown
    Source)







    3. Set<String> beforePopUp = driver.getWindowHandles();




    driver.findElement(By.id("btnChangeWorkType")).click();




    Thread.sleep(1000);




    //Get all the window handles in a set




    //get window handles after the click




    Set<String>
    afterPopup = driver.getWindowHandles();






    //remove all window
    handles before the popup

    afterPopup.removeAll(beforePopUp);




    if(afterPopup.size() == 1) {




    popUp = (String) afterPopup.toArray()[0];




    } else {






    }




    //switch to popUp




    driver.switchTo().window(popUp);








    Exception : java.lang.NullPointerException: String initializer must be
    non-null

    at com.sun.jna.WString.<init>(WString.java:23)








    Regards,
    Rajesh

    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:



    show the error msg...most probably exception is unhandlemodaldialog....
    but i want to know about the title, console printed all title or not???




    On Monday, September 17, 2012 11:40:17 PM UTC+5:30, PeterJef...@Hotmail.co.uk wrote:






    So show us the code you have tried and any error messages you got ... it' not very helpful just to say it doesn't work without telling us what yo tried.

    Date: Mon, 17 Sep 2012 23:37:33 +0530



    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:





    Have you tried getWindowHandles()?

    Date: Mon, 17 Sep 2012 23:30:39 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.




    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    I have tried with the same.

    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:













    I can only see one popup window, and it looks like a html page that has been opened in a new window ... you should be able to use the getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then normal WebDriver methods to deal with the html elements of the page.







    Date: Mon, 17 Sep 2012 23:08:34 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.



    From: raj2...@gmail.com



    To: seleniu...@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this would be enough.





    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:





    Looks like you have dealt with the "alert(msg);" popup.
    You could be gettign eother of these two windows/dialogs appearing:
    parent.dialogArguments.ReloadTranscriptEditor();







    window.opener.ReloadTranscriptEditor();

    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.







    Date: Mon, 17 Sep 2012 22:44:56 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.




    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control to first pop up window.





    I tried with the window title in place of 'popup'. But nothing worked. So i just tried with 'popup' and it worked.

    But now clicking on a button i am getting one more window, which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch the control to this second window, change the combo box value, click on update button. And switch back the control to first pop up window.








    <head><title>
    Change WorkType
    </title>
    <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />

    <script type="text/javascript" language="javascript">
    function RefreshParentPage(msg) {

    alert(msg);

    if (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor();
    else if (window.opener)
    window.opener.ReloadTranscriptEditor();

    self.close();
    }

    </script>

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:








    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter


    Date: Mon, 17 Sep 2012 22:26:17 +0530





    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com





    To: seleniu...@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".









    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:











    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com






    To: seleniu...@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.







    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.









    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:












    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com









    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:








    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");








    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();









    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:








    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing









    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.




    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.


    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.







    --Forwarded Message Attachment--
























    Note:- Change of Work Type will Reload the Editor Window.


    Work Type:

    Select
    CONSULT NOTE
    GENERAL
    PROGRESS NOTE






















    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 18, 2012 at 4:17 pm
    I also can't understand wt rajesh trying to say.....At last if possible for
    u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:
    Rajesh

    You've said that several times already and it doesn't help. People here
    need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadTranscriptEditor();

    window.opener.**ReloadTranscriptEditor();

    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the
    code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnChangeWorkType")).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHandle);
    }
    System.*out*.println(driver.getTitle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVisibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(newwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)
    at java.util.LinkedHashMap$KeyIterator.next(Unknown Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnChangeWorkType")).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePopUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*);


    Exception : *java.lang.NullPointerException*: String initializer must be
    non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans <hman...@gmail.com<javascript:>
    wrote:
    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ... it'
    not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:

    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadTranscriptEditor();







    window.opener.**ReloadTranscriptEditor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.






    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**popup") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadTranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscriptEditor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popup".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit**.org/reference-**guide/1.8/**
    dijit/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".****//*[@id='docs_MiniGlass_0']/a[****
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**h**tml/body/div[8]/div[3]/**button[**
    1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**ms*
    *g/selenium-users/-/**DqnzBvlH0uk**J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**45EHykZfzl4J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.

    For more options, visit https://groups.google.com/groups/opt_out.







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 18, 2012 at 5:43 pm
    Please find attached the test script for reference:
    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if possible
    for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:
    Rajesh

    You've said that several times already and it doesn't help. People here
    need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT**ranscriptEditor();

    window.opener.**ReloadTranscript**Editor();

    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the
    code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC**hangeWorkType")).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa**ndle);
    }
    System.*out*.println(driver.**getTitle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis**ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n**ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**LinkedHashIterator.nextEntry(**Unknown
    Source)
    at java.util.LinkedHashMap$**KeyIterator.next(Unknown Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC**hangeWorkType")).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo**pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp***);


    Exception : *java.lang.NullPointerException***: String initializer must
    be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ...
    it' not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT**ranscriptEditor();







    window.opener.**ReloadTranscript**Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.






    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop**up") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT**ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript**Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu**p".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit****.org/reference-**guide/1.8/**dijit**
    /Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".******//*[@id='docs_MiniGlass_0']/a[******
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**h****tml/body/div[8]/div[3]/**button[****
    1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/**ms
    ****g/selenium-users/-/**DqnzBvlH0uk****J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**ms
    **g/selenium-users/-/**45EHykZfzl4**J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**T4yljHNDmp8J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ.

    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 18, 2012 at 4:49 pm
    Does your test script create the windows dialogs?

    Date: Tue, 18 Sep 2012 22:06:57 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if possible for u then show me ur code via team viewer
    Otherwise,I also give up

    -Manoj Hans

    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30, PeterJef...@Hotmail.co.uk wrote:




    Rajesh

    You've said that several times already and it doesn't help. People here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.


    Peter

    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    In this pop up window, changing the combo box value and clicking on 'Update' button, the first window will be reloaded again.

    Clicking on cancel button, will only close the modal pop up window and control will go to the first pop uo window.



    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale wrote:





    Rajesh

    We need to uinderstand how these lines:
    parent.dialogArguments.ReloadTranscriptEditor();

    window.opener.ReloadTranscriptEditor();


    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.


    Nothing in your attachment tells us that that I can see.

    Peter

    Date: Tue, 18 Sep 2012 20:49:12 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.


    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the code to switch the control to the modal pop up window:

    1.


    String winHandleBefore = driver.getWindowHandle();






    driver.findElement(By.id("btnChangeWorkType")).click();






    Thread.sleep(1000);






    for(String winHandle : driver.getWindowHandles()){







    driver.switchTo().window(winHandle);






    }






    System.out.println(driver.getTitle());













    new Select(driver.findElement(By.id("ddlWorkType"))).selectByVisibleText("NOTE");















    Exception: org.openqa.selenium.NoSuchElementException: Unable to find element by id
    using "ddlWorkType"






    System info: os.name:
    'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'


    Driver info: driver.version: ie








    2. Set <String> handles =driver.getWindowHandles();






    Iterator<String> it = handles.iterator();






    //iterate through your windows






    while (it.hasNext()){






    String parent
    = it.next();


    String newwin = it.next();






    driver.switchTo().window(newwin);













    driver.close();














    }





    This code is
    switching control to the main window.


    Exception : java.util.NoSuchElementException






    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)


    at java.util.LinkedHashMap$KeyIterator.next(Unknown
    Source)











    3. Set<String> beforePopUp = driver.getWindowHandles();






    driver.findElement(By.id("btnChangeWorkType")).click();






    Thread.sleep(1000);






    //Get all the window handles in a set






    //get window handles after the click






    Set<String>
    afterPopup = driver.getWindowHandles();









    //remove all window
    handles before the popup


    afterPopup.removeAll(beforePopUp);






    if(afterPopup.size() == 1) {






    popUp = (String) afterPopup.toArray()[0];






    } else {









    }






    //switch to popUp






    driver.switchTo().window(popUp);












    Exception : java.lang.NullPointerException: String initializer must be
    non-null


    at com.sun.jna.WString.<init>(WString.java:23)










    Regards,
    Rajesh

    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:




    show the error msg...most probably exception is unhandlemodaldialog....
    but i want to know about the title, console printed all title or not???





    On Monday, September 17, 2012 11:40:17 PM UTC+5:30, PeterJef...@Hotmail.co.uk wrote:






    So show us the code you have tried and any error messages you got ... it' not very helpful just to say it doesn't work without telling us what yo tried.

    Date: Mon, 17 Sep 2012 23:37:33 +0530




    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:





    Have you tried getWindowHandles()?

    Date: Mon, 17 Sep 2012 23:30:39 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.





    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    I have tried with the same.

    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:














    I can only see one popup window, and it looks like a html page that has been opened in a new window ... you should be able to use the getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then normal WebDriver methods to deal with the html elements of the page.








    Date: Mon, 17 Sep 2012 23:08:34 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.




    From: raj2...@gmail.com



    To: seleniu...@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this would be enough.





    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:





    Looks like you have dealt with the "alert(msg);" popup.
    You could be gettign eother of these two windows/dialogs appearing:
    parent.dialogArguments.ReloadTranscriptEditor();








    window.opener.ReloadTranscriptEditor();

    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.








    Date: Mon, 17 Sep 2012 22:44:56 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.





    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control to first pop up window.





    I tried with the window title in place of 'popup'. But nothing worked. So i just tried with 'popup' and it worked.

    But now clicking on a button i am getting one more window, which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch the control to this second window, change the combo box value, click on update button. And switch back the control to first pop up window.









    <head><title>
    Change WorkType
    </title>
    <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />

    <script type="text/javascript" language="javascript">
    function RefreshParentPage(msg) {

    alert(msg);

    if (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor();
    else if (window.opener)
    window.opener.ReloadTranscriptEditor();

    self.close();
    }

    </script>

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:









    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter


    Date: Mon, 17 Sep 2012 22:26:17 +0530





    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com





    To: seleniu...@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".










    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:












    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com






    To: seleniu...@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.







    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.










    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:












    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com










    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:









    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");









    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();










    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:









    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing










    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.














    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.





    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.


    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.


    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.







    --Forwarded Message Attachment--
























    Note:- Change of Work Type will Reload the Editor Window.


    Work Type:

    Select
    CONSULT NOTE
    GENERAL
    PROGRESS NOTE























    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.









    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ.


    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 18, 2012 at 4:46 pm
    Yes the modal dialog box opens. But the control is not going to this
    window.

    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if possible
    for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People here
    need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT**ranscriptEditor();

    window.opener.**ReloadTranscript**Editor();


    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the
    code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC**hangeWorkType")).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa**ndle);
    }
    System.*out*.println(driver.**getTitle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis**ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n**ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**LinkedHashIterator.nextEntry(**Unknown
    Source)
    at java.util.LinkedHashMap$**KeyIterator.next(Unknown Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC**hangeWorkType")).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo**pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp***);


    Exception : *java.lang.NullPointerException***: String initializer must
    be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ... it'
    not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:

    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT**ranscriptEditor();








    window.opener.**ReloadTranscript**Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.







    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop**up") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT**ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript**Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu**p".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit****.org/reference-**guide/1.8/**dijit**
    /Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".******//*[@id='docs_MiniGlass_0']/a[******
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**h****tml/body/div[8]/div[3]/**button[****
    1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/**ms*
    ***g/selenium-users/-/**DqnzBvlH0uk****J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**ms*
    *g/selenium-users/-/**45EHykZfzl4**J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**T4yljHNDmp8J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ.

    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Peter Gale at Sep 18, 2012 at 5:48 pm
    No ... your script do not CREATE the windows. It interacts with the browsers with calls some other code which creates the windows. That code is probably what soemone needs to see to help you.

    But it won't be me.

    Date: Tue, 18 Sep 2012 22:16:36 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    Yes the modal dialog box opens. But the control is not going to this window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale wrote:





    Does your test script create the windows dialogs?

    Date: Tue, 18 Sep 2012 22:06:57 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:


    I also can't understand wt rajesh trying to say.....At last if possible for u then show me ur code via team viewer
    Otherwise,I also give up

    -Manoj Hans

    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30, PeterJef...@Hotmail.co.uk wrote:





    Rajesh

    You've said that several times already and it doesn't help. People here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.



    Peter

    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    In this pop up window, changing the combo box value and clicking on 'Update' button, the first window will be reloaded again.


    Clicking on cancel button, will only close the modal pop up window and control will go to the first pop uo window.



    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale wrote:





    Rajesh

    We need to uinderstand how these lines:
    parent.dialogArguments.ReloadTranscriptEditor();

    window.opener.ReloadTranscriptEditor();



    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.


    Nothing in your attachment tells us that that I can see.

    Peter

    Date: Tue, 18 Sep 2012 20:49:12 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.



    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the code to switch the control to the modal pop up window:

    1.


    String winHandleBefore = driver.getWindowHandle();







    driver.findElement(By.id("btnChangeWorkType")).click();







    Thread.sleep(1000);







    for(String winHandle : driver.getWindowHandles()){








    driver.switchTo().window(winHandle);







    }







    System.out.println(driver.getTitle());















    new Select(driver.findElement(By.id("ddlWorkType"))).selectByVisibleText("NOTE");
















    Exception: org.openqa.selenium.NoSuchElementException: Unable to find element by id
    using "ddlWorkType"







    System info: os.name:
    'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'


    Driver info: driver.version: ie








    2. Set <String> handles =driver.getWindowHandles();







    Iterator<String> it = handles.iterator();







    //iterate through your windows







    while (it.hasNext()){







    String parent
    = it.next();


    String newwin = it.next();







    driver.switchTo().window(newwin);















    driver.close();
















    }





    This code is
    switching control to the main window.


    Exception : java.util.NoSuchElementException







    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)


    at java.util.LinkedHashMap$KeyIterator.next(Unknown
    Source)











    3. Set<String> beforePopUp = driver.getWindowHandles();







    driver.findElement(By.id("btnChangeWorkType")).click();







    Thread.sleep(1000);







    //Get all the window handles in a set







    //get window handles after the click







    Set<String>
    afterPopup = driver.getWindowHandles();










    //remove all window
    handles before the popup


    afterPopup.removeAll(beforePopUp);







    if(afterPopup.size() == 1) {







    popUp = (String) afterPopup.toArray()[0];







    } else {










    }







    //switch to popUp







    driver.switchTo().window(popUp);













    Exception : java.lang.NullPointerException: String initializer must be
    non-null


    at com.sun.jna.WString.<init>(WString.java:23)











    Regards,
    Rajesh

    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:





    show the error msg...most probably exception is unhandlemodaldialog....
    but i want to know about the title, console printed all title or not???






    On Monday, September 17, 2012 11:40:17 PM UTC+5:30, PeterJef...@Hotmail.co.uk wrote:






    So show us the code you have tried and any error messages you got ... it' not very helpful just to say it doesn't work without telling us what yo tried.

    Date: Mon, 17 Sep 2012 23:37:33 +0530





    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:





    Have you tried getWindowHandles()?

    Date: Mon, 17 Sep 2012 23:30:39 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.






    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    I have tried with the same.

    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:















    I can only see one popup window, and it looks like a html page that has been opened in a new window ... you should be able to use the getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then normal WebDriver methods to deal with the html elements of the page.









    Date: Mon, 17 Sep 2012 23:08:34 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.





    From: raj2...@gmail.com



    To: seleniu...@googlegroups.com

    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this would be enough.





    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:





    Looks like you have dealt with the "alert(msg);" popup.
    You could be gettign eother of these two windows/dialogs appearing:
    parent.dialogArguments.ReloadTranscriptEditor();









    window.opener.ReloadTranscriptEditor();

    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.









    Date: Mon, 17 Sep 2012 22:44:56 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.






    From: raj2...@gmail.com
    To: seleniu...@googlegroups.com

    I have tried with :driver.switchTo().window("popup") to switch the control to first pop up window.





    I tried with the window title in place of 'popup'. But nothing worked. So i just tried with 'popup' and it worked.

    But now clicking on a button i am getting one more window, which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch the control to this second window, change the combo box value, click on update button. And switch back the control to first pop up window.










    <head><title>
    Change WorkType
    </title>
    <base target="_self" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />

    <script type="text/javascript" language="javascript">
    function RefreshParentPage(msg) {

    alert(msg);

    if (parent.dialogArguments)
    parent.dialogArguments.ReloadTranscriptEditor();
    else if (window.opener)
    window.opener.ReloadTranscriptEditor();

    self.close();
    }

    </script>

    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:










    Rajesh

    Please supply more concrete details of your problem ... screenshots, source html code of the application you are testing, and the test scripts you have tried.

    Peter


    Date: Mon, 17 Sep 2012 22:26:17 +0530





    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com





    To: seleniu...@googlegroups.com

    Hi All,

    I am using selenium webdriver to automate a web application. In the application thee are some 'Modal pop up' windows and some are 'Ajax pop up' windows inside a pop up window. I switched the control to first pop up window using : driver.switchto().window("popup".











    But i am not able to switch the control to 2nd pop up window which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:













    It might be similar, but it's obviously not the SAME issue. Start a new thread.

    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com






    To: seleniu...@googlegroups.com
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.







    Hi Peter,
    Hope you are doing good. About hijacking, its not like that. I think the topic is similar to what I have problem. If you have the solution , please let me know. Its just we are spreading knowledge.











    RegardsNitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.uk wrote:












    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com











    To: seleniu...@googlegroups.com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup' and 'Ajax window popup' windows.

    Hi,
    Please provide the solution of the below code:










    WebDriver driver = new FirefoxDriver(); driver.get("http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html");










    Thread.sleep(3000l); driver.findElement(By.xpath(".//*[@id='docs_MiniGlass_0']/a[1]/span")).click();











    I want to have control in the popup.
    Early response will be highly appreciable.
    Thank YouNitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:










    Example Test Case: Log into your gmail account and select one/more of the emails and click on the report spam icon. It will make an alert modal pop up. Now use firebug/firepath to find locators of the elements on the modal. Lets say you want to click on 'Report Spam' button. You can do that just by writing











    driver.findElement(By.xpath("html/body/div[8]/div[3]/button[1]")).click()
    The point which I am trying to make is AJAX modal is just a web element. So you can perform all those actions which you can perform on a normal web element.















    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ.






    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J.



    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.











    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J.


    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.







    --Forwarded Message Attachment--
























    Note:- Change of Work Type will Reload the Editor Window.


    Work Type:

    Select
    CONSULT NOTE
    GENERAL
    PROGRESS NOTE























    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to seleniu...@googlegroups.com.

    To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.










    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ.


    For more options, visit https://groups.google.com/groups/opt_out.













    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.









    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.












    --

    You received this message because you are subscribed to the Google Groups "Selenium Users" group.

    To post to this group, send email to selenium-users@googlegroups.com.

    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.






    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 18, 2012 at 6:35 pm
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("btnChangeWorkType")).click();
    I have attached the test script i am using.
    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale wrote:

    No ... your script do not CREATE the windows. It interacts with the
    browsers with calls some other code which creates the windows. That code is
    probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com

    Yes the modal dialog box opens. But the control is not going to this
    window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <
    peterjeffreygale@hotmail.co.uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj224in@gmail.com
    To: selenium-users@googlegroups.com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if possible
    for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People here
    need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT**ranscriptEditor();

    window.opener.**ReloadTranscript**Editor();



    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the
    code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC**hangeWorkType")).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa**ndle);
    }
    System.*out*.println(driver.**getTitle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis**ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n**ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**LinkedHashIterator.nextEntry(**Unknown
    Source)
    at java.util.LinkedHashMap$**KeyIterator.next(Unknown Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC**hangeWorkType")).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo**pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp***);


    Exception : *java.lang.NullPointerException***: String initializer must
    be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ... it'
    not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale wrote:

    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT**ranscriptEditor();









    window.opener.**ReloadTranscript**Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.








    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop**up") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to switch
    the control to this second window, change the combo box value, click on
    update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT**ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript**Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu**p".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit****.org/reference-**guide/1.8/**dijit**
    /Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".******//*[@id='docs_MiniGlass_0']/a[******
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**h****tml/body/div[8]/div[3]/**button[****
    1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/**ms*
    ***g/selenium-users/-/**DqnzBvlH0uk****J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**ms*
    *g/selenium-users/-/**45EHykZfzl4**J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**T4yljHNDmp8J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ.

    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj224in@gmail.com

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 18, 2012 at 6:41 pm
    how can u ensure that u r switching on right window using this code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHandle);

    }
    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan wrote:

    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("btnChangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    No ... your script do not CREATE the windows. It interacts with the
    browsers with calls some other code which creates the windows. That code is
    probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>

    Yes the modal dialog box opens. But the control is not going to this
    window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <peterjef...@hotmail.co.uk<javascript:>
    wrote:
    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com <javascript:>
    To: seleniu...@googlegroups.com <javascript:>


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans <hman...@gmail.com<javascript:>
    wrote:
    I also can't understand wt rajesh trying to say.....At last if possible
    for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People here
    need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT**ranscriptEditor();

    window.opener.**ReloadTranscript**Editor();




    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the
    code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC**hangeWorkType")).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa**ndle);
    }
    System.*out*.println(driver.**getTitle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis**ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n**ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**LinkedHashIterator.nextEntry(**Unknown
    Source)
    at java.util.LinkedHashMap$**KeyIterator.next(Unknown Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC**hangeWorkType")).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo**pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp***);


    Exception : *java.lang.NullPointerException***: String initializer must
    be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ...
    it' not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    I can only see one popup window, and it looks like a html page that has
    been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT**ranscriptEditor();










    window.opener.**ReloadTranscript**Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.









    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop**up") to switch the
    control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked. So
    i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT**ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript**Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu**p".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30, PeterJef...@Hotmail.co.ukwrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit****.org/reference-**guide/1.8/**dijit**
    /Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".******//*[@id='docs_MiniGlass_0']/a[******
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of the
    emails and click on the report spam icon. It will make an alert modal pop
    up. Now use firebug/firepath to find locators of the elements on the modal.
    Lets say you want to click on 'Report Spam' button. You can do that just by
    writing

    driver.findElement(By.xpath("**h****tml/body/div[8]/div[3]/**button[****
    1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/**ms
    ****g/selenium-users/-/**DqnzBvlH0uk****J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**ms
    **g/selenium-users/-/**45EHykZfzl4**J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**T4yljHNDmp8J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ.

    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.








    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com <javascript:>
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 18, 2012 at 5:14 pm
    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but it didn't
    worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnChangeWorkType")).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHandle);

    }

    System.*out*.println(driver.getTitle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVisibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(newwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)

    at java.util.LinkedHashMap$KeyIterator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnChangeWorkType")).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePopUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*);





    Exception : *java.lang.NullPointerException*: String initializer must be
    non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHandle);

    }
    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan wrote:

    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnChangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    No ... your script do not CREATE the windows. It interacts with the
    browsers with calls some other code which creates the windows. That code is
    probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to this
    window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if possible
    for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People here
    need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <peterjef...@hotmail.co.**uk
    wrote:
    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT****ranscriptEditor();

    window.opener.**ReloadTranscript****Editor();




    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with the
    code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC****hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa****ndle);
    }
    System.*out*.println(driver.**getT**itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis****ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n****ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked**HashIterator.nextEntry(**Unknown
    Source)
    at java.util.LinkedHashMap$**KeyIte**rator.next(Unknown Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC****hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo****pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*****);


    Exception : *java.lang.NullPointerException*****: String initializermust be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ...
    it' not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    I can only see one popup window, and it looks like a html page that
    has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT****ranscriptEditor();










    window.opener.**ReloadTranscript****Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.









    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop****up") to switch
    the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked.
    So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT****ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript****Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu****p".
    But i am not able to switch the control to 2nd pop up window which opens
    after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a new
    thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think the
    topic is similar to what I have problem. If you have the solution , please
    let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit******.org/reference-**guide/1.8/**dijit
    ****/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".********//*[@id='docs_MiniGlass_0']/a[****
    ****1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of
    the emails and click on the report spam icon. It will make an alert modal
    pop up. Now use firebug/firepath to find locators of the elements on the
    modal. Lets say you want to click on 'Report Spam' button. You can do that
    just by writing

    driver.findElement(By.xpath("**h******tml/body/div[8]/div[3]/**button[**
    ****1]")).click()

    The point which I am trying to make is AJAX modal is just a web element.
    So you can perform all those actions which you can perform on a normal web
    element.


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit https://groups.google.com/d/**
    ms******g/selenium-users/-/**DqnzBvlH0uk******J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou******ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/**
    ms****g/selenium-users/-/**45EHykZfzl4****J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**
    ms**g/selenium-users/-/**T4yljHNDmp8**J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**rBsgqaB9mEQJ<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ.

    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 18, 2012 at 7:04 pm
    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;
    }

    System.out.println(availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(winHandleBefore)){
    popup=win;
    driver.switchTo().window(popup);
    }
    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan wrote:

    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but it
    didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnChangeWorkType")).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHandle);

    }

    System.*out*.println(driver.getTitle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVisibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(newwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown
    Source)

    at java.util.LinkedHashMap$KeyIterator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnChangeWorkType")).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePopUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*);





    Exception : *java.lang.NullPointerException*: String initializer must be
    non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *

    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans <hman...@gmail.com<javascript:>
    wrote:
    how can u ensure that u r switching on right window using this code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHandle);

    }
    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan wrote:

    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnChangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:
    No ... your script do not CREATE the windows. It interacts with the
    browsers with calls some other code which creates the windows. That code is
    probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to this
    window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if possible
    for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People here
    need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT****ranscriptEditor();

    window.opener.**ReloadTranscript****Editor();




    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with
    the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC****hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa****ndle);
    }
    System.*out*.println(driver.**getT**itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis****ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n****ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked**HashIterator.nextEntry(**Unknown
    Source)
    at java.util.LinkedHashMap$**KeyIte**rator.next(Unknown Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC****hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo****pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*****);


    Exception : *java.lang.NullPointerException*****: String initializermust be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ...
    it' not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    I can only see one popup window, and it looks like a html page that
    has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT****ranscriptEditor();











    window.opener.**ReloadTranscript****Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.










    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop****up") to switch
    the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked.
    So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT****ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript****Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu****p".
    But i am not able to switch the control to 2nd pop up window which
    opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a
    new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think
    the topic is similar to what I have problem. If you have the solution ,
    please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal popup'
    and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit******.org/reference-**guide/1.8/**
    dijit****/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".********//*[@id='docs_MiniGlass_0']/a[***
    *****1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of
    the emails and click on the report spam icon. It will make an alert modal
    pop up. Now use firebug/firepath to find locators of the elements on the
    modal. Lets say you want to click on 'Report Spam' button. You can do that
    just by writing

    driver.findElement(By.xpath("**h******tml/body/div[8]/div[3]/**button[*
    *****1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit https://groups.google.com/d/**
    ms******g/selenium-users/-/**DqnzBvlH0uk******J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/**
    ms****g/selenium-users/-/**45EHykZfzl4****J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**
    ms**g/selenium-users/-/**T4yljHNDmp8**J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**rBsgqaB9mEQJ<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ.

    For more options, visit https://groups.google.com/groups/opt_out.


    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 18, 2012 at 6:28 pm
    what about 'winHandleBefore'. this variable has not been initialized in
    this below code.


    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans wrote:

    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;
    }

    System.out.println(availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(winHandleBefore)){
    popup=win;
    driver.switchTo().window(popup);
    }
    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan wrote:

    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but it
    didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC**hangeWorkType")).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa**ndle);

    }

    System.*out*.println(driver.**getTitle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis**ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n**ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**LinkedHashIterator.nextEntry(**Unknown
    Source)

    at java.util.LinkedHashMap$**KeyIterator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC**hangeWorkType")).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo**pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp***);





    Exception : *java.lang.NullPointerException***: String initializer must
    be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHandle);

    }
    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan wrote:

    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC**hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:
    No ... your script do not CREATE the windows. It interacts with the
    browsers with calls some other code which creates the windows. That code is
    probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to this
    window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <peterjef...@hotmail.co.*
    *uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People
    here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window and
    control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <peterjef...@hotmail.co.**
    uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT******ranscriptEditor();

    window.opener.**ReloadTranscript******Editor();




    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with
    the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa******ndle);
    }
    System.*out*.println(driver.**getT****itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis******ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n******ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked****HashIterator.nextEntry(**Unknown
    Source)
    at java.util.LinkedHashMap$**KeyIte****rator.next(Unknown
    Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo******pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*******);


    Exception : *java.lang.NullPointerException*******: String initializermust be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is unhandlemodaldialog....

    but i want to know about the title, console printed all title or
    not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got ...
    it' not very helpful just to say it doesn't work without telling us what yo
    tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <peterjef...@hotmail.co.*
    *uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.*
    *uk> wrote:

    I can only see one popup window, and it looks like a html page that
    has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope this
    would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.*
    *uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT******ranscriptEditor();











    window.opener.**ReloadTranscript******Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.










    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop******up") to
    switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing worked.
    So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has a
    combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT******ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript******Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.*
    *uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu******p".
    But i am not able to switch the control to 2nd pop up window which
    opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.*
    *uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a
    new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think
    the topic is similar to what I have problem. If you have the solution ,
    please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit********.org/reference-**guide/1.8/**
    dijit******/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**********//*[@id='docs_MiniGlass_0']/a[
    **********1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of
    the emails and click on the report spam icon. It will make an alert modal
    pop up. Now use firebug/firepath to find locators of the elements on the
    modal. Lets say you want to click on 'Report Spam' button. You can do that
    just by writing

    driver.findElement(By.xpath("**h********tml/body/div[8]/div[3]/**
    button[********1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    To view this discussion on the web visit https://groups.google.com/d/*
    *ms********g/selenium-users/-/**DqnzBvlH0uk********J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit https://groups.google.com/d/*
    *ms******g/selenium-users/-/**45EHykZfzl4******J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/*
    *ms****g/selenium-users/-/**T4yljHNDmp8****J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/*
    *ms**g/selenium-users/-/**rBsgqaB9mEQ**J<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/Zgg6-**iDdC_IJ<https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ.

    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj224in@gmail.com

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 18, 2012 at 5:54 pm
    see ur code u will get to know....
    On Tuesday, September 18, 2012 10:52:16 PM UTC+5:30, Rajesh Ranjan wrote:

    what about 'winHandleBefore'. this variable has not been initialized in
    this below code.



    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans <hman...@gmail.com<javascript:>
    wrote:
    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;
    }

    System.out.println(availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(winHandleBefore)){
    popup=win;
    driver.switchTo().window(popup);
    }
    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan wrote:

    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but it
    didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC**hangeWorkType")).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa**ndle);

    }

    System.*out*.println(driver.**getTitle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis**ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to find
    element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n**ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**LinkedHashIterator.nextEntry(**Unknown
    Source)

    at java.util.LinkedHashMap$**KeyIterator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC**hangeWorkType")).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo**pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp***);





    Exception : *java.lang.NullPointerException***: String initializer must
    be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHandle);

    }

    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan
    wrote:
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC**hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <peterjef...@hotmail.co.*
    *uk> wrote:
    No ... your script do not CREATE the windows. It interacts with the
    browsers with calls some other code which creates the windows. That code is
    probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to this
    window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <peterjef...@hotmail.co.
    **uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People
    here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window
    and control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <peterjef...@hotmail.co.*
    *uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT******ranscriptEditor();

    window.opener.**ReloadTranscript******Editor();





    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up window.
    below is the code and exception which i am getting while trying with
    the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa******ndle);
    }
    System.*out*.println(driver.**getT****itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis******ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n******ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked****HashIterator.nextEntry(*
    *Unknown Source)
    at java.util.LinkedHashMap$**KeyIte****rator.next(Unknown
    Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo******pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*******);


    Exception : *java.lang.NullPointerException*******: String
    initializer must be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is
    unhandlemodaldialog....

    but i want to know about the title, console printed all title or
    not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got
    ... it' not very helpful just to say it doesn't work without telling us
    what yo tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <peterjef...@hotmail.co.
    **uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <peterjef...@hotmail.co.
    **uk> wrote:

    I can only see one popup window, and it looks like a html page that
    has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope
    this would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <peterjef...@hotmail.co.
    **uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT******ranscriptEditor();












    window.opener.**ReloadTranscript******Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.











    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop******up") to
    switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing
    worked. So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has
    a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT******ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript******Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <peterjef...@hotmail.co.
    **uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu******p".
    But i am not able to switch the control to 2nd pop up window which
    opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <peterjef...@hotmail.co.
    **uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a
    new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think
    the topic is similar to what I have problem. If you have the solution ,
    please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit********.org/reference-**guide/1.8/**
    dijit******/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**********
    //*[@id='docs_MiniGlass_0']/a[**********1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more of
    the emails and click on the report spam icon. It will make an alert modal
    pop up. Now use firebug/firepath to find locators of the elements on the
    modal. Lets say you want to click on 'Report Spam' button. You can do that
    just by writing

    driver.findElement(By.xpath("**h********tml/body/div[8]/div[3]/**
    button[********1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    To view this discussion on the web visit https://groups.google.com/d/
    **ms********g/selenium-users/-/**DqnzBvlH0uk********J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit https://groups.google.com/d/
    **ms******g/selenium-users/-/**45EHykZfzl4******J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/
    **ms****g/selenium-users/-/**T4yljHNDmp8****J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/
    **ms**g/selenium-users/-/**rBsgqaB9mEQ**J<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/Zgg6-**iDdC_IJ<https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ.

    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com <javascript:>
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/Xpd_dcWnG1QJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Neeraj Sharma at Sep 19, 2012 at 5:16 am
    Hi Rajesh, I have tried to handle multiple windows for Kotak.com site and
    here is my code which is running successfully on my machine. Please have a
    look into this and might you get any clue from there.

    public class kotak {

    public static void main(String[] args) throws InterruptedException {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://kotak.com");
    Thread.sleep(1000);
    // save the current window handle.
    String parentWindowHandle = driver.getWindowHandle();
    //clicking on the secure login button on the home page
    driver.findElement(By.xpath("//html/body/div/div[2]/div/div/a/img")).click();
    Thread.sleep(100);

    WebDriver popup = null;
    //saving all windows id in set
    Set<String> handles = driver.getWindowHandles();

    Iterator<String> windowIterator = handles.iterator();
    while(windowIterator.hasNext()) {
    //moving forward to the next window id
    String windowHandle = windowIterator.next();

    popup = driver.switchTo().window(windowHandle);
    Thread.sleep(1000);
    }
    if
    (popup.getTitle().equals("KMBL Net Banking Login")){
    System.out.println(popup.getTitle());
    }
    else {
    System.out.println("Driver is not shifted to new window");
    }
    driver.switchTo().frame(0);
    // asserting the heading on the login page and printing the same
    String heading = driver.findElement(By.id("heading")).getText();
    System.out.println(heading);
    //Entering the userId in login page

    driver.findElement(By.xpath("//html/body/form/div/div/div[3]/table/tbody/tr/td/div/table/tbody/tr[2]/td[3]/input")).sendKeys("12345");

    // Shifting driver to parent window
    driver.switchTo().window(parentWindowHandle);
    Thread.sleep(100);
    //entering the keyword in the search text box.
    driver.findElement(By.id("searchInputBox")).sendKeys("Neeraj");


    }
    }
    On Tuesday, 18 September 2012 22:59:22 UTC+5:30, Manoj Hans wrote:

    see ur code u will get to know....
    On Tuesday, September 18, 2012 10:52:16 PM UTC+5:30, Rajesh Ranjan wrote:

    what about 'winHandleBefore'. this variable has not been initialized in
    this below code.


    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans wrote:

    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;
    }

    System.out.println(availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(winHandleBefore)){
    popup=win;
    driver.switchTo().window(popup);
    }
    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan wrote:

    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but it
    didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC**hangeWorkType")).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa**ndle);

    }

    System.*out*.println(driver.**getTitle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis**ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
    java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n**ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**LinkedHashIterator.nextEntry(**Unknown
    Source)

    at java.util.LinkedHashMap$**KeyIterator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC**hangeWorkType")).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo**pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp***);





    Exception : *java.lang.NullPointerException***: String initializermust be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHandle);

    }

    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan
    wrote:
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC**hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <peterjef...@hotmail.co.
    **uk> wrote:
    No ... your script do not CREATE the windows. It interacts with the
    browsers with calls some other code which creates the windows. That code is
    probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to this
    window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People
    here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window
    and control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <peterjef...@hotmail.co.
    **uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT******ranscriptEditor();

    window.opener.**ReloadTranscript******Editor();





    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up
    window.
    below is the code and exception which i am getting while trying with
    the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa******ndle);
    }
    System.*out*.println(driver.**getT****itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"
    ))).selectByVis******ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n******ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked****HashIterator.nextEntry(
    **Unknown Source)
    at java.util.LinkedHashMap$**KeyIte****rator.next(Unknown
    Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo******pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*******);


    Exception : *java.lang.NullPointerException*******: String
    initializer must be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is
    unhandlemodaldialog....

    but i want to know about the title, console printed all title or
    not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got
    ... it' not very helpful just to say it doesn't work without telling us
    what yo tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    I can only see one popup window, and it looks like a html page
    that has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope
    this would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT******ranscriptEditor();












    window.opener.**ReloadTranscript******Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.











    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop******up") to
    switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing
    worked. So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which has
    a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT******ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript******Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ... screenshots,
    source html code of the application you are testing, and the test scripts
    you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu******p".
    But i am not able to switch the control to 2nd pop up window which
    opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start a
    new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I think
    the topic is similar to what I have problem. If you have the solution ,
    please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit********.org/reference-**guide/1.8/*
    *dijit******/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**********
    //*[@id='docs_MiniGlass_0']/a[**********1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more
    of the emails and click on the report spam icon. It will make an alert
    modal pop up. Now use firebug/firepath to find locators of the elements on
    the modal. Lets say you want to click on 'Report Spam' button. You can do
    that just by writing

    driver.findElement(By.xpath("**h********tml/body/div[8]/div[3]/**
    button[********1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms********g/selenium-users/-/**
    DqnzBvlH0uk********J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms******g/selenium-users/-/**
    45EHykZfzl4******J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms****g/selenium-users/-/**T4yljHNDmp8
    ****J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**g/selenium-users/-/**rBsgqaB9mEQ**
    J <https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>.

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/*
    *msg/selenium-users/-/Zgg6-**iDdC_IJ<https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ.

    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/QWZGpstPgRsJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 19, 2012 at 3:17 pm
    Hi All,

    I tried with below code. Its is switching the control to the 1st pop up
    window and not to the 2nd pop up which is modal pop up window.
    I guess nothing wrong with the code. When i am running my test class, the
    modal pop up window gets opened but the control still goes to 1st pop up
    window. But while running the same test in debug mode, the modal pop up
    window doesn't open. I am not getting any exception. Can anyone help me in
    this.

    java.util.Set<String> winHandleBefore = driver.getWindowHandles();
    //getWindowHandle();
    driver.findElement(By.id("btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows = driver.getWindowHandles();
    while(true){
    availableWindows = driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;

    System.out.println(availableWindows.size());
    String npopup = null;
    for(String win:availableWindows){

    if(!win.equals(winHandleBefore)){
    npopup=win;
    }
    }
    System.out.println(driver.getTitle());
    driver.switchTo().window(npopup);



    Regards,
    Rajesh

    On Wed, Sep 19, 2012 at 10:46 AM, Neeraj Sharma wrote:

    Hi Rajesh, I have tried to handle multiple windows for Kotak.com site and
    here is my code which is running successfully on my machine. Please have a
    look into this and might you get any clue from there.

    public class kotak {

    public static void main(String[] args) throws InterruptedException {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://kotak.com");
    Thread.sleep(1000);
    // save the current window handle.
    String parentWindowHandle = driver.getWindowHandle();
    //clicking on the secure login button on the home page

    driver.findElement(By.xpath("//html/body/div/div[2]/div/div/a/img")).click();
    Thread.sleep(100);

    WebDriver popup = null;
    //saving all windows id in set
    Set<String> handles = driver.getWindowHandles();

    Iterator<String> windowIterator = handles.iterator();
    while(windowIterator.hasNext()) {
    //moving forward to the next window id
    String windowHandle = windowIterator.next();

    popup = driver.switchTo().window(windowHandle);
    Thread.sleep(1000);
    }
    if
    (popup.getTitle().equals("KMBL Net Banking Login")){
    System.out.println(popup.getTitle());
    }
    else {
    System.out.println("Driver is not shifted to new window");
    }
    driver.switchTo().frame(0);
    // asserting the heading on the login page and printing the same
    String heading = driver.findElement(By.id("heading")).getText();
    System.out.println(heading);
    //Entering the userId in login page

    driver.findElement(By.xpath("//html/body/form/div/div/div[3]/table/tbody/tr/td/div/table/tbody/tr[2]/td[3]/input")).sendKeys("12345");

    // Shifting driver to parent window
    driver.switchTo().window(parentWindowHandle);
    Thread.sleep(100);
    //entering the keyword in the search text box.
    driver.findElement(By.id("searchInputBox")).sendKeys("Neeraj");


    }
    }
    On Tuesday, 18 September 2012 22:59:22 UTC+5:30, Manoj Hans wrote:

    see ur code u will get to know....
    On Tuesday, September 18, 2012 10:52:16 PM UTC+5:30, Rajesh Ranjan wrote:

    what about 'winHandleBefore'. this variable has not been initialized in
    this below code.


    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans wrote:

    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWindowHandles();
    if(availableWindows.size()==**2)
    break;
    }

    System.out.println(**availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefore)){
    popup=win;
    driver.switchTo().window(**popup);
    }

    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan
    wrote:
    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but it
    didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC****hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa****ndle);

    }

    System.*out*.println(driver.**getT**itle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis****ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n****ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**Linked**HashIterator.nextEntry(**Unknown
    Source)

    at java.util.LinkedHashMap$**KeyIte**rator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC****hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo****pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*****);





    Exception : *java.lang.NullPointerException*****: String initializermust be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHa**ndle);

    }

    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan
    wrote:
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC****hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:
    No ... your script do not CREATE the windows. It interacts with
    the browsers with calls some other code which creates the windows. That
    code is probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to
    this window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People
    here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking on
    'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window
    and control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT********ranscriptEditor();

    window.opener.**ReloadTranscript********Editor();





    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up
    window.
    below is the code and exception which i am getting while trying
    with the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC********hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa********ndle);
    }
    System.*out*.println(driver.**getT******itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"
    ))).selectByVis********ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n********ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked******
    HashIterator.nextEntry(**Unknown Source)
    at java.util.LinkedHashMap$**KeyIte******rator.next(Unknown
    Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC********hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo********pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*********);


    Exception : *java.lang.NullPointerException*********: String
    initializer must be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is
    unhandlemodaldialog....

    but i want to know about the title, console printed all title or
    not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got
    ... it' not very helpful just to say it doesn't work without telling us
    what yo tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    I can only see one popup window, and it looks like a html page
    that has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope
    this would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT********ranscriptEditor();












    window.opener.**ReloadTranscript********Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.











    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop********up") to
    switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing
    worked. So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which
    has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want to
    switch the control to this second window, change the combo box value, click
    on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT********ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript********Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ...
    screenshots, source html code of the application you are testing, and the
    test scripts you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In the
    application thee are some 'Modal pop up' windows and some are 'Ajax pop up'
    windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu********p".
    But i am not able to switch the control to 2nd pop up window which
    opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start
    a new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I
    think the topic is similar to what I have problem. If you have the solution
    , please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit**********.org/reference-**
    guide/1.8/**dijit********/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".************
    //*[@id='docs_MiniGlass_0']/a[************1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more
    of the emails and click on the report spam icon. It will make an alert
    modal pop up. Now use firebug/firepath to find locators of the elements on
    the modal. Lets say you want to click on 'Report Spam' button. You can do
    that just by writing

    driver.findElement(By.xpath("**h**********tml/body/div[8]/div[3]/**
    button[**********1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**********g/selenium-users/-/**
    DqnzBvlH0uk**********J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou**********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms********g/selenium-users/-/**
    45EHykZfzl4********J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms******g/selenium-users/-/**
    T4yljHNDmp8******J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms****g/selenium-users/-/**
    rBsgqaB9mEQ****J<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/
    **ms**g/selenium-users/-/Zgg6-**iDdC_**IJ<https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ>
    .

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**MujKF9ba7UgJ<https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com
    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/QWZGpstPgRsJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Manoj Hans at Sep 19, 2012 at 4:41 pm
    Use this...dont change anything otherwise i wont rectify again...

    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;
    }

    System.out.println(availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(winHandleBefore)){
    popup=win;
    driver.switchTo().window(popup);
    }
    }
    System.out.println(driver.getTitle());

    On Wednesday, September 19, 2012 8:40:55 PM UTC+5:30, Rajesh Ranjan wrote:

    Hi All,

    I tried with below code. Its is switching the control to the 1st pop up
    window and not to the 2nd pop up which is modal pop up window.
    I guess nothing wrong with the code. When i am running my test class, the
    modal pop up window gets opened but the control still goes to 1st pop up
    window. But while running the same test in debug mode, the modal pop up
    window doesn't open. I am not getting any exception. Can anyone help me in
    this.

    java.util.Set<String> winHandleBefore = driver.getWindowHandles();
    //getWindowHandle();
    driver.findElement(By.id("btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows =
    driver.getWindowHandles();
    while(true){
    availableWindows = driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;

    System.out.println(availableWindows.size());
    String npopup = null;
    for(String win:availableWindows){

    if(!win.equals(winHandleBefore)){
    npopup=win;
    }
    }
    System.out.println(driver.getTitle());
    driver.switchTo().window(npopup);



    Regards,
    Rajesh


    On Wed, Sep 19, 2012 at 10:46 AM, Neeraj Sharma <mintu...@gmail.com<javascript:>
    wrote:
    Hi Rajesh, I have tried to handle multiple windows for Kotak.com site and
    here is my code which is running successfully on my machine. Please have a
    look into this and might you get any clue from there.

    public class kotak {

    public static void main(String[] args) throws InterruptedException {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://kotak.com");
    Thread.sleep(1000);
    // save the current window handle.
    String parentWindowHandle = driver.getWindowHandle();
    //clicking on the secure login button on the home page

    driver.findElement(By.xpath("//html/body/div/div[2]/div/div/a/img")).click();
    Thread.sleep(100);

    WebDriver popup = null;
    //saving all windows id in set
    Set<String> handles = driver.getWindowHandles();

    Iterator<String> windowIterator = handles.iterator();
    while(windowIterator.hasNext()) {
    //moving forward to the next window id
    String windowHandle = windowIterator.next();

    popup = driver.switchTo().window(windowHandle);
    Thread.sleep(1000);
    }
    if
    (popup.getTitle().equals("KMBL Net Banking Login")){
    System.out.println(popup.getTitle());
    }
    else {
    System.out.println("Driver is not shifted to new window");
    }
    driver.switchTo().frame(0);
    // asserting the heading on the login page and printing the same
    String heading = driver.findElement(By.id("heading")).getText();
    System.out.println(heading);
    //Entering the userId in login page

    driver.findElement(By.xpath("//html/body/form/div/div/div[3]/table/tbody/tr/td/div/table/tbody/tr[2]/td[3]/input")).sendKeys("12345");

    // Shifting driver to parent window
    driver.switchTo().window(parentWindowHandle);
    Thread.sleep(100);
    //entering the keyword in the search text box.
    driver.findElement(By.id("searchInputBox")).sendKeys("Neeraj");


    }
    }
    On Tuesday, 18 September 2012 22:59:22 UTC+5:30, Manoj Hans wrote:

    see ur code u will get to know....
    On Tuesday, September 18, 2012 10:52:16 PM UTC+5:30, Rajesh Ranjan wrote:

    what about 'winHandleBefore'. this variable has not been initialized in
    this below code.


    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans wrote:

    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWindowHandles();
    if(availableWindows.size()==**2)
    break;
    }

    System.out.println(**availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefore)){
    popup=win;
    driver.switchTo().window(**popup);
    }

    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan
    wrote:
    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but it
    didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC****hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa****ndle);

    }

    System.*out*.println(driver.**getT**itle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"))).
    selectByVis****ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n****ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**Linked**HashIterator.nextEntry(**Unknown
    Source)

    at java.util.LinkedHashMap$**KeyIte**rator.next(Unknown Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC****hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo****pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*****);





    Exception : *java.lang.NullPointerException*****: String initializermust be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this
    code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHa**ndle);

    }

    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan
    wrote:
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC****hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:
    No ... your script do not CREATE the windows. It interacts with
    the browsers with calls some other code which creates the windows. That
    code is probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to
    this window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help. People
    here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking
    on 'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up window
    and control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT********ranscriptEditor();

    window.opener.**ReloadTranscript********Editor();






    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up
    window.
    below is the code and exception which i am getting while trying
    with the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC********hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa********ndle);
    }
    System.*out*.println(driver.**getT******itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"
    ))).selectByVis********ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable
    to find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n********ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked******
    HashIterator.nextEntry(**Unknown Source)
    at java.util.LinkedHashMap$**KeyIte******rator.next(Unknown
    Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC********hangeWorkType"
    )).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo********pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*********);


    Exception : *java.lang.NullPointerException*********: String
    initializer must be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is
    unhandlemodaldialog....

    but i want to know about the title, console printed all title or
    not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you got
    ... it' not very helpful just to say it doesn't work without telling us
    what yo tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    I can only see one popup window, and it looks like a html page
    that has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope
    this would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs appearing:

    parent.dialogArguments.**ReloadT********ranscriptEditor();













    window.opener.**ReloadTranscript********Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.












    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop********up") to
    switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing
    worked. So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which
    has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want
    to switch the control to this second window, change the combo box value,
    click on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT********ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript********Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ...
    screenshots, source html code of the application you are testing, and the
    test scripts you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In
    the application thee are some 'Modal pop up' windows and some are 'Ajax pop
    up' windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu********p".
    But i am not able to switch the control to 2nd pop up window which
    opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    It might be similar, but it's obviously not the SAME issue. Start
    a new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I
    think the topic is similar to what I have problem. If you have the solution
    , please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit**********.org/reference-**
    guide/1.8/**dijit********/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".************
    //*[@id='docs_MiniGlass_0']/a[************1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select one/more
    of the emails and click on the report spam icon. It will make an alert
    modal pop up. Now use firebug/firepath to find locators of the elements on
    the modal. Lets say you want to click on 'Report Spam' button. You can do
    that just by writing

    driver.findElement(By.xpath("**h**********tml/body/div[8]/div[3]/*
    *button[**********1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**********g/selenium-users/-/**
    DqnzBvlH0uk**********J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou**********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms********g/selenium-users/-/**
    45EHykZfzl4********J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms******g/selenium-users/-/**
    T4yljHNDmp8******J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms****g/selenium-users/-/**
    rBsgqaB9mEQ****J<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**g/selenium-users/-/Zgg6-**iDdC_**
    IJ <https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ>.

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/*
    *msg/selenium-users/-/**MujKF9ba7UgJ<https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ>
    .

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com
    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/QWZGpstPgRsJ.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/6uSlP0bLeXoJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 20, 2012 at 1:07 pm
    I have used the below code but its not working. Still control is going to
    the home page.

    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;
    }

    System.out.println(availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(winHandleBefore)){
    popup=win;
    driver.switchTo().window(popup);
    }
    }
    System.out.println(driver.getTitle());


    On Wed, Sep 19, 2012 at 10:05 PM, Manoj Hans wrote:

    Use this...dont change anything otherwise i wont rectify again...

    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("**btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWindowHandles();
    if(availableWindows.size()==**2)
    break;
    }

    System.out.println(**availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefore)){
    popup=win;
    driver.switchTo().window(**popup);
    }
    }
    System.out.println(driver.**getTitle());

    On Wednesday, September 19, 2012 8:40:55 PM UTC+5:30, Rajesh Ranjan wrote:

    Hi All,

    I tried with below code. Its is switching the control to the 1st pop up
    window and not to the 2nd pop up which is modal pop up window.
    I guess nothing wrong with the code. When i am running my test class, the
    modal pop up window gets opened but the control still goes to 1st pop up
    window. But while running the same test in debug mode, the modal pop up
    window doesn't open. I am not getting any exception. Can anyone help me in
    this.

    java.util.Set<String> winHandleBefore = driver.getWindowHandles();
    //getWindowHandle();
    driver.findElement(By.id("**btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows =
    driver.getWindowHandles();
    while(true){
    availableWindows = driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;

    System.out.println(**availableWindows.size());
    String npopup = null;
    for(String win:availableWindows){

    if(!win.equals(**winHandleBefore)){
    npopup=win;
    }
    }
    System.out.println(driver.**getTitle());
    driver.switchTo().window(**npopup);



    Regards,
    Rajesh

    On Wed, Sep 19, 2012 at 10:46 AM, Neeraj Sharma wrote:

    Hi Rajesh, I have tried to handle multiple windows for Kotak.com site
    and here is my code which is running successfully on my machine. Please
    have a look into this and might you get any clue from there.

    public class kotak {

    public static void main(String[] args) throws InterruptedException {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://kotak.com")**;
    Thread.sleep(1000);
    // save the current window handle.
    String parentWindowHandle = driver.getWindowHandle();
    //clicking on the secure login button on the home page
    driver.findElement(By.xpath("/**/html/body/div/div[2]/div/div/**
    a/img")).click();
    Thread.sleep(100);

    WebDriver popup = null;
    //saving all windows id in set
    Set<String> handles = driver.getWindowHandles();

    Iterator<String> windowIterator = handles.iterator();
    while(windowIterator.hasNext(**)) {
    //moving forward to the next window id
    String windowHandle = windowIterator.next();

    popup = driver.switchTo().window(**windowHandle);
    Thread.sleep(1000);
    }
    if
    (popup.getTitle().equals("**KMBL Net Banking Login")){
    System.out.println(popup.**getTitle());
    }
    else {
    System.out.println("Driver is not shifted to new window");
    }
    driver.switchTo().frame(0);
    // asserting the heading on the login page and printing the same
    String heading = driver.findElement(By.id("**heading")).getText();
    System.out.println(heading);
    //Entering the userId in login page
    driver.findElement(By.xpath("/**/html/body/form/div/div/div[3]**
    /table/tbody/tr/td/div/table/**tbody/tr[2]/td[3]/input")).**
    sendKeys("12345");

    // Shifting driver to parent window
    driver.switchTo().window(**parentWindowHandle);
    Thread.sleep(100);
    //entering the keyword in the search text box.
    driver.findElement(By.id("**searchInputBox")).sendKeys("**Neeraj");


    }
    }
    On Tuesday, 18 September 2012 22:59:22 UTC+5:30, Manoj Hans wrote:

    see ur code u will get to know....

    On Tuesday, September 18, 2012 10:52:16 PM UTC+5:30, Rajesh Ranjan
    wrote:
    what about 'winHandleBefore'. this variable has not been initialized
    in this below code.


    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans wrote:

    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWin**dowHandles();
    if(availableWindows.size()==**2**)
    break;
    }

    System.out.println(**availableW**indows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefor**e)){
    popup=win;
    driver.switchTo().window(**popu**p);
    }

    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan
    wrote:
    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but it
    didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa******ndle);

    }

    System.*out*.println(driver.**getT****itle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"
    ))).selectByVis******ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n******ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**Linked****HashIterator.nextEntry(
    **Unknown Source)

    at java.util.LinkedHashMap$**KeyIte****rator.next(Unknown
    Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo******pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*******);





    Exception : *java.lang.NullPointerException*******: String
    initializer must be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this
    code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHa****ndle);

    }

    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan
    wrote:
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC******hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:
    No ... your script do not CREATE the windows. It interacts with
    the browsers with calls some other code which creates the windows. That
    code is probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to
    this window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help.
    People here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking
    on 'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up
    window and control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT**********ranscriptEditor();

    window.opener.**ReloadTranscript**********Editor();






    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up
    window.
    below is the code and exception which i am getting while trying
    with the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC**********
    hangeWorkType")).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa**********ndle);
    }
    System.*out*.println(driver.**getT********itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType"
    ))).selectByVis**********ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable
    to find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n**********ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked********
    HashIterator.nextEntry(**Unknown Source)
    at java.util.LinkedHashMap$**KeyIte********rator.next(Unknown
    Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC**********
    hangeWorkType")).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo**********pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp***********);


    Exception : *java.lang.NullPointerException***********: String
    initializer must be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is
    unhandlemodaldialog....

    but i want to know about the title, console printed all title or
    not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you
    got ... it' not very helpful just to say it doesn't work without telling us
    what yo tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    I can only see one popup window, and it looks like a html page
    that has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows. Hope
    this would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs
    appearing:

    parent.dialogArguments.**ReloadT**********ranscriptEditor();













    window.opener.**ReloadTranscript**********Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.












    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop**********up")
    to switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing
    worked. So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which
    has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want
    to switch the control to this second window, change the combo box value,
    click on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT**********ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript**********Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ...
    screenshots, source html code of the application you are testing, and the
    test scripts you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In
    the application thee are some 'Modal pop up' windows and some are 'Ajax pop
    up' windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu**********p".
    But i am not able to switch the control to 2nd pop up window
    which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    It might be similar, but it's obviously not the SAME issue.
    Start a new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I
    think the topic is similar to what I have problem. If you have the solution
    , please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit************.org/reference-**
    guide/1.8/**dijit**********/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**************
    //*[@id='docs_MiniGlass_0']/a[**************1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select
    one/more of the emails and click on the report spam icon. It will make an
    alert modal pop up. Now use firebug/firepath to find locators of the
    elements on the modal. Lets say you want to click on 'Report Spam' button.
    You can do that just by writing

    driver.findElement(By.xpath("**h************
    tml/body/div[8]/div[3]/**button[************1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.************com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms************g/selenium-users/-/**
    DqnzBvlH0uk************J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou*********
    ***ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**********g/selenium-users/-/**
    45EHykZfzl4**********J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*********
    *ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms********g/selenium-users/-/**
    T4yljHNDmp8********J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms******g/selenium-users/-/**
    rBsgqaB9mEQ******J<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms****g/selenium-users/-/Zgg6-**iDdC_
    **I**J<https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ>
    .

    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.****com.
    To view this discussion on the web visit https://groups.google.com/d/
    **ms**g/selenium-users/-/**MujKF9ba7Ug**J<https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ>
    .

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com
    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**QWZGpstPgRsJ<https://groups.google.com/d/msg/selenium-users/-/QWZGpstPgRsJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/6uSlP0bLeXoJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Neeraj Sharma at Sep 21, 2012 at 5:23 am
    Rajesh have you tried to run my code on your machine, any help from there?
    On Thursday, 20 September 2012 18:37:54 UTC+5:30, Rajesh Ranjan wrote:

    I have used the below code but its not working. Still control is going to
    the home page.

    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;
    }

    System.out.println(availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(winHandleBefore)){
    popup=win;
    driver.switchTo().window(popup);
    }
    }
    System.out.println(driver.getTitle());



    On Wed, Sep 19, 2012 at 10:05 PM, Manoj Hans <hman...@gmail.com<javascript:>
    wrote:
    Use this...dont change anything otherwise i wont rectify again...

    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("**btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWindowHandles();
    if(availableWindows.size()==**2)
    break;
    }

    System.out.println(**availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefore)){
    popup=win;
    driver.switchTo().window(**popup);
    }
    }
    System.out.println(driver.**getTitle());

    On Wednesday, September 19, 2012 8:40:55 PM UTC+5:30, Rajesh Ranjan wrote:

    Hi All,

    I tried with below code. Its is switching the control to the 1st pop up
    window and not to the 2nd pop up which is modal pop up window.
    I guess nothing wrong with the code. When i am running my test class,
    the modal pop up window gets opened but the control still goes to 1st pop
    up window. But while running the same test in debug mode, the modal pop up
    window doesn't open. I am not getting any exception. Can anyone help me in
    this.

    java.util.Set<String> winHandleBefore = driver.getWindowHandles();
    //getWindowHandle();
    driver.findElement(By.id("**btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows =
    driver.getWindowHandles();
    while(true){
    availableWindows = driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;

    System.out.println(**availableWindows.size());
    String npopup = null;
    for(String win:availableWindows){

    if(!win.equals(**winHandleBefore)){
    npopup=win;
    }
    }
    System.out.println(driver.**getTitle());
    driver.switchTo().window(**npopup);



    Regards,
    Rajesh

    On Wed, Sep 19, 2012 at 10:46 AM, Neeraj Sharma wrote:

    Hi Rajesh, I have tried to handle multiple windows for Kotak.com site
    and here is my code which is running successfully on my machine. Please
    have a look into this and might you get any clue from there.

    public class kotak {

    public static void main(String[] args) throws InterruptedException {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://kotak.com")**;
    Thread.sleep(1000);
    // save the current window handle.
    String parentWindowHandle = driver.getWindowHandle();
    //clicking on the secure login button on the home page
    driver.findElement(By.xpath("/**/html/body/div/div[2]/div/div/**
    a/img")).click();
    Thread.sleep(100);

    WebDriver popup = null;
    //saving all windows id in set
    Set<String> handles = driver.getWindowHandles();

    Iterator<String> windowIterator = handles.iterator();
    while(windowIterator.hasNext(**)) {
    //moving forward to the next window id
    String windowHandle = windowIterator.next();

    popup = driver.switchTo().window(**windowHandle);
    Thread.sleep(1000);
    }
    if
    (popup.getTitle().equals("**KMBL Net Banking Login")){
    System.out.println(popup.**getTitle());
    }
    else {
    System.out.println("Driver is not shifted to new window");
    }
    driver.switchTo().frame(0);
    // asserting the heading on the login page and printing the same
    String heading = driver.findElement(By.id("**heading")).getText();
    System.out.println(heading);
    //Entering the userId in login page
    driver.findElement(By.xpath("/**/html/body/form/div/div/div[3]**
    /table/tbody/tr/td/div/table/**tbody/tr[2]/td[3]/input")).**
    sendKeys("12345");

    // Shifting driver to parent window
    driver.switchTo().window(**parentWindowHandle);
    Thread.sleep(100);
    //entering the keyword in the search text box.
    driver.findElement(By.id("**searchInputBox")).sendKeys("**
    Neeraj");


    }
    }
    On Tuesday, 18 September 2012 22:59:22 UTC+5:30, Manoj Hans wrote:

    see ur code u will get to know....

    On Tuesday, September 18, 2012 10:52:16 PM UTC+5:30, Rajesh Ranjan
    wrote:
    what about 'winHandleBefore'. this variable has not been initialized
    in this below code.


    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans wrote:

    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWin**dowHandles();
    if(availableWindows.size()==**2**)
    break;
    }

    System.out.println(**availableW**indows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefor**e)){
    popup=win;
    driver.switchTo().window(**popu**p);
    }

    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan
    wrote:
    That's what i am asking, how to switch control to the pop up window.
    what modification is required. I tried below mentioned codes, but
    it didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa******ndle);

    }

    System.*out*.println(driver.**getT****itle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"
    ))).selectByVis******ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable to
    find element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n******ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**Linked****HashIterator.nextEntry
    (**Unknown Source)

    at java.util.LinkedHashMap$**KeyIte****rator.next(Unknown
    Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC******hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo******pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*******);





    Exception : *java.lang.NullPointerException*******: String
    initializer must be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this
    code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHa****ndle);

    }

    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh Ranjan
    wrote:
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC******hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:
    No ... your script do not CREATE the windows. It interacts with
    the browsers with calls some other code which creates the windows. That
    code is probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to
    this window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help.
    People here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and clicking
    on 'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up
    window and control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT**********ranscriptEditor();

    window.opener.**ReloadTranscript**********Editor();







    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up
    window.
    below is the code and exception which i am getting while trying
    with the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC**********
    hangeWorkType")).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles()){
    driver.switchTo().window(winHa**********ndle);
    }
    System.*out*.println(driver.**getT********itle());

    *new* Select(driver.findElement(By.*id*("ddlWorkType
    "))).selectByVis**********ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*: Unable
    to find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n**********ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked********
    HashIterator.nextEntry(**Unknown Source)
    at java.util.LinkedHashMap$**KeyIte********rator.next(Unknown
    Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC**********
    hangeWorkType")).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo**********pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp***********);


    Exception : *java.lang.NullPointerException***********: String
    initializer must be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans wrote:

    show the error msg...most probably exception is
    unhandlemodaldialog....

    but i want to know about the title, console printed all title or
    not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you
    got ... it' not very helpful just to say it doesn't work without telling us
    what yo tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    I can only see one popup window, and it looks like a html page
    that has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows.
    Hope this would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs
    appearing:

    parent.dialogArguments.**ReloadT**********ranscriptEditor();














    window.opener.**ReloadTranscript**********Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.













    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop**********up")
    to switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing
    worked. So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window, which
    has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I want
    to switch the control to this second window, change the combo box value,
    click on update button. And switch back the control to first pop up window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT**********ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript**********Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ...
    screenshots, source html code of the application you are testing, and the
    test scripts you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In
    the application thee are some 'Modal pop up' windows and some are 'Ajax pop
    up' windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu**********p".
    But i am not able to switch the control to 2nd pop up window
    which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    It might be similar, but it's obviously not the SAME issue.
    Start a new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I
    think the topic is similar to what I have problem. If you have the solution
    , please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with 'Modal
    popup' and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit************.org/reference-**
    guide/1.8/**dijit**********/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".**************
    //*[@id='docs_MiniGlass_0']/a[**************1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select
    one/more of the emails and click on the report spam icon. It will make an
    alert modal pop up. Now use firebug/firepath to find locators of the
    elements on the modal. Lets say you want to click on 'Report Spam' button.
    You can do that just by writing

    driver.findElement(By.xpath("**h************
    tml/body/div[8]/div[3]/**button[************1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.************com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms************g/selenium-users/-/*
    *DqnzBvlH0uk************J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou********
    ****ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**********g/selenium-users/-/**
    45EHykZfzl4**********J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou********
    **ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms********g/selenium-users/-/**
    T4yljHNDmp8********J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.********com.
    For more options, visit https://groups.google.com/**grou********
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.******com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms******g/selenium-users/-/**
    rBsgqaB9mEQ******J<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@*
    *googlegroups.******com.
    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com
    .
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.****com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms****g/selenium-users/-/Zgg6-**
    iDdC_**I**J<https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ>
    .

    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.****com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**g/selenium-users/-/**MujKF9ba7Ug**
    J <https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ>.

    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com
    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**QWZGpstPgRsJ<https://groups.google.com/d/msg/selenium-users/-/QWZGpstPgRsJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/6uSlP0bLeXoJ.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/rvZsJ5z8vpsJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rajesh at Sep 21, 2012 at 3:22 pm
    Neeraj! I have tried your code also. But that too is not working for me.

    On Fri, Sep 21, 2012 at 10:53 AM, Neeraj Sharma wrote:

    Rajesh have you tried to run my code on your machine, any help from there?
    On Thursday, 20 September 2012 18:37:54 UTC+5:30, Rajesh Ranjan wrote:

    I have used the below code but its not working. Still control is going to
    the home page.

    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("**btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWindowHandles();
    if(availableWindows.size()==**2)
    break;
    }

    System.out.println(**availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefore)){
    popup=win;
    driver.switchTo().window(**popup);
    }
    }
    System.out.println(driver.**getTitle());


    On Wed, Sep 19, 2012 at 10:05 PM, Manoj Hans wrote:

    Use this...dont change anything otherwise i wont rectify again...

    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("**btnC**hangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWi**ndowHandles();
    if(availableWindows.size()==**2**)
    break;
    }

    System.out.println(**availableW**indows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefor**e)){
    popup=win;
    driver.switchTo().window(**popu**p);
    }
    }
    System.out.println(driver.**getT**itle());


    On Wednesday, September 19, 2012 8:40:55 PM UTC+5:30, Rajesh Ranjan
    wrote:
    Hi All,

    I tried with below code. Its is switching the control to the 1st pop up
    window and not to the 2nd pop up which is modal pop up window.
    I guess nothing wrong with the code. When i am running my test class,
    the modal pop up window gets opened but the control still goes to 1st pop
    up window. But while running the same test in debug mode, the modal pop up
    window doesn't open. I am not getting any exception. Can anyone help me in
    this.

    java.util.Set<String> winHandleBefore = driver.getWindowHandles();
    //getWindowHandle();
    driver.findElement(By.id("**btnC**hangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows =
    driver.getWindowHandles();
    while(true){
    availableWindows = driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;

    System.out.println(**availableWi**ndows.size());
    String npopup = null;
    for(String win:availableWindows){

    if(!win.equals(**winHandleBefore**)){
    npopup=win;
    }
    }
    System.out.println(driver.**getT**itle());
    driver.switchTo().window(**npopu**p);



    Regards,
    Rajesh

    On Wed, Sep 19, 2012 at 10:46 AM, Neeraj Sharma wrote:

    Hi Rajesh, I have tried to handle multiple windows for Kotak.com site
    and here is my code which is running successfully on my machine. Please
    have a look into this and might you get any clue from there.

    public class kotak {

    public static void main(String[] args) throws InterruptedException {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://kotak.com")****;
    Thread.sleep(1000);
    // save the current window handle.
    String parentWindowHandle = driver.getWindowHandle();
    //clicking on the secure login button on the home page
    driver.findElement(By.xpath("/****/html/body/div/div[2]/div/div/****
    a/img")).click();
    Thread.sleep(100);

    WebDriver popup = null;
    //saving all windows id in set
    Set<String> handles = driver.getWindowHandles();

    Iterator<String> windowIterator = handles.iterator();
    while(windowIterator.hasNext(****)) {
    //moving forward to the next window id
    String windowHandle = windowIterator.next();

    popup = driver.switchTo().window(**windo**wHandle);
    Thread.sleep(1000);
    }
    if
    (popup.getTitle().equals("**KMB**L Net Banking Login")){
    System.out.println(popup.**getTi**tle());
    }
    else {
    System.out.println("Driver is not shifted to new window");
    }
    driver.switchTo().frame(0);
    // asserting the heading on the login page and printing the
    same
    String heading = driver.findElement(By.id("**head**
    ing")).getText();
    System.out.println(heading);
    //Entering the userId in login page
    driver.findElement(By.xpath("/****/html/body/form/div/div/div[3]*
    ***/table/tbody/tr/td/div/table/**t**body/tr[2]/td[3]/input")).**send*
    *Keys("12345");

    // Shifting driver to parent window
    driver.switchTo().window(**paren**tWindowHandle);
    Thread.sleep(100);
    //entering the keyword in the search text box.
    driver.findElement(By.id("**sear**chInputBox")).sendKeys("**
    Neeraj**");


    }
    }
    On Tuesday, 18 September 2012 22:59:22 UTC+5:30, Manoj Hans wrote:

    see ur code u will get to know....

    On Tuesday, September 18, 2012 10:52:16 PM UTC+5:30, Rajesh Ranjan
    wrote:
    what about 'winHandleBefore'. this variable has not been initialized
    in this below code.


    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans wrote:

    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWin****dowHandles();
    if(availableWindows.size()==**2****)
    break;
    }

    System.out.println(**availableW****indows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefor****e)){
    popup=win;
    driver.switchTo().window(**popu****p);
    }

    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan
    wrote:
    That's what i am asking, how to switch control to the pop up
    window.
    what modification is required. I tried below mentioned codes, but
    it didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC********hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa********ndle);

    }

    System.*out*.println(driver.**getT******itle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"
    ))).selectByVis********ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable
    to find element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n********ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**Linked******
    HashIterator.nextEntry(**Unknown Source)

    at java.util.LinkedHashMap$**KeyIte******rator.next(Unknown
    Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC********hangeWorkType"
    )).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo********pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*********);





    Exception : *java.lang.NullPointerException*********: String
    initializer must be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this
    code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHa******ndle);

    }

    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh
    Ranjan wrote:
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC********
    hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:
    No ... your script do not CREATE the windows. It interacts
    with the browsers with calls some other code which creates the windows.
    That code is probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going to
    this window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans wrote:

    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help.
    People here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and
    clicking on 'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up
    window and control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT************ranscriptEditor();

    window.opener.**ReloadTranscript************Editor();







    create popups, or some other inofrmation to help us understand exactly what they are and how to deal with them.

    Nothing in your attachment tells us that that I can see.

    Peter


    ------------------------------
    Date: Tue, 18 Sep 2012 20:49:12 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi,

    Please find attached the html page source for the modal pop up
    window.
    below is the code and exception which i am getting while trying
    with the code to switch the control to the modal pop up window:
    1.
    String *winHandleBefore* = driver.getWindowHandle();
    driver.findElement(By.*id*("btnC************
    hangeWorkType")).click();
    Thread.*sleep*(1000);
    *for*(String winHandle : driver.getWindowHandles
    ()){
    driver.switchTo().window(winHa************ndle);
    }
    System.*out*.println(driver.**getT**********itle
    ());

    *new* Select(driver.findElement(By.*id*("
    ddlWorkType"))).selectByVis************ibleText("NOTE");



    Exception: *org.openqa.selenium.NoSuchElementException*:
    Unable to find element by id using "ddlWorkType"
    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'
    Driver info: driver.version: ie


    2. Set <String> handles =driver.getWindowHandles();
    Iterator<String> it = handles.iterator();
    //iterate through your windows
    *while* (it.hasNext()){
    String *parent* = it.next();
    String newwin = it.next();
    driver.switchTo().window(n************ewwin);

    driver.close();

    }

    This code is switching control to the main window.
    Exception : *java.util.NoSuchElementException*
    at java.util.LinkedHashMap$**Linked**********
    HashIterator.nextEntry(**Unknown Source)
    at java.util.LinkedHashMap$**KeyIte**********rator.next(Unknown
    Source)



    3. *Set*<String> beforePopUp = driver.getWindowHandles();
    driver.findElement(By.*id*("btnC************
    hangeWorkType")).click();
    Thread.*sleep*(1000);
    //Get all the window handles in a set
    //get window handles after the click
    Set<String> afterPopup = driver.getWindowHandles();

    //remove all window handles before the *popup*
    afterPopup.removeAll(beforePo************pUp);
    *if*(afterPopup.size() == 1) {
    *popUp* = (String) afterPopup.toArray()[0];
    } *else* {

    }
    //switch to popUp
    driver.switchTo().window(*popUp*************);


    Exception : *java.lang.NullPointerException*************:
    String initializer must be non-null
    at com.sun.jna.WString.<init>(*WString.java:23*)

    *

    *
    Regards,
    Rajesh*
    *
    On Mon, Sep 17, 2012 at 11:50 PM, Manoj Hans <hman...@gmail.com
    wrote:
    show the error msg...most probably exception is
    unhandlemodaldialog....

    but i want to know about the title, console printed all title
    or not???


    On Monday, September 17, 2012 11:40:17 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    So show us the code you have tried and any error messages you
    got ... it' not very helpful just to say it doesn't work without telling us
    what yo tried.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:37:33 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    yes..i have tried this also

    On Mon, Sep 17, 2012 at 11:32 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Have you tried getWindowHandles()?

    ------------------------------
    Date: Mon, 17 Sep 2012 23:30:39 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with the same.
    But its not working. i was trying window title name in
    SwitchTo().window().
    But none of the things are working.

    On Mon, Sep 17, 2012 at 11:23 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    I can only see one popup window, and it looks like a html
    page that has been opened in a new window ... you should be able to use the
    getWindowHandles() and switchTo() methods described on SeleniumHQ.org, then
    normal WebDriver methods to deal with the html elements of the page.

    ------------------------------
    Date: Mon, 17 Sep 2012 23:08:34 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Peter,

    I have attached a screenshot of the thee two pop up windows.
    Hope this would be enough.


    On Mon, Sep 17, 2012 at 10:50 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Looks like you have dealt with the "alert(msg);" popup.

    You could be gettign eother of these two windows/dialogs
    appearing:

    parent.dialogArguments.**ReloadT************ranscriptEditor();














    window.opener.**ReloadTranscript************Editor();


    But you still haven't prvovided any details of what either one looks like or teh actual code that creates them .. which might indicate to us how to deal with it.













    ------------------------------
    Date: Mon, 17 Sep 2012 22:44:56 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    I have tried with :driver.switchTo().window("**pop************up")
    to switch the control to first pop up window.
    I tried with the window title in place of 'popup'. But nothing
    worked. So i just tried with 'popup' and it worked.
    But now clicking on a button i am getting one more window,
    which has a combo box and two buttons to update and cancel the selection.
    Below i have provided the html part of 2nd pop up window. I
    want to switch the control to this second window, change the combo box
    value, click on update button. And switch back the control to first pop up
    window.

    <head><title> Change WorkType</title> <base target="_self" /> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <script type="text/javascript" language="javascript"> function RefreshParentPage(msg) { alert(msg); if (parent.dialogArguments) parent.dialogArguments.**ReloadT************ranscriptEditor(); else if (window.opener) window.opener.**ReloadTranscript************Editor(); self.close(); } </script>



    On Mon, Sep 17, 2012 at 10:29 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    Please supply more concrete details of your problem ...
    screenshots, source html code of the application you are testing, and the
    test scripts you have tried.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 22:26:17 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Hi All,

    I am using selenium webdriver to automate a web application. In
    the application thee are some 'Modal pop up' windows and some are 'Ajax pop
    up' windows inside a pop up window. I switched the control to first pop up
    window using : driver.switchto().window("**popu************p".
    But i am not able to switch the control to 2nd pop up window
    which opens after clicking on a button in 1st pop up window.
    Please suggest a solution for this.




    On Mon, Sep 17, 2012 at 10:20 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    It might be similar, but it's obviously not the SAME issue.
    Start a new thread.

    ------------------------------
    Date: Mon, 17 Sep 2012 09:48:59 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.


    Hi Peter,

    Hope you are doing good. About hijacking, its not like that. I
    think the topic is similar to what I have problem. If you have the solution
    , please let me know. Its just we are spreading knowledge.

    Regards
    Nitin Rajpal

    On Monday, 17 September 2012 22:14:41 UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Nitin,

    PLease do no hijack threads.

    If you have a new issue you want help with, start a new thread.

    Peter

    ------------------------------
    Date: Mon, 17 Sep 2012 09:25:09 -0700
    From: nitin...@gmail.com
    To: seleniu...@googlegroups.**com
    Subject: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.

    Hi,

    Please provide the solution of the below code:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://**dojotoolkit**************.org/reference-**
    guide/1.8/**dijit************/Editor.html<http://dojotoolkit.org/reference-guide/1.8/dijit/Editor.html>
    ");
    Thread.sleep(3000l);
    driver.findElement(By.xpath(".****************
    //*[@id='docs_MiniGlass_0']/a[****************
    1]/span")).click();

    I want to have control in the popup.

    Early response will be highly appreciable.

    Thank You
    Nitin Rajpal

    On Monday, 17 September 2012 06:22:39 UTC+5:30, akki wrote:

    Example Test Case: Log into your gmail account and select
    one/more of the emails and click on the report spam icon. It will make an
    alert modal pop up. Now use firebug/firepath to find locators of the
    elements on the modal. Lets say you want to click on 'Report Spam' button.
    You can do that just by writing

    driver.findElement(By.xpath("**h**************
    tml/body/div[8]/div[3]/**button[**************1]")).click()

    The point which I am trying to make is AJAX modal is just a web
    element. So you can perform all those actions which you can perform on a
    normal web element.


    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.**************com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**************
    g/selenium-users/-/**DqnzBvlH0uk**************J<https://groups.google.com/d/msg/selenium-users/-/DqnzBvlH0ukJ>
    .
    For more options, visit https://groups.google.com/**grou*******
    *******ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms************g/selenium-users/-/
    **45EHykZfzl4************J<https://groups.google.com/d/msg/selenium-users/-/45EHykZfzl4J>
    .
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.






    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.************com.
    For more options, visit https://groups.google.com/**grou*******
    *****ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.**********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms**********g/selenium-users/-/**
    T4yljHNDmp8**********J<https://groups.google.com/d/msg/selenium-users/-/T4yljHNDmp8J>
    .

    For more options, visit https://groups.google.com/**grou*******
    ***ps/opt_out <https://groups.google.com/groups/opt_out>.







    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*******
    ***ps/opt_out <https://groups.google.com/groups/opt_out>.




    --Forwarded Message Attachment--

    Note:- Change of Work Type will Reload the Editor Window. Work
    Type: Select CONSULT NOTE GENERAL PROGRESS NOTE


    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*******
    ***ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.**********com.
    For more options, visit https://groups.google.com/**grou*******
    ***ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.********com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms********g/selenium-users/-/**
    rBsgqaB9mEQ********J<https://groups.google.com/d/msg/selenium-users/-/rBsgqaB9mEQJ>
    .

    For more options, visit https://groups.google.com/**grou*******
    *ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.********com.
    For more options, visit https://groups.google.com/**grou*******
    *ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.********com.
    For more options, visit https://groups.google.com/**grou*******
    *ps/opt_out <https://groups.google.com/groups/opt_out>.








    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.********com.
    For more options, visit https://groups.google.com/**grou*******
    *ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@
    **googlegroups.********com.
    For more options, visit https://groups.google.com/**grou*******
    *ps/opt_out <https://groups.google.com/groups/opt_out>.




    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**
    com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.******com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms******g/selenium-users/-/Zgg6-**
    iDdC_**I****J<https://groups.google.com/d/msg/selenium-users/-/Zgg6-iDdC_IJ>
    .

    For more options, visit https://groups.google.com/**grou******
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.******com.
    To view this discussion on the web visit
    https://groups.google.com/d/**ms****g/selenium-users/-/**
    MujKF9ba7Ug****J<https://groups.google.com/d/msg/selenium-users/-/MujKF9ba7UgJ>
    .

    For more options, visit https://groups.google.com/**grou****
    ps/opt_out <https://groups.google.com/groups/opt_out>.



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj2...@gmail.com
    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.**com.
    To view this discussion on the web visit https://groups.google.com/d/*
    *ms**g/selenium-users/-/**QWZGpstPgRs**J<https://groups.google.com/d/msg/selenium-users/-/QWZGpstPgRsJ>
    .
    For more options, visit https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
    .



    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.**com.
    To unsubscribe from this group, send email to selenium-user...@**
    googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/**
    msg/selenium-users/-/**6uSlP0bLeXoJ<https://groups.google.com/d/msg/selenium-users/-/6uSlP0bLeXoJ>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/rvZsJ5z8vpsJ.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Regards,
    Rajesh
    Mob: 9535268715
    Email: raj224in@gmail.com

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Neeraj Sharma at Sep 21, 2012 at 4:37 pm
    Copy paste the code as it and run,,and let me know the error if any,,
    On Friday, 21 September 2012 20:24:20 UTC+5:30, Rajesh Ranjan wrote:

    Neeraj! I have tried your code also. But that too is not working for me.


    On Fri, Sep 21, 2012 at 10:53 AM, Neeraj Sharma <mintu...@gmail.com<javascript:>
    wrote:
    Rajesh have you tried to run my code on your machine, any help from there?
    On Thursday, 20 September 2012 18:37:54 UTC+5:30, Rajesh Ranjan wrote:

    I have used the below code but its not working. Still control is going
    to the home page.

    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("**btnChangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWindowHandles();
    if(availableWindows.size()==**2)
    break;
    }

    System.out.println(**availableWindows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefore)){
    popup=win;
    driver.switchTo().window(**popup);
    }
    }
    System.out.println(driver.**getTitle());


    On Wed, Sep 19, 2012 at 10:05 PM, Manoj Hans wrote:

    Use this...dont change anything otherwise i wont rectify again...


    String winHandleBefore = driver.getWindowHandle();
    driver.findElement(By.id("**btnC**hangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWi**ndowHandles();
    if(availableWindows.size()==**2**)
    break;
    }

    System.out.println(**availableW**indows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefor**e)){
    popup=win;
    driver.switchTo().window(**popu**p);
    }
    }
    System.out.println(driver.**getT**itle());


    On Wednesday, September 19, 2012 8:40:55 PM UTC+5:30, Rajesh Ranjan
    wrote:
    Hi All,

    I tried with below code. Its is switching the control to the 1st pop
    up window and not to the 2nd pop up which is modal pop up window.
    I guess nothing wrong with the code. When i am running my test class,
    the modal pop up window gets opened but the control still goes to 1st pop
    up window. But while running the same test in debug mode, the modal pop up
    window doesn't open. I am not getting any exception. Can anyone help me in
    this.

    java.util.Set<String> winHandleBefore = driver.getWindowHandles();
    //getWindowHandle();
    driver.findElement(By.id("**btnC**hangeWorkType")).click();
    //je.executeScript("return OpenChangeWorkType()");
    Thread.sleep(2000);
    java.util.Set<String> availableWindows =
    driver.getWindowHandles();
    while(true){
    availableWindows = driver.getWindowHandles();
    if(availableWindows.size()==2)
    break;

    System.out.println(**availableWi**ndows.size());
    String npopup = null;
    for(String win:availableWindows){

    if(!win.equals(**winHandleBefore**)){
    npopup=win;
    }
    }
    System.out.println(driver.**getT**itle());
    driver.switchTo().window(**npopu**p);



    Regards,
    Rajesh

    On Wed, Sep 19, 2012 at 10:46 AM, Neeraj Sharma wrote:

    Hi Rajesh, I have tried to handle multiple windows for Kotak.com site
    and here is my code which is running successfully on my machine. Please
    have a look into this and might you get any clue from there.

    public class kotak {

    public static void main(String[] args) throws InterruptedException {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://kotak.com")****;
    Thread.sleep(1000);
    // save the current window handle.
    String parentWindowHandle = driver.getWindowHandle();
    //clicking on the secure login button on the home page
    driver.findElement(By.xpath("/****/html/body/div/div[2]/div/div/****
    a/img")).click();
    Thread.sleep(100);

    WebDriver popup = null;
    //saving all windows id in set
    Set<String> handles = driver.getWindowHandles();

    Iterator<String> windowIterator = handles.iterator();
    while(windowIterator.hasNext(****)) {
    //moving forward to the next window id
    String windowHandle = windowIterator.next();

    popup = driver.switchTo().window(**windo**wHandle);
    Thread.sleep(1000);
    }
    if
    (popup.getTitle().equals("**KMB**L Net Banking Login")){
    System.out.println(popup.**getTi**tle());
    }
    else {
    System.out.println("Driver is not shifted to new window");
    }
    driver.switchTo().frame(0);
    // asserting the heading on the login page and printing the
    same
    String heading = driver.findElement(By.id("**head**
    ing")).getText();
    System.out.println(heading);
    //Entering the userId in login page
    driver.findElement(By.xpath("/****/html/body/form/div/div/div[3]
    ****/table/tbody/tr/td/div/table/**t**body/tr[2]/td[3]/input")).**
    send**Keys("12345");

    // Shifting driver to parent window
    driver.switchTo().window(**paren**tWindowHandle);
    Thread.sleep(100);
    //entering the keyword in the search text box.
    driver.findElement(By.id("**sear**chInputBox")).sendKeys("**
    Neeraj**");


    }
    }
    On Tuesday, 18 September 2012 22:59:22 UTC+5:30, Manoj Hans wrote:

    see ur code u will get to know....

    On Tuesday, September 18, 2012 10:52:16 PM UTC+5:30, Rajesh Ranjan
    wrote:
    what about 'winHandleBefore'. this variable has not been
    initialized in this below code.


    On Tue, Sep 18, 2012 at 10:41 PM, Manoj Hans wrote:

    try this---

    java.util.Set<String> availableWindows;
    while(true){
    availableWindows=driver.**getWin****dowHandles();
    if(availableWindows.size()==**2****)
    break;
    }

    System.out.println(**availableW****indows.size());
    String popup=null;
    for(String win:availableWindows){
    if(!win.equals(**winHandleBefor****e)){
    popup=win;
    driver.switchTo().window(**popu****p);
    }

    On Tuesday, September 18, 2012 10:37:53 PM UTC+5:30, Rajesh Ranjan
    wrote:
    That's what i am asking, how to switch control to the pop up
    window.
    what modification is required. I tried below mentioned codes, but
    it didn't worked.

    1.

    String *winHandleBefore* = driver.getWindowHandle();

    driver.findElement(By.*id*("btnC********hangeWorkType
    ")).click();

    Thread.*sleep*(1000);

    *for*(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(winHa********ndle);

    }

    System.*out*.println(driver.**getT******itle());



    *new* Select(driver.findElement(By.*id*("ddlWorkType"
    ))).selectByVis********ibleText("NOTE");







    Exception: *org.openqa.selenium.NoSuchElementException*: Unable
    to find element by id using "ddlWorkType"

    System info: os.name: 'Windows XP', os.arch: 'x86', os.version:
    '5.1', java.version: '1.7.0_05'

    Driver info: driver.version: ie





    2. Set <String> handles =driver.getWindowHandles();

    Iterator<String> it = handles.iterator();

    //iterate through your windows

    *while* (it.hasNext()){

    String *parent* = it.next();

    String newwin = it.next();

    driver.switchTo().window(n********ewwin);



    driver.close();



    }



    This code is switching control to the main window.

    Exception : *java.util.NoSuchElementException*

    at java.util.LinkedHashMap$**Linked******
    HashIterator.nextEntry(**Unknown Source)

    at java.util.LinkedHashMap$**KeyIte******rator.next(Unknown
    Source)







    3. *Set*<String> beforePopUp = driver.getWindowHandles();

    driver.findElement(By.*id*("btnC********hangeWorkType
    ")).click();

    Thread.*sleep*(1000);

    //Get all the window handles in a set

    //get window handles after the click

    Set<String> afterPopup = driver.getWindowHandles();



    //remove all window handles before the *popup*

    afterPopup.removeAll(beforePo********pUp);

    *if*(afterPopup.size() == 1) {

    *popUp* = (String) afterPopup.toArray()[0];

    } *else* {



    }

    //switch to popUp

    driver.switchTo().window(*popUp*********);





    Exception : *java.lang.NullPointerException*********: String
    initializer must be non-null

    at com.sun.jna.WString.<init>(*WString.java:23*)

    *
    *

    *
    *
    On Tue, Sep 18, 2012 at 10:31 PM, Manoj Hans wrote:

    how can u ensure that u r switching on right window using this
    code???


    for(String winHandle : driver.getWindowHandles()){

    driver.switchTo().window(**winHa******ndle);

    }

    On Tuesday, September 18, 2012 10:27:36 PM UTC+5:30, Rajesh
    Ranjan wrote:
    The modal pop up window launches after execution of below line:
    driver.findElement(By.id("**btnC********
    hangeWorkType")).click();
    I have attached the test script i am using.

    On Tue, Sep 18, 2012 at 10:22 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:
    No ... your script do not CREATE the windows. It interacts
    with the browsers with calls some other code which creates the windows.
    That code is probably what soemone needs to see to help you.

    But it won't be me.

    ------------------------------
    Date: Tue, 18 Sep 2012 22:16:36 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Yes the modal dialog box opens. But the control is not going
    to this window.


    On Tue, Sep 18, 2012 at 10:14 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Does your test script create the windows dialogs?

    ------------------------------
    Date: Tue, 18 Sep 2012 22:06:57 +0530

    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    Please find attached the test script for reference:

    On Tue, Sep 18, 2012 at 9:47 PM, Manoj Hans <hman...@gmail.com
    wrote:
    I also can't understand wt rajesh trying to say.....At last if
    possible for u then show me ur code via team viewer
    Otherwise,I also give up


    -Manoj Hans


    On Tuesday, September 18, 2012 9:31:30 PM UTC+5:30,
    PeterJef...@Hotmail.co.uk wrote:

    Rajesh

    You've said that several times already and it doesn't help.
    People here need techical details in order to give you a technical help.

    But I give up. Maybe someone else will be able to help.

    Peter

    ------------------------------
    Date: Tue, 18 Sep 2012 21:24:24 +0530
    Subject: Re: [selenium-users] Re: Need help: How to deal with
    'Modal popup' and 'Ajax window popup' windows.
    From: raj2...@gmail.com
    To: seleniu...@googlegroups.**com


    In this pop up window, changing the combo box value and
    clicking on 'Update' button, the first window will be reloaded again.
    Clicking on cancel button, will only close the modal pop up
    window and control will go to the first pop uo window.


    Rajesh

    On Tue, Sep 18, 2012 at 9:18 PM, Peter Gale <
    peterjef...@hotmail.co.**uk> wrote:

    Rajesh

    We need to uinderstand how these lines:

    parent.dialogArguments.**ReloadT**