0

Still looking for resolution for following problem:

  1. In Safari version 12: org.openqa.selenium.InvalidArgumentException: Request body does not contain required parameter 'handle'. I did see some solution saying use legacy, but not sure how to do that in selenium java.

Note: My code is working absolutely fine for Chrome, firefox, Edge browsers. I am facing this issue only with Safari.

Can anybody please help me here. Thanks in advance!

Selenium Version: 3.4/3.8

Code:

I am using Java for my scripts. Code:

String winHandleBefore = driver.getWindowHandle();
Set<String> windows = driver.getWindowHandles();
        Assert.assertTrue("New browser window is not opened", windows.size() > 1);
        for (String winHandle : driver.getWindowHandles()) {
            String winHandleNew = winHandle;
            if(!winHandleBefore.equalsIgnoreCase(winHandleNew)) {
            driver.switchTo().window(winHandle);//THIS LINE GIVES THE ERROR
                break;
            }
        }
        driver.switchTo().defaultContent();
  • Which language are you using and are you able to please share the code that results in the error? - there are different ways to switch and manage tabs - i posted this a few days ago for c# - https://stackoverflow.com/questions/62774094/creating-new-tabs-and-managing-them-selenium/62812045#62812045 – RichEdwards Jul 14 '20 at 08:51
  • It's difficult to read as one text block in comments - there's no drama in editing your question and adding that in. It will make it much easier for anyone to help :-) – RichEdwards Jul 14 '20 at 10:10
  • sorry about that, i have posted in the question itself. – noobonquest Jul 14 '20 at 10:44

0 Answers0