Skip to content
Snippets Groups Projects
Commit 1e19b042 authored by Recolic Keghart's avatar Recolic Keghart
Browse files

Add another wait, to fetch correct result

parent b10ca34a
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ def wait_for_element_txt(element_txt):
print('.', end='', flush=True)
time.sleep(0.2)
print()
def wait_for_element_class(element_class_name):
print('Waiting for loading.', end='', flush=True)
while driver.find_elements_by_class_name(element_class_name) == []:
......@@ -53,7 +54,9 @@ wait_for_element_class('dialog_button')
driver.find_element_by_class_name('dialog_button').click() # first one is 'Ok', second one is 'Cancel'.
wait_for_element_class('dialog_content')
while 'If you have anything to comment,please click here, or you can add reviews in the form.' == driver.find_element_by_class_name('dialog_content').text:
while 'If you have anything to comment' in driver.find_element_by_class_name('dialog_content').text:
wait_for_element_class('dialog_content')
while '' == driver.find_element_by_class_name('dialog_content').text:
wait_for_element_class('dialog_content')
result = driver.find_element_by_class_name('dialog_content').text
print(result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment