Page 1 of 1
Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Fri Nov 02, 2018 4:18 pm
by qwertz
Hi,
I have a solution with different projects and I experienced a problem with executing a test case. In two of the projects where I did not have a test suite with test suite with test cases I could not excute them after creating them. I am not sure if it has something to do with Ranorex 8.3.0 but I only had these problems after updating to 8.3.0.
When I try to execute one of the new test cases the console windows only pops up for a second and closes right away. There is no report or any other error message. I found a Ranorex compressed report (rxzlog-file) within the bin\Debug\ folder with the following error message:
Code: Select all
Test execution fatal crash
Test executable crashed with unhandled exception.
Please ensure all required prerequisites are installed:
- .Net Framework 4.5
- VC++ Redistributable (2017)
For more information visit: https://www.ranorex.com/help/v8.3/xcopy-deployment
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei Ranorex.Core.Resolver.MainInvoker.Invoke(Assembly callerAssembly, String startUpObject, String[] args)
bei __RxMain.__RxProgram.Main(String[] args) in D:\5_Ranorex\Base\BaseLibrary\obj\Debug\__RxPrograms.g.cs:Zeile 32.
This lead me to this question:
problem-with-ranorex-core-resolver-in-8-0-0-t11808.html.
I tried the "Copy runtime to output"-setting and all the Target CPU settings but nothing helped. I never changed anything in the compiling settings before. I even copied the Ranorex.Core.Resolver.dll into the obj\Debug\ folder but nothing helped. The xcopy-deployment article did not help either as I am not trying to run the test where no Ranorex is installed.
The tests I created in another project but in the same solution before the update to Ranorex 8.3.0 still run.
I have no more ideas what I have to do to make the test run. Can anybody help me, please? Did anybody have the same issue maybe?
Thanks
U
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Tue Nov 06, 2018 9:20 am
by RobinHood42
Hi,
Are you using Ranorex 8.3 on that specific machine to build and execute the test? Ensure to completely erase the output folder of your project, e.g. bin/Debug, and rebuild the project(s).
Furthermore, I would recommend a clean re-install of Ranorex:
- -> Uninstall Ranorex from your machine
-> Reboot your machine ( !!! )
-> Install Ranorex using the setup executable
Cheers,
Robin
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Tue Nov 06, 2018 12:15 pm
by qwertz
Thank you, Robin, for your suggestions!
Unfortunately neither clearing the output folder nor re-installing Ranorex 8.3 helped.
After trying around a little more I found out that you can't run test suites in a test suite module library project. I'm not sure if this is on purpose but if it is to me it makes no sense that I'm able to add a test suite to this kind of a project.
This leaves me with the question how I can debug code in a test suite module library project. If I use code of the library in a test suite project and an error occurs the report will only inform me about the method the error occurs in but not the line number... But I will open a new topic for this.
qwertz
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Tue Nov 06, 2018 3:29 pm
by krstcs
The Test Suite Library project type compiles to a DLL, so it isn't executable on Windows directly. You need to go into the project's properties and change the output to a Console Application type.
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Tue Nov 06, 2018 4:49 pm
by qwertz
Hey krstcs,
even that does not change that the test case cannot be executed. Same error. Ranorex also has a popup dialog to tell you to change the output type to console application to be able to execute the test case.
Finally I found out that if I use the Debug-dll of the test suite module library project in the test suit project and then execute a test case with code from the test suite module library project (with breakpoints), the execution recognizes the breakpoints from there and I am able to debug it!
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Thu Nov 08, 2018 1:39 pm
by Rikke Svendsen
Hi, I have the same problem.
I do not understand what your are doing to start the test suite??
I am not a developer, so I do not understand the last answere of what you have been doing. Can you maybe explain with screenshots what you are doing?
And will it never be possible to run a testsuite in a normal way - with clicking at the Run buttom in Ranorex??
I have just tried to test the new stuff in Ranorex 8.3 and the possibilities with more than one test suite in one solution. But It seems that it not working very good??
/Rikke:)
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Thu Nov 08, 2018 2:14 pm
by qwertz
Hi Rikke,
I am not quite sure what exactly you are asking. I'll try to answer and hope it will help you:
I do not understand what your are doing to start the test suite??
I usually start test suites by right-clicking them and selecting 'Run test suite'.
And will it never be possible to run a testsuite in a normal way - with clicking at the Run buttom in Ranorex??
Sure it is possible to use the Run button. But if you have more than one project in your solution you have to be careful which test suites you start with it. You can configure that clicking the chevron icon next to the Run button.
Furthermore, what is important:
- Your project has to be a Ranorex test suite and NOT a Ranorex test suite module library. The second cannot run tests. That will lead to the error I described above.
- In the project properties of your project you have to set the output type to Console application. But Ranorex will tell you to do that if you haven't and try to run a test.
I hope this helps.
qwertz
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Fri Nov 09, 2018 8:50 am
by Rikke Svendsen
Hi qwertz,
Yes, you have understood it right. BUT when you are writing:
Your project has to be a Ranorex test suite and NOT a Ranorex test suite module library.
How can I then use the recording modules in another project?? I will try to explain what i mean in the picture
I hope ypu can answere this question.
/Rikke
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Fri Nov 09, 2018 12:18 pm
by qwertz
Hey Rikke,
I think this should help you:
https://www.ranorex.com/help/latest/ran ... estsuites/
Cheers,
qwertz
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Fri Nov 09, 2018 1:39 pm
by Rikke Svendsen
Hi,
Im sorry, i am not able to run the the testsuite either. I still get that message you have describe in the first:(
The difference between my problem and what the describtion you send is thar i have two projects and in the description there is only one project. So i do not find a solution for that.
I will fight further - but i am soon getting out of solutions:(
/Rikke
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Fri Nov 09, 2018 2:29 pm
by qwertz
Hi Rikke,
I also have multiple projects and I can use modules of one project in the test suite of another project. To be able to do that you need to add the dll-file of the first project in the second as a reference. But as you could use the module in your test case, you should have already been able to do that.
Are you sure that you two projects are Ranorex test suites? Unfortunately, I don't know how to check that after the project is created.
If you are sure, can you describe step by step what you are doing to run your test suite? Maybe I can help then. In my case the solution to the error was the project kind.
qwertz
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Tue Feb 12, 2019 9:01 pm
by rragsac
Has this issue been solved? I just started encountering the same issue after doing some organization and refactoring in Ranorex Studio.
I created a new project and copying over all the needed .cs files and .rxtst files into the new project from another project. I added all the references needed and compared with the project I am copying from. The project settings for the new project are set to Console Application.
If I run a very simple test just to start my application, then I get this error.
NullReference.PNG
I reinstalled the .NET framework and the V++ Redistributable and my other scripts in my other projects associated with this solution run just fine. It's only when I run a script within the new project I created.
Any suggestions would be appreciated. Thanks
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Mon Feb 18, 2019 8:30 pm
by qwertz
Hey rragsac,
I guess that there are still references missing.
I would suggest that you don't copy over the whole files (cs, and the others) but create new files in the new project and copy over only the content of the files you need to copy.
I hope that helps.
Regards
qwertz
Re: Test execution not possible: Test execution fatal crash with NullReferenceException
Posted: Tue Feb 19, 2019 11:15 pm
by rragsac
Thank for the suggestion.
For some reason, the folder had two projects, one in the top folder and one in a subfolder. I was referencing the project in the parent folder and was getting that error. When I removed the top level project and used the project in the subfolder, the error went away.
-Rod