i working on selenium, while running java code tried access text box web page selenium.elementnotvisibleexception: element not visible , may not interacted command duration or timeout error.
html code text field :
<input type="text" name="totaltaxpercent" id="totaltaxpercent" value="19.00" class="smallinputfield rightalign" size="7" onblur="javascript:validatedecimal(this, 5)"> java code access text field :
public void setitemtaxvalue( string value){ //by writabletag = by.name("totaltaxpercent"); writabletag = by.xpath("//a[contains(@title,'override total tax percent')]"); this.sleep(3); if (this.waitforexistence(writabletag,35)) { this.textfieldsettext(writabletag, value); clickonok (); // } else{ jlog.fail("unable find writable item taxdialog!"); } } error tree :
[2015-07-14 20:18:34 pdt] switch frame: <top> [2015-07-14 20:19:22 pdt] setting textfield (by.name: totaltaxpercent) data: 10 [2015-07-14 20:19:24 pdt] screen capture: c:\source\selenium-main\selenium-vodafone\target\capture\screencapture_20150714201922308.jpg [2015-07-14 20:19:24 pdt] fail: org.openqa.selenium.elementnotvisibleexception: element not visible , may not interacted command duration or timeout: 40 milliseconds kindly advise , you
just catch exception:
try { this.textfieldsettext(writabletag, value); } catch (elementnotvisibleexception e) { jlog.fail("unable find writable item taxdialog!"); }
Comments
Post a Comment