我正在编写一个selenium测试,我正在检查网站的UI和功能。在功能上我输入用户名和密码输入块并想点击登录按钮。除了登录按钮外,所有工作都正常。点击也在发生,但它不会在右页重定向。它总是重定向
http://vma-dev.saas.trilogy.com/favicon.ico” 哪里 http://vma-dev.saas.trilogy.com是我的基本网址。我正在使用以下代码.. 使用以下功能登录..
public void getLogin() throws InterruptedException
{
enterTextValueByElementNameInWindow(getBaseElement(),AppConstants.Html_Id_Common_Text_User ,AppConstants.USER_VAL);
//getBaseElement().keyUp(AppConstants.Html_Id_Common_Text_User,"m");
enterTextValueByElementNameInWindow(getBaseElement(),AppConstants.Html_Id_Common_Text_PWD ,AppConstants.PASSWORD_VAL);
//getBaseElement().keyUp(AppConstants.Html_Id_Common_Text_PWD,"3");
clickByElementInWindow(getBaseElement(), AppConstants.Html_Id_Common_Btn_Text_SignIn, true);
try
{
getBaseElement().wait(10000);
}
catch(IllegalMonitorStateException ie)
{
}
}
并点击signIn按钮我正在使用以下功能..
public static void clickByElementInWindow(LoggingSelenium appWindow, String element, boolean waitForPageLoad)
{
LoggingAssert.assertTrue("Button Element " + element + " cannot be located",appWindow.isElementPresent(element), appWindow);
LoggingAssert.assertTrue("Button Element " + element + " is not visible",appWindow.isVisible(element), appWindow);
appWindow.click(element);
appWindow.setSpeed("500");
if (waitForPageLoad){
// wait for page to be ready
// appWindow.waitForPageToLoad(Integer.toString(AppConstants.APP_READY_TIME));
// sometimes page doesn't get loaded even with waitForPageToLoad. Use sleep to be safe.
try
{
Thread.sleep(AppConstants.APP_PAGE_LOAD_WAIT_TIME);
}
catch(InterruptedException ie)
{
// do nothing
}
}
}
我被严重地困在这里。任何帮助都是适当的。