java - Unable to Get XPath for WhitePages.com? -


i trying enter name , zip code in "people" , "where" fields on http://whitepages.com using selenium (in java).

i have tried using .//*[@id='who'] , .//*[@id='where'] respectively - selenium throws error each time run program.

what doing wrong?

the key problem here there multiple elements id="who". use css selector locate desired 1 inside "search" form:

driver.findelement(by.cssselector("div.callerid-skin #header form[role=search] #who")); 

you may need explicitly wait field become visible:

webdriverwait wait = new webdriverwait(driver, 5); webelement element = wait.until(expectedconditions.visibilityofelementlocated(by.cssselector("div.callerid-skin #header form[role=search] #who"))); 

Popular posts from this blog