Last active
July 18, 2024 10:50
-
-
Save SarahElson/e1b6f8b2a708225ea929e7e4281eb2f9 to your computer and use it in GitHub Desktop.
What Is the Single Responsibility Principle (SRP)?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lambdatest.pages; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.By; | |
public class LoginPage{ | |
WebDriver driver; | |
public LoginPage(WebDriver driver) { | |
this.driver = driver; | |
} | |
By enterEmailId = By.xpath("//input[@id='input-email']"); | |
By enterPassword = By.xpath("//input[@id='input-password']"); | |
By clickOnLogin = By.xpath("//input[@value='Login']"); | |
public void enterEmailId(String email) { | |
driver.findElement(enterEmailId).sendKeys(email); | |
} | |
public void enterPassword(String password) { | |
driver.findElement(enterPassword).sendKeys(password); | |
} | |
public void clickOnLogin() { | |
driver.findElement(clickOnLogin).click(); | |
} | |
public void goToURL(){ | |
driver.get("https://ecommerce-playground.lambdatest.io/"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment