Home > Software engineering >  Click() event not working over a button (XPATH)
Click() event not working over a button (XPATH)

Time:06-30

I'm trying to get a Click() event on this button (called: Add PRODUCT) but it is not working, working on a JAVA automation.

image

I'm getting this XPATH:

//*[@id="order-items"]/divIMAGE

I got this:

xpath: //*[@id="order-items"]/divIMAGE

I got this:

xpath: //*[@id="add_products"]

CodePudding user response:

first, .click() will only work on html active tags. second, focus directly on the button.

driver.findElement(By.xpath("*//button[@id='add_products']").click();
  • Related