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

how to add preprocess loader in webpack 2 -

python - django admin: changing the way a field (w/ relationship to another model) is submitted on a form so that it can be submitted multiple times -

go - serving up pdfs using golang -