How to start test without runner in C# Nunit project?

First i’m new to this testproject tool.

I want to create a Testproject using C# Nunit for mobile app(android and ios) testing. I recorded a test and exported the code and used in visual studio. i can see that we need a runner to start the test like below.
runner.Run(new BasicTest());

and we need to call the execute method to start the test as below.

public ExecutionResult Execute(IOSTestHelper helper)
{}

is it possible to start the test without the above runner and without using the execute method.

For example i want like below:

[Onetimesetup]
method()
{
object = iosdriver / androiddriver
}

[Test]
method1()
{
object.sendkeys()
}

[Test]
method2()
{
object.clear();
}

Any help on this… Thanks in advance.

Hi @megaqa123 ,

First of all welcome to our community.
Regarding your question, it is not possible.
Think of that like executing a web test without a driver.
If you have any other questions, please feel free to ask :slight_smile:

HI @alex.ivanov first thanks for your reply.

it is tough that we have to use the runner in each [Test] method right? And looks like we have to use ExecutionResult Execute(IOSTestHelper helper) method only to execute the test. Am confused actually that how to do mobile automation using Nunit.

can you give a sample code for mobile automation using c# nunit? I found chromedriver sample for nunit in the testproject docs but not for mobile apps.

Hi @megaqa123 ,

We don’t have a specific sample for mobile apps using the Nunit framework, however, we do have samples codes for Nunit related to reporting services, you can find more information here:

thanks but i’ve seen this before itself. This sample is for chromedriver. We have a driver object and using it through out the test class. there is no runner or execution method used in that example. The same way how to do for mobile app? Please help.

@alex.ivanov please reply