WebDriverException

45 views
Skip to first unread message

Gokul Krishna

unread,
Jun 3, 2015, 7:04:38 AM6/3/15
to seleniu...@googlegroups.com
 
Hi All,
 
Below are the following issues we are facing when working with Internet Explorer with Selenium Webdriver.
1. In our application,after clicking on a link , a pop up comes up in a new window. As wedriver interaction wasn't successful,we were able to handle the pop up with Robot class(Tab+Enter Keys to click on OK button in the popup ). But once the focus move back to the parent window, We are facing WebDriverException and TimeOutException even after using Explicit wait.
2. One more instance with a dealing new window, where we are finding trouble is "Unable to get browser: WebDriverException". The Solution suggested in some of the websites was to modify the settings of InternetExplorer(Changing the "Enable Protected mode" across all the zones in IE Settings. But because of project restrictions, we can't do that.
Please note that we have also used Desired Capabilities to ignore the settings of the IE browser.
Please suggest the possible solutions for the above issues
 
Regards,
Gokul.

Krishnan Mahadevan

unread,
Jun 3, 2015, 7:12:46 AM6/3/15
to Selenium Users
We would not be able to concretely say anything until you can :

* Show us some code and a html page/ or a public website against which your code can be executed to recreate the problem.
* Show us what exactly is the error message and share the stacktrace etc.,



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKsZrmPRvzBJzxTb2agpUER4EzGWHoFiohNvXrxFcPXxSBzT-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Sudhansu Sekhar panda

unread,
Jun 3, 2015, 8:21:59 AM6/3/15
to seleniu...@googlegroups.com
Hi Gocool,

The issue is present while switching to the new window. Can you please attach the code snippet for switching to the new window so that we can have a clearcut solution?

Thanks,

Sudhansu

Gokul Krishna

unread,
Jun 3, 2015, 1:07:26 PM6/3/15
to seleniu...@googlegroups.com
Hi,

Please find the code snippet.

for Issue1: Webdriver throws Exception after closing the pop window 


wd.findElement(By.id("xx")).click();
Robot r=new Robot();
r.keyPress(KeyEvent.VK_TAB);
r.delay(1000);
  // Press Enter
  r.keyPress(KeyEvent.VK_ENTER);


Set<String> windows = wd.getWindowHandles();
loop1:
           for (String window : windows) {
               wd.switchTo().window(window);
               if (wd.getTitle().contains("Welcome")) {
               
                 break loop1;
               }
           }
wd.switchTo().frame("Main");
wd.findElement(By.name("tab")).click();


for Issue2:


 //clicking button1 opens a new window 
String pw=wd.getWindowHandle();
wd.findElement(By.id("button1")).click();
Set<String> windows = wd.getWindowHandles();
loop2:
        for (String window : windows) {
            wd.switchTo().window(window);
            if (wd.getTitle().contains("Welcome1")) {
           
             break loop2;
            }
        }
wd.findElement(By.name("yy")).sendKeys("abc");
wd.findElement(By.name("checkbox")).click();
wd.findElement(By.name("Continue")).click();
wd.switchTo().window(pw);



 //clicking button2 opens a new window , Webdriver throws "Unable to get browser Exception

wd.findElement(By.id("button2")).click();
Set<String> windows1 = wd.getWindowHandles();
loop2:
        for (String window : windows1) {
            wd.switchTo().window(window);
            if (wd.getTitle().contains("Welcome2")) {
           
             break loop2;
            }
        }
wd.findElement(By.name("yy")).sendKeys("abc");
wd.findElement(By.name("checkbox")).click();
wd.findElement(By.name("Continue")).click();


Using IE browser version 9 and Windows 64 bit OS.


Regards,
Gokul.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Gokul Krishna

unread,
Jun 4, 2015, 9:41:20 AM6/4/15
to seleniu...@googlegroups.com
Could you please help on the above issues.

khaja moinuddin Mohammed

unread,
Jun 4, 2015, 11:33:38 PM6/4/15
to seleniu...@googlegroups.com
Gokul,

A few suggestions as i dont see much happening on this thread... let me if it worked. 

1. After clicking on the button, give a wait command, as it might be taking a little time to show up the opened popups/ windows. 
2. inside the for loop and if statement, try to print the titles, and see if its printing the window's titile you want to print it. 
3. Try to use Set's Iterator, i know this should not be any different from using for each, but why to leave any options, right :)
4. see, if it is actually a window or a javascript pop up, sometimes they look like another windo/ popup but could be javascript thing in which case you might need to use switchto.alert.

Thanks,
Khaja
Reply all
Reply to author
Forward
0 new messages