Skip to main content
2 of 2
deleted 1 character in body
PDHide
  • 11.1k
  • 2
  • 16
  • 43

You should be clicking the Button tag and not the span tag, please use the below locator:

WebElement submit = driver.findElement(By.xpath("//span[contains(text(),'Submit')]/..")
PDHide
  • 11.1k
  • 2
  • 16
  • 43