kneerace / LearnJavaSelenium

this is for learning Git and Java-Seleinum
1 stars 1 forks source link

Refactor code to access drivers from the project path. #16

Open kneerace opened 5 years ago

kneerace commented 5 years ago

Currently the code looks for particular local path for the driver, Update the code so that, it could be access the driver from common project path.

kneerace commented 5 years ago

This has been done by utilizing "System.getProperty" method as below- in SeleniumDriverCommonStep class under util folder. static String Driverpath = System.getProperty("user.dir")+"\Drivers\";

Please do reference SeleniumDriverCommonStep class to call any driver, utilizing the method selectedDriver. selectedDriver takes one argument and in String format. public WebDriver selectedDriver(String browser){ .....}; the above method has case, switch statement and corresponds the value as below:

  1. IE = internet explorer
  2. Chrome = Google Chrome
  3. Firefox = Mozilla Firefox

NOTE:- do mind the case when feeding argument to SelectedDriver method.

kneerace commented 5 years ago

Besides, Driver folder has been created which included drivers for IE, Chrome and firefox. if needed do add other driver in this folder, and add those in the selectedDriver method