[Solved] error“:“element click intercepted“,“message“:“element click intercepted“

Error reporting: Selenium project can run locally, and there is no graphical use case execution error on Jenkins deployed in CentOS virtual machine: element click intercepted

Troubleshooting ① first check whether the browser and driver versions match

Browser driver download address: http://chromedriver.storage.googleapis.com/index.html

Troubleshooting ② check whether there are chrome processes that have not been closed. If there are, you need to kill them in batches

 kill -9  $(pgrep chrome) 

Troubleshooting ③ if the driver version matches, report and correct the error. Add the following code, with the focus on adding window size

chrome_options = Options()
chrome_options.add_argument('--headless')     # To open the browser, comment out the line of code
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument("--window-size=1920,1080")  # Error reported when adapting jenkins build{"error":"element not interactable"}
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(chrome_options=chrome_options)

Build successful

Read More: