Best Python code snippet using avocado_python
account_balance_page.py
Source:account_balance_page.py
1from selenium import webdriver2import time3class AccountBalancePage(object):4 def __init__(self,driver):5 self.driver = webdriver.Chrome()6 # self.driver = driver7 # è·å¾row_numè¡æ¬¡ï¼xpath tr_num 8 def get_row_tr_num(self,asset_name):9 if asset_name == 'è´§å¸èµé':10 return row_num = 1,tr_num = 211 elif asset_name == 'çææèµ' :12 return row_num = 2,tr_num = 3 13 elif asset_name == 'åºæ¶ç¥¨æ®':14 return row_num = 3,tr_num = 415 elif asset_name == 'åºæ¶è´¦æ¬¾':16 return row_num = 4,tr_num = 517 elif asset_name == 'é¢ä»æ¬¾é¡¹:18 return row_num = 5 ,tr_num = 619 elif asset_name == 'åºæ¶è¡å©':20 return row_num = 6, tr_num = 721 elif asset_name == 'åºæ¶å©æ¯':22 return row_num = 7, tr_num = 823 elif asset_name == 'å
¶ä»åºæ¶æ¬¾':24 return row_num = 8, tr_num = 925 elif asset_name == 'åè´§':26 return row_num = 9,tr_num = 1027 elif asset_name == 'å
¶ä¸ï¼åææ':28 return row_num = 10,tr_num = 1129 elif asset_name == 'å¨äº§å':30 return row_num = 11, tr_num = 1231 elif asset_name == 'åºååå':32 return row_num = 12,tr_num = 1333 elif asset_name == 'å¨è½¬ææ':34 return row_num = 13,tr_num = 14 35 elif asset_name == 'å
¶ä»æµå¨èµäº§':36 return row_num = 14,tr_num = 1537 elif asset_name == 'æµå¨èµäº§å计':38 return row_num = 15,tr_num = 1639 elif asset_name == 'é¿æåºå¸æèµ':40 return row_num = 16,tr_num = 1841 elif asset_name == 'é¿æè¡ææèµ':42 return row_num = 17,tr_num = 1943 elif asset_name == 'åºå®èµäº§åä»·':44 return row_num = 18,tr_num = 2045 elif asset_name == 'åï¼ç´¯ç§¯ææ§':46 return row_num = 19,tr_num = 2147 elif asset_name == 'åºå®èµäº§å¸é¢ä»·å¼':48 return row_num = 20,tr_num = 2249 elif asset_name == 'å¨å»ºå·¥ç¨':50 return row_num = 21,tr_num = 2351 elif asset_name == 'å·¥ç¨ç©èµ':52 return row_num = 22,tr_num = 2453 elif asset_name == 'åºå®èµäº§æ¸
ç':54 return row_num = 23,tr_num = 2555 elif asset_name == 'ç产æ§çç©èµäº§':56 return row_num = 24,tr_num = 2657 elif asset_name == 'æ å½¢èµäº§':58 return row_num = 25,tr_num = 2759 elif asset_name == 'å¼åæ¯åº':60 return row_num = 26,tr_num = 2861 elif asset_name == 'é¿æå¾
æè´¹ç¨':62 return row_num = 27,tr_num = 2963 elif asset_name == 'å
¶ä»éæµå¨èµäº§':64 return row_num = 28,tr_num = 3065 elif asset_name == 'éæµå¨èµäº§å计':66 return row_num = 29,tr_num = 3167 elif asset_name == 'èµäº§å计':...
assets.py
Source:assets.py
1import os23def _asset(asset_name: str, pardir:str="", relative:bool=False) -> str:4 if pardir:5 asset_name = f"{pardir}/{asset_name}"67 asset_name = f"assets/{asset_name}"89 if relative:10 asset_name = os.path.abspath(asset_name)1112 return asset_name1314def construct_background_filename(colour: str, w: int, h: int, relative:bool=False):15 return _asset("{}x{}-{}-solid-color-background.jpg".format \16 (w, h, "-".join(colour.strip().split())),pardir="backgrounds", relative=relative)1718class Assets:1920 image_icon = _asset("image.png")21 logo = _asset("logo.png")
...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!