Category: selenium

selenium 0

Automate chrome apps

Chrome apps writ­ten using web­view are dif­fer­ent than iFrames because web­view is a sep­a­rate process. With Sele­nium 2.20 it is pos­si­ble to auto­mate chrome apps writ­ten using web­view. dri­ver = webdriver.Chrome(desired_capabilities={‘chromeOptions’:{‘windowTypes’:[’webview’]}}) driver.get(‘chrome://apps’) wait_for_new_window_to_appear() driver.switch_to.window(driver.window_handles[1])…

selenium 0

Selenium and xpath — locate an element using class attribute

Issue : Locate the fol­low­ing ele­ment using its Class. <div class=“globalContainer”> <div> … </div> </div> Res­o­lu­tion : You can write the fol­low­ing query in the browser con­sole. $x(//div[@class=“globalContainer”]) Fur­ther Read­ing xPath loca­tor Prac­ti­cal Examples

selenium 0

Selenium and xpath — locate an element using id attribute

Issue : Locate the fol­low­ing ele­ment using its ID. <div id=“globalContainer”> <div> … </div> </div> Res­o­lu­tion : You can write the fol­low­ing query in the browser con­sole. $x(//div[@id=“globalContainer”]) Fur­ther Read­ing xPath loca­tor Prac­ti­cal Examples