+1 vote
806 views
in Programming by
the number 4 is changing every time ,how to validate dynamically.

1 Answer

0 votes
by Expert (5.9k points)

String strID1 = driver.findElement(By.xpath("Xpath here");
                        String[] parts = strID1.split("/");
                        String part1 = parts[0];

Now you can validate part1, in your case 4/100.

part1 will return 4. I hope you got my point.

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated