This is a Selenium Hybrid Framework.
- Written in JAVA
- Implemented using TestNG
- Build Toold - Maven
- Implemented Page Object Model Design Pattern
- Excel TestNG @DataProvider
- Video Recording - Automation-Remarks
- Ashot - To Capture Full Page Screenshot
- Mozilla Firefox
- Google Chrome
- Internet Explorer
- Opera
- Microsoft Edge
- HTMLUnit
- Chrome Headless
- Windows
- Linux
- Macintosh
$ git clone https://github.com/GladsonAntony/WebAutomation_Extent.git
$ mvn clean test
- Navigate to WebAutomation\src\main\resources change BrowserType in the ApplicationConfig.properties or use Maven to invoke different browsers
$ mvn clean test -DBrowserType=Chrome #Chrome
$ mvn clean test -DBrowserType=Chrome_Headless #Chrome Headless
$ mvn clean test -DBrowserType=Firefox #Mozilla Firefox
$ mvn clean test -DBrowserType=IE #Internet Explorer
$ mvn clean test -DBrowserType=Edge #Microsoft Edge
$ mvn clean test -DBrowserType=Edge_Headless #Microsoft Edge Headless
Report Location System.getProperty("user.dir") + "/src/test/resources/Reports/";
Failed Screenshots System.getProperty("user.dir") + "/src/test/resources/Reports/Images";
Video Location System.getProperty("user.dir") + "/src/test/resources/Reports/Videos";
Method 1:
- Use TestData.xlsx file as your dataproviders. The Sheet Name should be the name of your Method Name.
- To use different xlsx file, Create a new
@DataProvider
method and change the workbook name.
@DataProvider(name="multiSheetExcelRead", parallel=true)
public static Object[][] multiSheetExcelRead(Method method) throws Exception
{
File file = new File("./src/test/resources/Excel Files/TestData.xlsx");
String SheetName = method.getName();
System.out.println(SheetName);
Object testObjArray[][] = ExcelUtils.getTableArray(file.getAbsolutePath(), SheetName);
return testObjArray;
}
Method 2:
- Create Excel Workbook with the same name as your method Name.
@DataProvider(name="excelSheetNameAsMethodName",parallel=true)
public static Object[][] excelSheetNameAsMethodName(Method method) throws Exception
{
File file = new File("./src/test/resources/Excel Files/"+method.getName()+".xlsx");
Object testObjArray[][] = ExcelUtils.getTableArray(file.getAbsolutePath());
return testObjArray;
}
To Use Method Name as Excel Workbook Name, Use the following:
@Test(dataProvider="excelSheetNameAsMethodName", dataProviderClass=ExcelDataProvider.class)
To use a Single Workbook with multiple @DataProvider
sheets, Use:
NOTE: SheetName should be same name as Method Name
@Test(dataProvider="multiSheetExcelRead", dataProviderClass=ExcelDataProvider.class)
enabledALL -> To Save recorded video for All test case. Stored in
"./src/test/resources/Reports/Videos"
enabledFAILED -> To Save recorded video for ONLY FAILED test case. Stored in
"./src/test/resources/Reports/Videos"
disabled -> To not save the video