java - How to search for findElementBy.id in selenium webdriver -
i'm starting selenium webdriver. trying make simple example , button next on web: www.lot.com/pl/en.
webdriver driver = new firefoxdriver(); string web = "https://www.lot.com/pl/en/"; driver.get(web); try{ driver.findelement(by.id("submit-booker") ); system.out.println("found"); }catch (exception e){ system.out.println("not found"); e.printstacktrace(); } but i'm not able work fine , gives me following error:
org.openqa.selenium.nosuchelementexception: unable locate element: #submit-booker
what doing wrong? how can fix it?
as trying click() on next button have span tag can consider construct unique xpath follows:
driver.findelement(by.xpath("//button[@id='submit-booker']/span") ); wiki
Comments
Post a Comment