Как записать выполнение теста с использованием Selenium C# в .Net CoreC#

Место общения программистов C#
Ответить
Anonymous
 Как записать выполнение теста с использованием Selenium C# в .Net Core

Сообщение Anonymous »

Я пытаюсь записать выполнение теста с использованием Selenium, C#, MSTest в .NetCore

Пытался использовать Microsoft.Express.Encoder nuget pkg, который выдает ошибку при создании экземпляра ScreenCaptureJob

"System.BadImageFormatException: Could not load file or assembly 'Microsoft.Expression.Encoder, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. An attempt was made to load a program with an incorrect format." To resolve this, tried running test using x86, x64 and Any CPU, but none of them works.

Also tried using Nunit.Video.Recorder, with Nunit Framework, when did this, test are not discovered, tried changing to x86, x64 and Any CPU

1>C:\Users\Sunny\source\repos\ScreenRecorder\NUnitTestProject1\NUnitTestProject1.csproj : warning NU1701: Package 'Nunit.Video.Recorder 1.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.2'. This package may not be fully compatible with your project.
1>C:\Users\Sunny\source\repos\ScreenRecorder\NUnitTestProject1\NUnitTestProject1.csproj : warning NU1701: Package 'SharpAvi 2.1.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.2'. This package may not be fully compatible with your project.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Users\Sunny\.nuget\packages\nunit.video.recorder\1.0.0\lib\net452\NunitVideoRecorder.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
1>NUnitTestProject1 -> C:\Users\Sunny\source\repos\ScreenRecorder\NUnitTestProject1\bin\Debug\netcoreapp2.2\NUnitTestProject1.dll
1>Done building project "NUnitTestProject1.csproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

[8/9/2019 4:18:30.549 PM Informational] ---------- Run started ----------
[8/9/2019 4:18:31.686 PM Informational] NUnit Adapter 3.11.0.0: Test execution started
[8/9/2019 4:18:31.699 PM Informational] Running all tests in C:\Users\Sunny\source\repos\ScreenRecorder\NUnitTestProject1\bin\Debug\netcoreapp2.2\NUnitTestProject1.dll
[8/9/2019 4:18:31.806 PM Informational] NUnit failed to load C:\Users\Sunny\source\repos\ScreenRecorder\NUnitTestProject1\bin\Debug\netcoreapp2.2\NUnitTestProject1.dll
[8/9/2019 4:18:31.807 PM Informational] NUnit Adapter 3.11.0.0: Test execution complete
[8/9/2019 4:18:31.810 PM Warning] No test matches the given testcase filter `FullyQualifiedName=Tests.Tests.Test1` in C:\Users\Sunny\source\repos\ScreenRecorder\NUnitTestProject1\bin\Debug\netcoreapp2.2\NUnitTestProject1.dll
[8/9/2019 4:18:31.936 PM Informational] ========== Run finished: 0 tests run (0:00:01.3376823) ==========


Подробнее здесь: https://stackoverflow.com/questions/574 ... in-netcore
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»