Best Python code snippet using selene_python
member_check.py
Source:member_check.py
...28 search_name = dfx("//div[@class='member-info__value member-info__name']").text29 driver.assert_exist("//div[@class='member-info__value member-info__name']","xpath","ä¸ãç²åæå¡è³è¨ä»¥ä¾æå° : %s" % search_name)30 sleep(2)31 work_progress += 2032 driver.switch_to_previous_tab()33 dfx("//div[@class='el-select el-select--small']").click()34 dfx("//div[@class='el-scrollbar']//span[contains(text(),'å§å')]").click()35 dfx("//div[@class='el-input el-input--small el-input--prefix']//input").send_keys(search_name)36 dfx("//div[@class='el-form-item__content']//span[contains(text(),'æ¥è©¢')]").click()37 driver.switch_to_new_tab()38 ser.check_loading(driver)39 driver.close()40 work_progress += 2041 driver.switch_to_previous_tab()42 WebDriverWait(driver,30).until(lambda driver:dfx("//div[@class='vxe-table--fixed-left-wrapper']")) 43 driver.assert_exist("//div[@class='vxe-table--fixed-left-wrapper']", "xpath", "äºãæå°åè½æ£å¸¸")44 work_progress += 2045 # element = dfx("(//td[contains(.,'æ¥ç')])[1]")46 # ActionChains(driver).move_to_element(element).click().perform()47 driver.execute_script("document.getElementsByClassName('el-link--underline el-link el-link--primary is-underline')[0].click()")48 driver.switch_to_new_tab()49 ser.check_loading(driver)50 sleep(2)51 # WebDriverWait(driver,30).until_not(lambda driver: driver.execute_script('return obj.loading.info = false') )52 driver.switch_to_previous_tab()53 work_progress += 2054 except TimeoutException :55 ser.find_JSerror(driver)56 driver.assert_template(Template(r"tpl1596791134459.png", threshold=0.39999999999999986, record_pos=(28.205, 4.095), resolution=(100, 100)), "è³æè¼å
¥ä¸")57 sleep(10)58 driver.assert_template(Template(r"tpl1596791134459.png", threshold=0.39999999999999986, record_pos=(28.205, 4.095), resolution=(100, 100)), "è³æè¼å
¥å¤±æ")59 except AssertionError as e:60 ser.find_JSerror(driver)61 driver.assert_template(Template(r"tpl1594883068901.png", threshold=0.49999999999999983, record_pos=(28.295, 4.055), resolution=(100, 100)), "è«è¼¸å
¥æ£ç¢ºè³è¨æç¡æ¤æå¡è³è¨")62 except Exception as e:63 ser.find_JSerror(driver)64 print('================================================================')65 print(ser._error_msg(e))66 print('================================================================')...
app.py
Source:app.py
...14 self.browser.open("chrome-extension://mopnmbcafieddcagagdcbnhejhlodfdd/index.html")15 self.browser.element("button .children").should(be.visible).click()16 self.browser.element(".popupToggle").should(be.visible).click()17 def wait_until_acala_wallet_page_is_loaded(self):18 self.browser.switch_to_previous_tab()19 self.browser.element(".ant-modal").should(be.visible)20 self.browser.element(".aca-btn-style--normal").should(be.visible).click()21 def approve_connection(self):22 self.browser.driver.execute_script("window.open('');")23 self.browser.switch_to_next_tab().open("chrome-extension://mopnmbcafieddcagagdcbnhejhlodfdd/notification.html")24 self.browser.element(".children").should(be.visible).click()25 def open_acala_website(self):26 self.browser.open("https://apps.acala.network")27 self.browser.element(".sc-ezbkgU.gajIi").should(be.visible)28 self.browser.element("#mandala").with_(timeout=10000).should(be.visible)29 def enter_pw_passwords(self):30 polkawallet_password = "iut6&%G^&5H*&^(("31 self.browser.element("input[type='password']").should(be.visible).type(polkawallet_password)32 self.browser.element("input[type='password'][value='']").should(be.visible).type(polkawallet_password)...
chrome.py
Source:chrome.py
...8driver.implicitly_wait(20)9driver.get("https://airlab-gl.163.com/b2b")10driver.maximize_window()11driver.switch_to_new_tab()12driver.switch_to_previous_tab()...
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!!