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