2021年4月30日星期五

Long time click operation

I am trying to write a python script for automation of smoke test of a web application. I am entering login credentials username and password and clicking on Login button using python selenium libraries. But the login operation after clicking login button is taking long time. I want to cancel login operation after 30 seconds wait. Can some one help me in that operation. Sample code is the below one.

try:    driver.find_element_by_id("username").send_keys("username")    driver.find_element_by_name("password").send_keys("password")    driver.find_element_by_id("LoginID").click()        except NoSuchElementException as exception:     if "LoginID" in str(exception):   print("Login button not clicked")  
https://stackoverflow.com/questions/67333008/long-time-click-operation April 30, 2021 at 07:20PM

没有评论:

发表评论