A
A
Antonio2020-01-23 12:41:12
Automation
Antonio, 2020-01-23 12:41:12

How to switch windows in Winium?

Good afternoon!
I use for testing a desktop application (thick client) a library - Winium. I'm trying to switch to another window using the following code, but it doesn't work:

window =  driverWinium.findElementByClassName("TNavigatorForm");
        
        WebElement newWindow =  driverWinium.findElement(By.className("TNavigatorForm"));
        String newWindowHandle = newWindow.getAttribute("NativeWindowHandle");
        driverWinium.switchTo().window(newWindowHandle);

        window.click();

What could be wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question