webdriver warning the server did not provide any stacktrace information -
i have written driver.findelement(by.id("kfidocumentlink")).click();
code clicking on button 'kfi document'.
please find html code.
<a class="button" id="kfidocumentlink" href="/quote/kfidocument/the%20co-operative%20bank%20-%20download%20mortgage%20illustration%20(pdf)%20160808104103" target="_blank">download mortgage illustration (pdf)</a>
when run code, able click on button , unable click button.
could assist on please?
actually time when goes find element, not present on dom
@ time due slow internet or other reason, that's why sometime able click , sometime not.
to overcome issue should try using webdriverwait
expectedconditions.elementtobeclickable
wait before click on element until element visible on dom
, clickable below :-
webdriverwait wait = new webdriverwait(driver, 10); el = wait.until(expectedconditions.elementtobeclickable(by.id("kfidocumentlink"))); el.click();
Comments
Post a Comment