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

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -