java - PhantomJS - Element is not currently interactable -
i'm using phantomjs + selenium populate form fields having weird results. 50% of time, test runs fine. other 50% errors out , gives me following
{"errormessage":"element not interactable , may not manipulated"
i'm doing following make sure page loaded.
private static boolean waitforjqueryprocessing(webdriver driver, int timeoutinseconds) { boolean jqcondition = false; try { new webdriverwait(driver, timeoutinseconds) { }.until(new expectedcondition<boolean>() { @override public boolean apply(webdriver driverobject) { return (boolean) ((javascriptexecutor) driverobject) .executescript("return jquery.active == 0"); } }); jqcondition = (boolean) ((javascriptexecutor) driver) .executescript("return window.jquery != undefined && jquery.active === 0"); return jqcondition; } catch (exception e) { logger.debug(e.getmessage()); } return jqcondition; }
and interact element(s):
pagewait.until(expectedconditions.presenceofelementlocated(by .cssselector("#myform-searchdate"))); driver.findelement( by.cssselector("#myform-searchdate")) .sendkeys(keys.control + "a"); driver.findelement( by.cssselector("#myform-searchdate")) .sendkeys(keys.delete); driver.findelement( by.cssselector("#myform-searchdate")) .sendkeys(my_test_date);
i see if failed time, doesn't fail time it's hard repeat results when debugging.
edit 1. i've tried swapping following comment below; however, doesn't work. i've since come realize seems happen when fire several (5+) instances of phantomjs @ once.
Comments
Post a Comment