I have the following WebElement
which can locate using xpath
:
/html/body/div/div/div/div[2]/div[1]/div[4]/div/div/div[335]/div[1]/span
In the above locator, div[335]
number randomly changes. I want to use regex and use the xpath
as element locator.
Can anyone please let me know the regular expression to use with the above xpath
?
I'm using Selenium Webdriver with Java. IDE is Intellij and I'm testing on Chrome browser.
I'm going to use the above mentioned xpath
as below:
@FindBy(how = How.XPATH, using =/html/body/div/div/div/div[2]/div[1]/div[4]/div/div/div[335]/div[1]/span
public WebElement totalSuppliers;