UIAutomation: ?????????????
???????????? ???????[ 2014/5/14 9:43:34 ] ????????Instrument ????????? ??????????
????????????????2?????????????? User name ?? Password ?????????????? Login??
?????????????????
//Get the handle of application main window
var window = UIATarget.localTarget().frontMostApp().mainWindow();
//Get the handle of view
var view = window.elements()[0];
var textfields = window.textFields();
var passworldfields = window.secureTextFields();
var buttons = window.buttons();
var textviews = window.textviews();
var statictexts = window.staticTexts();
var target = UIATarget.localTarget();
//Check number of Text fields
if(textfields.length != 1)
{
UIALogger.logFail("FAIL: Invalid number of Text fields");
}
else
{
UIALogger.logpass("PASS: Correct number of Text fields");
}
//TESTCASE_001: Test Log on Screen
//Check existence of desired TextField on UIScreen
if(textfields["username"]==null || textfields["username"].toString() == "[object UIAELementNil]")
{
UIALogger.logFail("FAIL:Desired textfield not found.");
}
else
{
UIALogger.logPass("PASS: Desired UITextfield is available");
}
//TESTCASE_1.2:Check existence desired of PasswordField On UIScreen
if(passwordfields[0] == null || passworldfields[0].toString() == "[object UIAElementNil]")
{
UIALogger.logFail("FAIL: Desired UISecureField not found.");
}
else
{
UIALogger.logPass("PASS: Desired UISecureField is available");
}
//TESTCASE_1.3 :Check for Existence of Buttons On UIScreen
if(button["logon"] == null || buttons["logon"].toString() == "[object UIElementNil]")
{
UIALogger.logFail("FAIL:Desired UIButton not found.");
}
else
{
UIALogger.logPass("PASS:Desired UIButton is available");
}
//TESTCASE_001: Missing User Name
textfields["username"].setValue("");
passwordfields[0].setValue("password");
buttons["logon"].tap();
//target.delay(2);
var errorVal = textviews["error"].value();
if(errorVal != "Invalid User Name or PassWord")
{
UIALoger.logFail("Did Not Get Missing UserName Error:" + errorVal);
}
else
{
UIALogger.logPass("Missing User Name");
}
//TESTCASE_003: Successful Log On
textfields["username"].setValue("username");
passwordfields[0].setValue("password");
buttons["logon"].tap();
target.delay(2);
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
????????????????????????е?С???WEB??????????????????????????????????Щ???棿??????????й?????????????Visual Studio????????UI?????????????????й?????????????B/S??????????????????Web???????????????????????? Web ?????????????????????ν??н???????????????????????????????????????????????й?????????????????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????