Trying to get past windows authentication in browser stack

180 views Asked by At

So for the last few days, I've been trying to get past the windows authentication popup box when creating automation tests in Katalon Studio. I'm testing a local website and finally got this working locally using the code below in Katalon. When the login box opens, my username and password are typed in followed by clicking okay... happy days...

    @Keyword
    def uploadFile (TestObject to, String filePath) {
        WebUI.click(to)
        StringSelection ss = new StringSelection(filePath);
        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
        Robot robot = new Robot();
        robot.keyPress(KeyEvent.VK_ENTER);
        robot.keyRelease(KeyEvent.VK_ENTER);
        robot.delay(1000); //Millisecond 1 second delay only if needed
        robot.keyPress(KeyEvent.VK_CONTROL);
        robot.keyPress(KeyEvent.VK_V);
        robot.keyRelease(KeyEvent.VK_V);
        robot.delay(1000); //Millisecond 1 second delay only if needed
        robot.keyRelease(KeyEvent.VK_CONTROL);
        robot.keyPress(KeyEvent.VK_ENTER);
        robot.keyRelease(KeyEvent.VK_ENTER);
    }
}

The issue I'm having now is when trying to run this same test in Browser Stack, the website is loading okay but the above doesn't appear to type my username and password into the login box.

Not sure what I'm doing wrong or if the Browser Stack just doesn't allow this. Any advice/info would be really helpful.

1

There are 1 answers

0
HN17 On

Java Robot Class is not supported on BrowserStack and you would only be able to use Basic Authentication.