java - Exception on running IE web Driver -


i'm new in java, using automatic tests. please me i'm doing wrong code?

public static webdriver driver = null;  public static webdriver getdriver() { if (driver == null) {  file fileie = new file("src//test/java/iedriver.exe");             system.setproperty("webdriver.ie.driver", fileie.getabsolutepath());    } try {  driver = new internetexplorerdriver();     }  catch (exception e)  e.printstacktrace(); } 

try add desiredcapabilities code.

if (driver == null) {      file fileie = new file("src//test/java/iedriver.exe");             system.setproperty("webdriver.ie.driver", fileie.getabsolutepath());                              desiredcapabilities iecapabilities = desiredcapabilities.internetexplorer();              try {                                                        driver = new internetexplorerdriver(iecapabilities);                                                     } catch (exception e) {                                  throw new runtimeexception(e);             }        } 

the desiredcapabilities set properties webdriver. typical usecase set path type of webdriver if local installation doesn't correspond default settings.

you can read class desiredcapabilities , its' using here: desiredcapabilities


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -