Skip to content
Advertisement

Running Automation test on url links that store in a text file

I want to loop throw a text file that stores a URL links the problem is that every time i run the test the browser opens the API links one after another and closes them one by one, and only on the last one did the test completely and pass. there is a way to fix this issue?

there is my code:

JavaScript

Advertisement

Answer

Its because you are performing actions outside of the loop. Call those actions inside the loop.

JavaScript

It’s always better to use Explicit wait instead of Implicit wait or Thread.sleep().

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement