add wait time for page

This commit is contained in:
2022-04-10 20:43:03 +02:00
parent bedb3e58ca
commit 30b854255e
2 changed files with 8 additions and 5 deletions
+4 -1
View File
@@ -174,7 +174,10 @@ class CommandorPage:
def clickOnValidBtn(self): def clickOnValidBtn(self):
# self.page.mouse.wheel(0, random.randint(400, 500)) # self.page.mouse.wheel(0, random.randint(400, 500))
time.sleep(get_random_wait_time()) time.sleep(get_random_wait_time())
self.page.evaluate("""document.getElementsByClassName("btn")[0].click();""") self.page.evaluate("""document.getElementsByClassName("btn")[0].focus();""")
time.sleep(get_random_wait_time())
self.page.evaluate("""
document.getElementsByClassName("btn")[0].click();""")
def clear_app_data(self): def clear_app_data(self):
pass pass
+3 -3
View File
@@ -13,7 +13,7 @@ from params import MODEM_POOL_PORTS, CARD_POOL_PORT
from pojo.serial_modem import SerialModem from pojo.serial_modem import SerialModem
from utils.excel_reader import ExcelHelper from utils.excel_reader import ExcelHelper
OTP_TIMEOUT = 40 OTP_TIMEOUT = 60
thread_event = None thread_event = None
current_gsm_modem = None current_gsm_modem = None
card_pool = CardPool(CARD_POOL_PORT) card_pool = CardPool(CARD_POOL_PORT)
@@ -109,8 +109,8 @@ def start_waiting_sms():
modem.phone_number = contact[0].phone modem.phone_number = contact[0].phone
modem.contact = contact[0] modem.contact = contact[0]
start_to_handle_sms(modem) start_to_handle_sms(modem)
# else: else:
# print("not found, skip") print("contact not found, skip")
except Exception as error: except Exception as error:
print(error) print(error)
continue continue