Weird Python Selenium Button Click Behaviour
The part I'm trying to click:
-
Solution 1:
Try this xpath (updated with code block SO site removed my *)
//*[contains(concat(' ', @class, ' '), ' btns right ')]//*[contains(concat(' ', @class, ' '), ' expand-all ') and contains(text(), 'View All Cards')]
Provide some wait for the element to be clickable(implicit is recommended).
I have Used Only for java , But I refered here for python here it may help!!
from selenium.webdriver.support import expected_conditions as EC wait = WebDriverWait(driver, 10) button = wait.until(EC.element_to_be_clickable((By.XPATH,'//*[contains(concat(' ', @class, ' '), ' btns right ')]//*[contains(concat(' ', @class, ' '), ' expand-all ') and contains(text(), 'View All Cards')]'))) button.click() Even if the above thing fails, try this
form these links link1 and link2
driver.execute_script("document.getElementsByClassName('expand-all')[0].click();")
inject an artificial CLICK on the desired element, remove(comment) all other codes
May be ur app falls under link2 OP :)
Post a Comment for "Weird Python Selenium Button Click Behaviour"