Open mgr1054 opened 4 years ago
Hey @AngelRodriguez8008,
I don't have a self-hosted agent. The tests are supposed to run on a Microsoft Agent (vs2017-win2016).
Thanks
Hello @mgr1054,
Check this article about special considerations for running UI tests in Azure DevOps.
Hello @mgr1054,
Did this tests passed locally? Test should work on Agent (vs2017-win2016). First step was passed (opening url). Per log test just cannot Open SubArea. It can be different reasons, the most likely reason is slow page loading.
You can understand the reason using 2 options:
Change your code to the next:
public TestContext TestContext { get; set; }
public Browser OkBrowser;
[TestInitialize]
public void TestInitialize()
{
OkBrowser = new Browser(Config.Options);
}
[TestCleanup]
public void TestCleanup()
{
if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed)
{
Screenshot screenShot = ((ITakesScreenshot)OkBrowser.Driver).GetScreenshot();
string screenshotsFile = Path.Combine(TestContext.DeploymentDirectory, "screenshot.png");
screenShot.SaveAsFile(screenshotsFile, ScreenshotImageFormat.Png);
TestContext.AddResultFile(screenshotsFile);
}
}
[TestMethod]
public void WEBOpenEmployee()
{
OkBrowser.GoToXrmUri(_xrmUri);
OkBrowser.Navigation.OpenSubArea("Human Resources", "Employee");
OkBrowser.ThinkTime(2000);
OkBrowser.Grid.SwitchView("All Employees");
OkBrowser.Grid.OpenRecord(0);
}
If it is really related with slow loading you can fix using:
@Shakevg what is the advantage of not to use:
string screenshotsFile = Path.Combine(TestContext.DeploymentDirectory, filename);
_client.Browser.TakeWindowScreenShot(screenshotsFile, ScreenshotImageFormat.Png);
That save directly the file into the desired location.
@AngelRodriguez8008 Agree that it is more simple, but internally the same. Missed this existing method.
Question
Hey Guys,
I'm trying to run some UI Tests in a AzureDevOps Release Pipeline. I followed the Tutorial in the Wiki but the pipeline keeps throwing errors.
Pipeline error:
Code
App Settings
Config