On this page "https://www.javatpoint.com/oprweb/test.jsp?filename=htmltable5" the attempt is to pick the first name and the last name if the marks are above 75. Wrote this xpath to find elements which has marks over 75 ".//tbody/tr/td[number(.)>75]" which works in browser but is not found by selenium at runtime. The size of the findElements simply returns 0 and the test fails on putting a wait on condition.
Asked
Active
Viewed 106 times
1 Answers
0
Your xpath
looks correct but web table your trying to interact is in frame
. You first need to switch into that particular frame before interacting with WebElement
inside it.
We can switch into frames using 3 ways.
- By Index
- By Name or Id
- By Web Element
If you search for iframe
in html, you will find out frame as id="iframewrapper"
and use below code to switch into frame:
driver.switchTo().frame("iframewrapper")
For further details on frames in selenium, kindly refer to this SO thread.

Kuldeep Kamune
- 169
- 2
- 10