我有一个 Selenium 项目来测试另一个项目的整体 UI 性能,它在本地运行良好。现在的问题是部署。因为使用它的测试人员不会在 Visual Studio IDE 上运行它。
我们将非常感谢您的帮助和指导。
我尝试过在线搜索解决方案,但没有找到任何有帮助的有形信息。
您可以通过 从 .NET 控制台应用程序创建 .exe 文件来解决此问题:
program.cs
中编写脚本,以便项目有一个入口点C:\Users\[user]\source\repos\[repo name]\bin\Debug\net7.0\files...
我的
program.cs
Selenium 脚本示例:“
using (driver = new EdgeDriver(Options))
{
try
{
selenium = new(driver);
Console.WriteLine($"Starting script {measurement.ScriptName}");
Transaction1("T01_OpenMysolution", send, blob);
}
catch (Exception e)
{
Console.Error.WriteLine("Something went wrong in the script: " + e.Message);
}
};
我只是在我的入口点类中使用顶级语句:顶级语句 - 没有 Main 方法的程序