java - configuration faliure after replaceing chrome driver -
i m working on automation using selenium webdriver. chrome driver got crashed when run test. remove chromedriver.exe , download latest 1 , replace on target folder , driver folder. rebuild project , ran again.project building without errors. chrome not open. throws error follws :
failed configuration: @beforemethod openbrowser([ljava.lang.object;@15bbf42f) java.lang.nosuchmethoderror: org.slf4j.impl.staticloggerbinder.getsingleton()lorg/slf4j/impl/staticloggerbinder;
couldn't figure out error. appreciate support.
find before class code :
@beforemethod public void openbrowser(object[] testargs) throws exception { try { loginstruction("log instruction: open browser"); string datetime; file downloaddir; date date; dateformat dateformat; string dateexe = getdate(); writetooutput("==================="); writetooutput(dateexe); switch (browser) { case firefox: firefoxprofile profile = new firefoxprofile(); profile.setpreference( "capability.policy.default.window.queryinterface", "allaccess"); profile.setpreference( "capability.policy.default.window.frameelement.get", "allaccess"); profile.setpreference("browser.download.folderlist", 2); profile.setpreference("browser.download.manager.showwhenstarting", false); profile.setpreference("browser.download.manager.showalertoncomplete", false); profile.setpreference("browser.helperapps.neverask.savetodisk", "image/jpeg�"); //profile.setpreference("browser.download.dir", downloadpath); uidriver = new defaultuidriver(profile); break; case chrome: chromeoptions options = new chromeoptions(); options.addarguments("start-maximized"); options.addarguments("test-type"); options.addarguments("disable-extensions"); field f = options.getclass().getdeclaredfield("experimentaloptions"); f.setaccessible(true); map<string, object> expopts = (map<string, object>) f.get(options); expopts.put("prefs", settings); desiredcapabilities capabilities = desiredcapabilities.chrome(); capabilities.setcapability(chromeoptions.capability, options); uidriver = new defaultuidriver(capabilities); // downloadpath = "/automationchromedownloads/" + datetime; break; case internetexplorer: downloadpath = config.getvalue("defaultdownloadpath_ie"); uidriver = new defaultuidriver(browser.internetexplorer); break; } uidriver.manage().deleteallcookies(); starturl = (string) testargs[1]; uidriver.get(starturl); uidriver.manage().window().maximize(); } catch (exception e) { throw new exception(e.getmessage()); } }
Comments
Post a Comment