0

Attached_image

Please help, i am trying to automate a project(using java) where i need to operate on nested popup windows i.e with a main window i have a popup which includes one more window inside it. You can check the image I have attached. The problem what i am facing is,

org.openqa.selenium.NoSuchElementException: Unable to find element with id == btnSign (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 10.22 seconds

i.e. it is not able to find the element that is inside 2nd scroll. Note. (I am working on IE) Can anyone give an idea how to handle it. Thanks in advance.

Mukesh Takhtani
  • 852
  • 5
  • 15
amlann_
  • 1
  • 1
  • 1
    Possible duplicate of [selenium, how can I select new window](http://stackoverflow.com/questions/11220869/selenium-how-can-i-select-new-window) – Andremoniy Jan 11 '16 at 07:27

1 Answers1

0

You can switch any number of windows using below code.

String parentWindow = webDriver.getWindowHandle();
Set<String> handles = webDriver.getWindowHandles();
        for (String windowHandle : handles) {
            if (!windowHandle.equals(parentWindow)) {
                webDriver.switchTo().window(windowHandle);
            }
        }
yojna
  • 503
  • 1
  • 5
  • 17
  • Hello thank you for the reply. Will it be applicable for multiple scrolls as shown at image attachments ? – amlann_ Jan 11 '16 at 08:29
  • For scrolling you need to find scrollable element. and you can scroll it. – yojna Jan 11 '16 at 10:27
  • no help from the above code. And i do have a scrolling element. Once check the attached image for the further clarification. Thanks – amlann_ Jan 11 '16 at 10:46
  • Are you able to find/locate elements in child window? – yojna Jan 11 '16 at 10:59
  • Find element below for loop. – yojna Jan 11 '16 at 11:01
  • I am getting such error: Failed to navigate to . This usually means that a call to the COM method IWebBrowser2::Navigate2() failed. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 18 milliseconds – amlann_ Jan 12 '16 at 06:23