1

I am trying to click button(name command page) on web page but i am unable to do so. i am using selenium with python

code:

wait= WebDriverWait(driver,20)
command_page = wait.until(EC.element_to_be_clickable((By.ID,"Button_ID")))
command_page.click()

I have tried by class name also but i am unable to click the element. Please help me on this.

2
  • are you getting any exception? Commented Apr 2, 2020 at 6:27
  • I am not getting any exception Commented Apr 2, 2020 at 6:51

3 Answers 3

1

As an alternative you can use JavascriptExecutor to perfrom click on certain element if Selenium click() method doesn't trigger the action without any Exception.

element = driver.find_element_by_id("etoolbar_toolbarSection_newcommandpagebtn_id")
driver.execute_script("arguments[0].click();", element)
Sign up to request clarification or add additional context in comments.

1 Comment

@PRAYANK, Glad to hear!!! Please accept the answer by click on tick mark below the vote count on answer. So it can be helpful for others. Thanks
1

Please try below solution :

WebDriverWait(driver, 20)
both_button=wait.until(EC.element_to_be_clickable((By.XPATH, "//*[contains(text(), 'Command Page')]")))
both_button.click()

Comments

0

I tried this, seems to be working

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("file://c:/cygwin64/home/das2/abcd.html")
element = driver.find_element_by_id("etoolbar_toolbarSection_newcommandpagebtn_id")
element.click()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.