0

sorry if this is kind of vague I do not know how to explain it well but basically I am trying to run a function which checks if an ID is on a page and I do not know how to do it. Here is my code of what I've attempted so far.

def checkoutpage():
    driver1.find_element_by_id('test')
try:
    if checkoutpage == True:
        print("Working")
    else: 
        print("Not working")
except:
    print("ERROR")

It returns Not working not matter if the ID is on the page or not, help is appreciated.

Ogden
  • 477
  • 1
  • 8
  • 21
  • 1
    Possible duplicate of [Python - Selenium WebDriver - Checking element exists](https://stackoverflow.com/questions/9567069/python-selenium-webdriver-checking-element-exists) – Andersson Apr 23 '18 at 16:42
  • 1
    Another simple example [here](https://stackoverflow.com/questions/45695874/check-if-element-exists-python-selenium?rq=1) – Andersson Apr 23 '18 at 16:43

0 Answers0