WebサイトのUIと機能をチェックしているセレンテストを書いています。機能では、入力ブロックにユーザー名とパスワードを入力していて、サインインボタンをクリックしたいです。起こっていますが、正しいページにリダイレクトされません。常にリダイレクトします
http://vma-dev.saas.trilogy.com/favicon.ico " http://vma-dev.saas.trilogy.comは私のベース URL です。次のコードを使用しています。次の関数を使用してログインします。 .
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)
{
}
}
サインインボタンをクリックするには、次の関数を使用しています..
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
}
}
}
私はここでひどく立ち往生しています.どんな助けも感謝しています.