Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Navigator()
- {
- String username;
- String password;
- //constructor
- navigator(String uname, String pwd)
- {
- username=uname;
- password=pwd;
- @test
- login
- {
- System.out.println("Inside login");
- System.out.println(username);
- System.out.println(password);
- driver.findElement(username).sendKeys(username);
- driver.findElement(username).sendKeys(username);
- driver.findElement(login).click();
- }
- @test(dependsonMethods="login", invocationCount=10)
- navigation()
- {
- //navigate to a particular webpage and perform actions there
- }
- @test(dependsonMethods="navigation")
- logout()
- {
- //logout of the page
- }
- class GetUser extends Navigator
- {
- String username, password;
- //constructor
- @factory(dataprovider="userdetail")
- GetUser(String uname, String passwd)
- {
- super(uname,pwd);
- }
- @DataProvider
- object [][] userdetail()
- {
- //code to find number of users specified in an excel sheet something like below where
- detail[0][0]=username from excel sheet
- detail[0][1]=password from excel sheet
- .
- .
- .
- .
- then return detail[no.of users][2];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement