Tuesday, February 12, 2019

py0007 : Click on div ul li span class "Display Name" Selenium Python

Being a startup its difficult to work around, but struggle of 2 days i was able to click on element having flow like div/ul/li/span/class.

Searched lot on google most of examples are with ID, but in my case id was not defined so i tried many time with class name and Display name with possible probability. At last able to Click.

Solution:
Add below lines in your code
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[text()='DisplayName']"))).click()



No comments:

Post a Comment

web stats