I want to login using a Keyword like this:
WebUI.openBrowser('<URL>')
CustomKeywords.'methods.QAfunc.login'(driver, email, password)
WebUI.closeBrowser()
Inside the login keyword I will fill in the credentials something like this:
@Keyword
public static void login(WebDriver driver, String email, String password){
//Insert user email
driver.sendKeys('testObject', <EMAIL>);
//Insert user password
driver.sendKeys('testObject', <PASSWORD>);
//Click 'login'
driver.click('testObject');
}
Is there a way to do that?