Selenium/Junit - Authentication screen not saved/executed

Asked

Viewed 569 times

1

I’m doing a POC for using Selenium + Junit 4 for functional interface testing in a web tool. The tool in question requires authentication when opening the URL, and the test was saved to the Selenium IDE/Firefox with all steps including the completion of that authentication.

When I exported the test file to java, when running Junit Firefox opens, however the test does not leave the login screen, and even if I record this case in Selenium already starting from "home" from the web tool, in the test run in the eclipse will always be asked for authentication as if the page was being opened from scratch.

What I researched could be used Webelement with Sendkeys, however it is not possible to open the Firefox console on this authentication screen to collect the identification of the user/password elements, which I believe to be Javascript.

This is the authentication screen:

inserir a descrição da imagem aqui

I have tried the following concepts as solutions, without success:

I’ve already modified the method setUp() of @Before with all the possibilities that came to mind but the test does not develop beyond this screen, even if you run it directly in Selenium IDE/Firefox.

Any idea? =(

Update: I managed to have the User and Password data automatically loaded by loading a profile in the code with this data already saved, however I was not able to do the action of clicking on "OK", neither with robot, nor with "driver.get("http://user:pass@url");". I managed to accomplish this action using Autoit to record the mouse movement, and calling the . exe later in the code, but I found the solution a little strange, there is a better way to perform this action of pressing the "OK" without using this tool?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.