gpt4 book ai didi

c# - 我如何按顺序运行 selenium C# 测试用例?

转载 作者:太空宇宙 更新时间:2023-11-03 23:04:22 24 4
gpt4 key购买 nike

我有 10 个使用 selenium 的 c# 测试用例,但它们没有按顺序运行,我如何才能命令测试用例的运行。

这是我的代码。

[Test]
public void AddLeadWithOneTract()
{
ClickOnAddNewLead(driver);
EnterLeadInfo(driver, leadDictionary);
AddTract(driver);
EnterTractInfo(driver, tractDictionary, "4n", "2e", "22", "NENE", "1000", "1000", "10");
SaveTract(driver);
SaveLeadAndExit(driver);
TryFindElementById(driver, "R2017000000", 2000);

}

[Test]
public void TestTractInfoValidation()
{
ClickOnAddNewLead(driver);
AddTract(driver);
EnterTractInfo(driver, tractDictionary, "4", "2", "22", "NENE", "-1000", "-1000", "-10");
SaveTract(driver);
string alertText = CloseAlertAndGetItsText(driver);
Assert.IsTrue(alertText.Contains("Please enter a valid Township"));
Assert.IsTrue(alertText.Contains("Please enter a valid Range"));
Assert.IsTrue(alertText.Contains("Please set valid asked price"));
Assert.IsTrue(alertText.Contains("Please enter a valid NRI"));
Assert.IsTrue(alertText.Contains("Please enter a valid NMA"));
}

最佳答案

Nunit 3.*order attribute

[Test, Order(1)]
public void AddLeadWithOneTract()
{
}

[Test, Order(2)]
public void TestTractInfoValidation()
{
}

关于c# - 我如何按顺序运行 selenium C# 测试用例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41848999/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com