I was trying to execute a sample PNunit tests, but it is failing with the following error
The test xxx couldn't be found in the assembly xxx.dll
I have followed the Pnunit doc, but it is not helpful.
Here is the test case
using NUnit.Framework;
namespace TestLibraries
{
[TestFixture]
public class PuniTest
{
[Test]
public void EqualTo19()
{
Assert.AreEqual(19, (15 + 4));
}
}
}
and the test.conf file
<TestGroup>
<Variables>
<Variable name="$agent_host" value="localhost" />
</Variables>
<ParallelTests>
<ParallelTest>
<Name>Testing</Name>
<Tests>
<TestConf>
<Name>Testing</Name>
<Assembly>pnunit35.dll</Assembly>
<TestToRun>TestLibraries.PuniTest.EqualTo19</TestToRun>
<Machine>$agent_host:8080</Machine>
</TestConf>
</Tests>
</ParallelTest>
</ParallelTests>
</TestGroup>
I have compiled the code, copied the "pnunit35.dll" and "test.conf" files to "NUnit.Runners.Net4.2.6.4\tools" folder to run the tests
And run the following commands (in batch file) to start the agent and run the scripts from Nunit test runner folder
start pnunit-agent 8080 .
pnunit-launcher test.conf
On running the batch scripts, tests are failing with the following error
The test TestLibraries.PuniTest.EqualTo19 couldn't be found in the assembly pnunit35.dll
Could some body please look into this?, thanks in advance
Thanks Everyone,
Finally I found root cause of the problem, it is the pNunit versions which is incompatible with the NUnit-3.6.0 and Nunit.Runner-4.2.6.4 I was using in my project.
When I googled about the issue, I found that pNunit-2.6.4 is not compatible with the latest Nunit-3.6.0. So, I have changed Nunit and NUnit.Runners to 2.6.4. Then the tests worked without any issues.
Update: Use .Net Framework 3.5
Update2: [.Net Framework 4.5] if you are working on .Net Framework 4 and above, start PNunit-agent in compatiblity mode.
Edit "pnunit-agent.exe.config" file in text editor and add the following code in 'configuration'
Close the pnunit-agent and re-run that will solve the issue