Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

selenium if statement python

try:
    elem = driver.find_element_by_partial_link_text('Create Activity')
    if elem.is_displayed():
        elem.click() # this will click the element if it is there
        print("FOUND THE LINK CREATE ACTIVITY! and Clicked it!")
except NoSuchElementException:
    print("...")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #selenium #statement #python
ADD COMMENT
Topic
Name
7+3 =