简体   繁体   English

如何在命令提示符下运行Selenium C#测试?

[英]How to run selenium c# test in command prompt?

I have some c# tests, and I want run this tests from command prompt. 我有一些c#测试,我想从命令提示符下运行此测试。

How can I run this tests ? 如何运行此测试?

Please help me. 请帮我。

If you are using Visual Studio 2012, then you will use vstest.console.exe to be the same as Visual Studio, for example: 如果使用的是Visual Studio 2012,则将使用vstest.console.exe与Visual Studio相同,例如:

C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe UnitTests.dll /logger:trx C:\\ Program Files(x86)\\ Microsoft Visual Studio 11.0 \\ Common7 \\ IDE \\ CommonExtensions \\ Microsoft \\ TestWindow \\ vstest.console.exe UnitTests.dll / logger:trx

The documentation is here . 文档在这里

Otherwise, you will use mstest on the command line if Visual Studio 2010: 否则,如果使用Visual Studio 2010,则将在命令行上使用mstest:

C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\mstest.exe C:\\ Program Files(x86)\\ Microsoft Visual Studio 11.0 \\ Common7 \\ IDE \\ mstest.exe

The documentation is here . 文档在这里

The same applies when running selenium tests, there is nothing special about them as far as running from the command line is concerned. 运行硒测试时也是如此,就从命令行运行而言,它们没有什么特别的。

getting this Error on running with vstest command. 使用vstest命令运行时出现此错误。 Please........ guide what is wrong I am using 2017VS this Error: 请........指导我使用2017VS这个错误是什么错误:

No test is available in C:\\PA_Trunk\\PA.UI.Tests\\bin\\Debug\\PA.UI.Tests.dll. C:\\ PA_Trunk \\ PA.UI.Tests \\ bin \\ Debug \\ PA.UI.Tests.dll中没有可用的测试。 Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again. 确保已注册测试发现者和执行者,并且平台和框架版本设置正确,然后重试。

Additionally, path to test adapters can be specified using /TestAdapterPath command. 此外,可以使用/ TestAdapterPath命令指定测试适配器的路径。 Example /TestAdapterPath:. 示例/ TestAdapterPath:。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM