Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class pojDataSource {
- private static WebElement element = null;
- private static List<WebElement> elements = null;
- public static WebElement txt_UserName(WebDriver driver){
- driver.findElement(By.id("txtUserName")).clear();
- element = driver.findElement(By.id("txtUserName"));
- return element;
- }
- public static WebElement txt_Password(WebDriver driver){
- driver.findElement(By.id("txtPassword")).clear();
- element = driver.findElement(By.id("txtPassword"));
- return element;
- }
- }
- public class clsConstant {
- public static final String URL = "http://localhost:1234/";
- public static final String Username = "username";
- public static final String Password = "password";
- }
- public class ModuleTest {
- public RemoteWebDriver mDriver = null;
- public DesiredCapabilities mCapability = new DesiredCapabilities() ;
- public WebElement mWebElement = null;
- public String mBaseURL = clsConstant.URL;
- public static clsExcelSampleData mAddConnectorXls;
- @Test
- public void beforeMethod() throws Exception {
- WebDriverWait wdw =null;
- mCapability.setCapability("platform", org.openqa.selenium.Platform.WINDOWS);
- mCapability = DesiredCapabilities.firefox();
- mCapability.setVersion("45.0.2");
- mDriver = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub/"), mCapability);
- mDriver.get(mBaseURL);
- mDriver.manage().window().maximize();
- pojDataSource.txt_UserName(mDriver).sendKeys(clsConstant.Username ) ;
- pojDataSource.txt_Password(mDriver).sendKeys(clsConstant.Password ) ;
- pojDataSource.btn_LogIn(mDriver).click();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement