wille525 Absent Member.
Absent Member.
919 views

How to continue in a previous opened browserWindow

Jump to solution

I have a question. Assume I have executed the test below in debug mode and after step 2 the test failed.

After I fixed the code for step 2, I want the test to continue at the position the test failed. To do this, I comment out the code of the previously executed steps (in my case only step 1).

When I start the test again, I see that a new instance of the application is opened. When I comment out the code in the [TestInitialize] the test is not running at all. 

My question is: what should I do to continue the test from the point it previously failed? I have a lot of experience with Microsoft Coded UI, by which this is possible. I hope you can help me out.

-----------------------------------------------

[SilkTestClass]
public class Silk4NetTest123 : SilktestBase
{
private readonly Desktop _desktop = Agent.Desktop;

[TestInitialize]
public void Initialize()
{
//Start application:
BrowserBaseState baseState = new BrowserBaseState();
baseState.Execute();
}

[TestMethod]
public void Silk4NetTestMethod()
{

_desktop.doSomethingOnScreen_1();

_desktop.doSomethingOnScreen_2();

_desktop.doSomethingOnScreen_3();

etc...

}

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

RE: How to continue in a previous opened browserWindow

Jump to solution

Hi Wille525

You will need to disable the BaseState. You can do this by commenting out the following line in your [TestInitialize] method.

//baseState.Execute();

When you execute the script, the BaseState will not run and you can continue from the current open state of the application.

Regards,

Colin

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

RE: How to continue in a previous opened browserWindow

Jump to solution

Hi Wille525

You will need to disable the BaseState. You can do this by commenting out the following line in your [TestInitialize] method.

//baseState.Execute();

When you execute the script, the BaseState will not run and you can continue from the current open state of the application.

Regards,

Colin

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.