I'm trying to get a Click() event on this button (called: Add PRODUCT) but it is not working, working on a JAVA automation.
I'm getting this XPATH:
This is the FULL XPATH:
/html/body/div3/main/div2/div/div/form/div[5]/div/div1/section1/div1/div/button1/span
So, I'm trying to do something like this:
driver.findElement(By.xpath("//*[@id="order-items"]/div[1]/div/button[1]/span")).click();
What am i doing wrong?
EDIT#1:
If i click on "ADD PRODUCT" i got this XPATH:
//*[@id="add_products"]
EDIT #2
I got this:
I got this:
xpath: //*[@id="add_products"]
first, .click() will only work on html active tags. second, focus directly on the button.
driver.findElement(By.xpath("*//button[@id='add_products']").click();