I have some problem with Jenkins and selenium. I try to run this code on Jenkins:
from selenium import webdriver
from pyvirtualdisplay import Display
display = Display(visible=0, size=(800,800))
display.start()
browser = webdriver.Chrome('/home/andrey/Downloads/chromedriver')
browser.get('http://www.google.com/')
try:
browser.find_element_by_id('gbw')
print ("Test Pass: ID found")
browser.find_element_by_id('lga')
print ("Test Pass: ID found")
except Exception as e:
print("Exception found",format(e))
So on Jenkins this test pass. But if I do some change in code, Jenkins can't catch exception.