Skip to content Skip to sidebar Skip to footer

How To Click On Gwt Enabled Elements Using Selenium And Python

I'm working with Selenium as a newbie and also as a newbie developer. I try to solve this XPath but with no results that is why I'm looking for help. So I want to click in the chec

Solution 1:

The desired element is a GWT enabled element so to click on the element you have to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following based Locator Strategy:

  • Using xpath based on title attribute:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@title='Viewers']//preceding::span[1]//label"))).click()
    
  • Using xpath based on innerHTML:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[text()='Viewers']//preceding::span[1]//label"))).click()
    
  • Note : You have to add the following imports :

    from selenium.webdriver.support.uiimportWebDriverWaitfrom selenium.webdriver.common.byimportByfrom selenium.webdriver.supportimport expected_conditions asEC

Post a Comment for "How To Click On Gwt Enabled Elements Using Selenium And Python"