java - Wait in background while webdriver work -
i have problem selenium webdriver fact want run wait error's message in background, while test page, should not affect total test's time
for example tried:
private void checkheadererror(){ string errfieldxpath = "path"; scheduledexecutorservice executor=executors.newscheduledthreadpool(1); runnable task = () -> { try { new webdriverwait(getwebdriver(), 0).until( expectedconditions.invisibilityofelementlocated(by.xpath(errfieldxpath))); } catch (exception e) { string errmsg = getwebdriver().findelement(by.xpath(errfieldxpath)).gettext(); assert.fail(errmsg)); } }; executor.schedulewithfixeddelay(task, 0, 4, timeunit.seconds); }
but doesn't work honestly, not know put works
Comments
Post a Comment