I want to use the NeoloadSeleniumWrapper in Visual Studio (C#) for test design. The recording in Neoload works fine for a console application, if I pass the required program argument via command line: -Dnl.selenium.proxy.mode=Design. However, I want to perform the recording out of a unit test, as shown in the Neoload Documentation: https://www.neotys.com/documents/doc/neoload/latest/en/ht...
The documentation does not state how to pass the argument in this case, and Neoload does not record anything if it is missing. The difficulity of passing command line arguments in unit tests is also discussed here: https://social.msdn.microsoft.com/Forums/en-US/441920ee-e...
Is there any efficient solution for this?
If you can insert code in the unit test, did you try
System.Environment.SetEnvironmentVariable( name, value ); ?
How do you start the C# program? Can you call a "set nl.selenium.proxy.mode=Design" before calling the program?
The unit tests are started manually in the GUI of Visual Studio (Test -> Run -> etc.). This triggers mstest behind the scenes and represents the default way of unit test execution in C#.
I tried calling "set nl.selenium.proxy.mode=Design" before the test execution (manually in a shell) and also as first step inside the unit test via System.Diagnostics.Process.Start("CMD.exe", "set nl.selenium.proxy.mode=Design"). Unfortunately it didn't work.
Thank you very much! This did the trick:
System.Environment.SetEnvironmentVariable("nl.selenium.proxy.mode", "Design");
Maybe you should consider to add this to the documentation for the c# client (see link in the initial question).
christophe was made best respondent
Roman answered
christophe answered
Roman answered
christophe answered
Roman posted a new question