How to use switch_to_previous_tab method in Selene

Best Python code snippet using selene_python

member_check.py

Source:member_check.py Github

copy

Full Screen

...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('================================================================')...

Full Screen

Full Screen

app.py

Source:app.py Github

copy

Full Screen

...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)...

Full Screen

Full Screen

chrome.py

Source:chrome.py Github

copy

Full Screen

...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()...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Selene automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful