forked from CourseRepository/SeleniumWebdriverWithJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestClass.java
More file actions
63 lines (49 loc) · 1.8 KB
/
TestClass.java
File metadata and controls
63 lines (49 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package testcase;
import helper.ButtonHelper;
import helper.DataProviderClass;
import helper.GenericHelper;
import helper.LinkHelper;
import helper.ReadExcelFile;
import helper.StartWebDriver;
import helper.TextBoxHelper;
import helper.WindowHelper;
import java.util.Map;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
/**
* @author - rahul.rathore
* @date - 16-Nov-2014
* @project - Webdriver
* @package - testcase
* @file name - TestClass.java
*/
public class TestClass extends StartWebDriver{
//private ArrayList<String> status = new ArrayList<String>();
int rowIndex = 1;
@Test(dataProvider="testValidLogin",dataProviderClass=DataProviderClass.class)
public void testCase(Map<String, Object> data) throws Exception {
System.out.println("Method Called");
LinkHelper.clickLink("File a Bug");
TextBoxHelper.typeInTextBox("Bugzilla_login", data.get("UserName").toString());
TextBoxHelper.typeInTextBox("Bugzilla_password", data.get("Password").toString());
ButtonHelper.clickButton("log_in");
if(GenericHelper.isElementPresent("error_msg"))
ReadExcelFile.UpdateToExcel(3, rowIndex++, "TestLogin.xlsx", "LoginDetails", "Fail");
else
ReadExcelFile.UpdateToExcel(3, rowIndex++, "TestLogin.xlsx", "LoginDetails", "Pass");
/*if(data.get("Valid").toString().equalsIgnoreCase("no")){
Assert.assertTrue(GenericHelper.isElementPresent("error_msg"));
status.add("Fail");
}else
status.add("Pass");*/
//ButtonHelper.clickButton("//div[@id='header']//ul[@class='links']/li[1]//a");
home_link.click();
ButtonHelper.clickLogout();
}
/*@AfterClass(alwaysRun=true)
public void writeToExcel() {
WindowHelper.refresh();
System.out.println("=============== Logout Called ========== " + this.getClass().getName());
ButtonHelper.clickLogout();
}*/
}