Hi Sir, in case of a website with quite a lot of AJAX/async JS, are there any reliable strategy to wait until the JS is complete and I can safely continue the automation? Currently I use quite a lot of `driver.execute_script("return document.readyState") == "complete"` trying to mitigate the issue but this is not very reliable. And as you mentioned in the video, using `time.sleep(...)` is not reliable and may compromise performance unnecessarily.
@tranfb5522 жыл бұрын
thank you very much for your videos
@mrseregasss435 Жыл бұрын
Hello Why in time 9:12 locator have (( )) ? [locator=By.Xpath, ...]
@BurnedZero2 жыл бұрын
very good and well explained, my friend!! Gonna start a qa tester course soon and I'm already studying automation as much as I can.
@AznBMan752 жыл бұрын
Hi sir! How would I do a wait after I manually login, and pass through a few security pages then to the page that I want automate. The program will get to the front page, and then wait for me to login through 4 security pages. And, then it finally lands on the page that I want to automate, and then it will click on "href" or title of the element of the page to open a new tab page.
@NicolasChanCSY2 жыл бұрын
I see 3 ways of doing this: 1. You manually add an `input("Press Enter/Return to continue.")` statement to your code where you want the program to wait. Upon reaching the `input` statement, the program would pause and wait for your console input. You can then do whatever you need to until you reach the continue-automation page, and then you return an empty string to the console input to continue the automation. This is easiest to do, but most "low-tech". 2. You add a Explicit/Fluent Wait to wait until the URL of the page or title of the page matches your continue-automation page. Note that your `timeout` argument value may need to be set larger than usual, because humans are much slower than machines, especially for security pages. This is harder to do, but is more responsive, and requires less human intervention. You may need to define your own expected condition for WebDriverWait to check. The expected condition should be a callable taking in one and only one argument for the webdriver, and should return a truthy/falsy value (Definition of Python truthy/falsy values: stackoverflow.com/questions/39983695/what-is-truthy-and-falsy-how-is-it-different-from-true-and-false). e.g. WebDriverWait(driver, 300).until(lambda d: ...) 3. Try automate the security pages. In case of login credentials or secret tokens, try to use a .env file (python-dotenv maybe helpful). Needless to say, this is the hardest, but most likely fastest.
@codyhabrock47513 жыл бұрын
Very awesome thanks! Explained very well!
@Undrios5 ай бұрын
Thank you sir
@DataWiseDiscoveries2 жыл бұрын
Is there any video missing sir, or it is complete playlist?
@HarisZafar-zz5ou4 ай бұрын
I am facing an issue with implementing this. Can any one help?
@АлександрК-ш2 жыл бұрын
Hello. Can you please tell me where to find the source code?
@poreshrautofficial70762 жыл бұрын
Thank you sirr
@ibragimvisitaev6981 Жыл бұрын
thanks bud
@pearlmm58692 жыл бұрын
TypeError: element_to_be_clickable() takes 1 positional argument but 2 were given shown in my picharm
@SanjeevKumar-zm2li10 ай бұрын
You are missing paranthesis
@umeshmore3173 жыл бұрын
Hello Sir, Is there any link from where we can download the code?
@softwaretestingmentor3 жыл бұрын
Hi Umesh, I will be uploading full code once the whole series is complete. Thanks, Manish
@amitwaltzer3 жыл бұрын
Hello Sir, i didn't quite understand how u can chain the "find_elements" after the "wait.until", can you explain what does wait.until return (was sure it was an element)
@NicolasChanCSY2 жыл бұрын
According to the API reference [1], `.until(...)` would return the returned value from the last method call in it. And many expected conditions in Selenium library returns the webelement if the target element is found and passes the checking condition, otherwise returns False [2]. For example, `element_to_be_clickable`, `visibility_of`, `presence_of_all_elements_located`, to name but a few. Hence, he can chain the method calls in the video. [1] www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.wait.html#selenium.webdriver.support.wait.WebDriverWait.until [2] www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.expected_conditions.html
@KaranRaj-bm4xl2 жыл бұрын
what if it takes more than 10 secs sir?
@thoufeequeabdulrahmanrafiq44382 жыл бұрын
it will fail. increase the wait time in that case.