Answered question

Selenium C# Client: NullReferenceException on method getUnitTestName()

When the Selenium script is run with EndUserExperience mode, the below stacktrace is thrown:

System.NullReferenceException occurred
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=nunit.framework
StackTrace:
at NUnit.Framework.TestContext.get_Test()
at NeoLoadSelenium.neoload.config.ConfigurationHelper.getUnitTestName()
at NeoLoadSelenium.neoload.interceptor.EUEEntryHandler.GetScriptName(String scriptName)
at NeoLoadSelenium.neoload.interceptor.EUEEntryHandler.NewPath(EUEConfiguration conf)

Sébastien R.
Sébastien R.

Sébastien R.

Level
1
109 / 750
points
Team
Sébastien R.
Sébastien R.

Sébastien R.

Level
1
109 / 750
points
Team

Copy the below line in the C# code, just before instanciating the NeoLoad web driver:

Environment.SetEnvironmentVariable("nl.script.name", "myScriptName");

Did you find this useful ?

No (0)

Yes (0)

0% of users found this answer useful