Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Webdriverwait in get_url with some trying. #1363

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions tir/technologies/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,15 +1170,17 @@ def get_url(self, url=None):

url = self.config.url if not url else url

endtime = time.time() + self.config.time_out
while (time.time() < endtime and not get_url):

logger().debug('Get URL')
num_of_trying = 1
while not get_url and num_of_trying <= 5:
self.driver.get(url)
try:
self.driver.get(url)
WebDriverWait(self.driver, int(self.config.time_out / num_of_trying)).until(EC.presence_of_element_located((By.ID, 'fieldsetStartProg')))
logger().info("Page is ready!")
get_url = True
break
except:
get_url = False
num_of_trying += 1
logger().info(f"Loading took too much time! num_of_trying: {str(num_of_trying)}")

def TearDown(self):
"""
Expand Down