Skip to main content
By.xPathxpath("//button[contains(.,'Add Strategy')]")
By.xPathxpath("//button[contains(.,'Submit')]")

Notice that it is same as -:

By.xPathxpath("//button[contains(text(),'Add Strategy')]")
By.xPathxpath("//button[contains(text(),'Submit')]")
By.xPath("//button[contains(.,'Add Strategy')]")
By.xPath("//button[contains(.,'Submit')]")

Notice that it is same as -

By.xPath("//button[contains(text(),'Add Strategy')]")
By.xPath("//button[contains(text(),'Submit')]")
By.xpath("//button[contains(.,'Add Strategy')]")
By.xpath("//button[contains(.,'Submit')]")

Notice that it is same as:

By.xpath("//button[contains(text(),'Add Strategy')]")
By.xpath("//button[contains(text(),'Submit')]")
Source Link
Tarun
  • 3.4k
  • 2
  • 31
  • 43

By.xPath("//button[contains(.,'Add Strategy')]")
By.xPath("//button[contains(.,'Submit')]")

Notice that it is same as -

By.xPath("//button[contains(text(),'Add Strategy')]")
By.xPath("//button[contains(text(),'Submit')]")