**************** Starting test execution *********************
C:\hostedtoolcache\windows\VsTest\16.4.0\x64\tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe "@d:\a\_temp\ob3w54ta3i1.tmp"
Microsoft (R) Test Execution Command Line Tool Version 16.4.0
Copyright (c) Microsoft Corporation. All rights reserved.
vstest.console.exe "d:\a\1\s\site\tests\WebSite.Automacao.Tests\bin\$(BuildConfiguration)\netcoreapp3.1\WebSite.Automacao.Tests.dll"
/Settings:"d:\a\_temp\bvgizjzmqi2.tmp.runsettings"
/Logger:"trx"
/TestAdapterPath:"d:\a\1\s"
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.1 (64-bit .NET Core 3.1.5)
[xUnit.net 00:00:01.73] Discovering: WebSite.Automacao.Tests
[xUnit.net 00:00:01.89] Discovered: WebSite.Automacao.Tests
[xUnit.net 00:00:01.89] Starting: WebSite.Automacao.Tests
-> Loading plugin d:\a\1\s\site\tests\WebSite.Automacao.Tests\bin\$(BuildConfiguration)\netcoreapp3.1\TechTalk.SpecFlow.xUnit.SpecFlowPlugin.dll
-> Using default config
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 50056
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 50059
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 50058
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 50057
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
##[error][xUnit.net 00:05:23.38]
Register a new address [FAIL]
[xUnit.net 00:05:23.38] OpenQA.Selenium.WebDriverTimeoutException : Timed out after 300 seconds: Timeout expired on selector By.LinkText: Register
[xUnit.net 00:05:23.38] Stack Trace:
[xUnit.net 00:05:23.38] at OpenQA.Selenium.Support.UI.DefaultWait`1.ThrowTimeoutException(String exceptionMessage, Exception lastException)
[xUnit.net 00:05:23.38] at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition)
[xUnit.net 00:05:23.38] d:\a\1\s\site\tests\WebSite.Automacao.Tests\Config\WebDriverExtensions.cs(22,0): at WebSite.Automacao.Tests.Config.WebDriverExtensions.FindDelay(IWebDriver driver, By by, Int32 timeoutInSeconds, Int32 waitTimeInMilliseconds)
[xUnit.net 00:05:23.39] d:\a\1\s\site\tests\WebSite.Automacao.Tests\Config\WebDriverExtensions.cs(45,0): at WebSite.Automacao.Tests.Config.WebDriverExtensions.DelayClick(IWebDriver driver, By by, Int32 timeoutInSeconds, Int32 waitTimeInMilliseconds)
[xUnit.net 00:05:23.39] d:\a\1\s\site\tests\WebSite.Automacao.Tests\Config\SeleniumHelper.cs(44,0): at WebSite.Automacao.Tests.Config.SeleniumHelper.ClickLinkByText(String linkText)
Project: .NET Core 3.1
References:
<PackageReference Include="bogus" Version="29.0.2" />
<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Selenium.Support" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="83.0.4103.3910" />
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.26.0.3" />
<PackageReference Include="SpecFlow" Version="3.3.30" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.3.30" />
<PackageReference Include="SpecFlow.xUnit" Version="3.3.30" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
Browsers and webdrivers
Google Chrome 83.0.4103.106
Chrome Driver 83.0.4103.39
https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md
The tests access an externally published url. For example: https://stackoverflow.com/
I increased the timeout to 300 seconds but was unsuccessful.
All tests run successfully in Visual Studio 2019.
Edited
Checking the test prints, it was found that the problem is in the resolution that opens the browser.
IWebDriver webDriver = null;
var options = new ChromeOptions();
options.SetLoggingPreference(LogType.Browser, LogLevel.All);
options.AddArgument("--disable-infobars");
options.AddArgument("--disable-gpu");
options.AddArgument("--window-size=1920,1080");
options.AddArgument("--disable-extensions");
options.AddArgument("--start-maximized");
options.AddArgument("--no-first-run");
options.AddArgument("--no-default-browser-check");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--no-sandbox");
options.AddArgument("--disable-dev-shm-usage");
webDriver = new ChromeDriver(options);
webDriver.Manage().Window.Maximize();
webDriver.Manage().Window.FullScreen();
Retrieving the screen size
webDriver.Manage().Window.Size
window-size: {Width=1024, Height=768}
How to change the screen resolution in AzureDevOps?