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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -