Я не получаю никакой ошибки в файле журнала для решения проблемы. код вводится в homepage.java и начинается с метода login, однако txtusername не заполняется значениями. хорошо работает в затмении. это происходит при выполнении из командной строки
D:\Workspaces\test> java -cp
"D:\Workspaces\test\bin;D:\Workspaces\test\lib\*;C:\Users\me\plugins\*"
org.testng.TestNG D:\Workspaces\test\testng1.xml
public class TestMain extends DriverInstance {
HomePage homePage;
WebDriver driver;
@BeforeMethod
public void launchAppication() {
driver = launchBrowser();
launchURL();
homePage = PageFactory.initElements(driver, HomePage.class);
}
@Test(groups = { "functest", "Login" }, testName = "RTSFS-21: Verify Login with Correct username and correct Password", priority = 1)
public void verifyLogin_CorrectLoginCredentials() {
try {
System.out.println("hello this is test method after try block");
//Thread.sleep(5000);
homePage.login(driver, "Login");
System.out.println("hello this is test method after login method");
// homePage.pageWait();
//Thread.sleep(5000);
homePage.validateURL("www.xyz.com", "Verify Login with Correct username and correct Password");
} catch (Exception e) {
log.fail("exception : " + e.getMessage());
}
}
}
Это домашняя страница. Java
public void login(WebDriver driver, String elementName)
{
JsonReader jr = new JsonReader();
try
{
System.out.println("hello this is login block");
txtUsername.sendKeys(jr.GetElementValue(elementName+".Username"));
System.out.println("hello this is text username");
}
выполнение отображает сообщение «привет, это блокировка входа в систему» и внезапно завершается.