java - Retrieving searched results from table -
how can store searched values table list? unable locate table result.
webelement names = driver.findelement(by.xpath("//*[@id='idnumber']/div[3]/table")); thread.sleep(100000); list<webelement> totalrowcount = names.findelements(by.xpath("//*[@id='idnumber']/div[3]/table/tbody[2]/tr")); system.out.println(totalrowcount);
even basic code, it's giving error it's unable locate element.
first want find element table , want select radiobutton of searched value. please us.
there several problems.
1) first line storing single table
tag in names
third line searching below names
using names.findelements()
second xpath contains xpath first element. unless have nested tables, both same structure issue.
2) why have sleep()
between these lines, let alone such long one? there's no reason it.
3) sysout isn't going print human readable.
try instead:
list<webelement> totalrowcount = driver.findelements(by.xpath("//*[@id='idnumber']/div[3]/table/tbody[2]/tr")); system.out.println(totalrowcount.size());
you should spend time reading java , selenium tutorials. grab book or 2 , read them better understand trying do.
Comments
Post a Comment