???????????????????Selenium??VSTT
???????????? ???????[ 2012/9/10 16:31:03 ] ????????
// ??????????
????public const string TimeToWaitForPageLoad = "30000";
????}
????public class TestLibrary
????{
????public UserOperationsHelper UserHelper { get; private set; }
????}
????public class TestClass
????{
????[TestMethod]
????public void LogOnTest()
????{
????var username = "donjuan";
????var password = "?????????";
????TestLibrary.UserHelper.LogOn(username?? password);
????// ?????????У?????????????????
????// ??????????????????????????????????????
????selenium.Click(string.Format("link={0}"?? username));
????selenium.WaitForPageToLoad(Consts.TimeToWaitForPageLoad);
????selenium.Click("link=????");
????selenium.WaitForPageToLoad(Consts.TimeToWaitForPageLoad);
????// ????Щ???????????????
????Assert.IsTrue(selenium.IsTextPresented(...));
????}
????}
?????????????????£?????????????????????????????????????????????????????????????????????п????????????????????????洴???????CaseErrorException??????????η?????????????????????????????????????????????????е??????????UserOperationHelper.LogOn?????е??????飬?????????????????У??п?????????????????????????????????£????????????????????????????????????????????????????????????????String.Empty????????????null??????????????ж????????????????д??????????(?????????????????????????潲??)??
????????TestLibrary??????????????????????????????TestInitializer???棬???±??????
[TestClass]
public class AddBlogTest
{
private TestContext testContextInstance;
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
private TestLibrary TestLibrary;
private ISelenium selenium;
[TestInitialize]
public void SetupTest()
{
TestLibrary = TestLibrary.SetupTest(TestContext);
selenium = TestLibrary.Selenium;
}
[TestCleanup]
public void TeardownTest()
{
TestLibrary.Shutdown();
}
}
??????
???·???
??????????????????
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