I have this code and how to loop if load timeout it will return except and it run next test case
def search_action(self, xpath, value):
try:
self.driver.set_page_load_timeout(1)
element = self.driver.find_element(By.XPATH, xpath)
element.send_keys(value)
element.send_keys(Keys.ENTER)
except TimeoutException as e:
print('EXCEPT', e)
pass
print('success')
se = class_name()
for domain in config['list_domain']:
se.get_domain(domain)
for i in range(1, 100):
xpath = config[domain]['list_test']['search']
se.search_action(xpath, i)
se.get_domain(domain)
return:
selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 0.319
I want loop from 1 to 100 i don't want return error