I believe I have the same logic in Python and Java, with the same xpath to a button (picture below).
Python code:
button = driver.find_element(By.XPATH, "//*[@id='tool_form']/div/div[1]/div/button")
button.click()
Java code:
WebElement button = driver.findElement(By.xpath("//*[@id='tool_form']/div/div[1]/div/button"));
button.click();
The button gets clicked using my Python code, but not my Java code. What could I be doing wrong?