nUnit Test Runner - Test stays in "Not run" if it takes over a certain amount of time - visual-studio-2012

We have some Selenium tests built with nUnit that take quite a while to complete. We are finding that they stay in the "Not run tests" grouping even though they should pass.
After some initial investigation we found that if we remove some long running steps the tests will pass correctly but as soon as we shove a sleep in the code that waits for a couple of minutes the problem comes back.
We are using Visual Studio 2012 with the nUnit Test Runner extension as shown here: http://nunit.org/index.php?p=vsTestAdapter&r=2.6.2
Is there some hidden timeout in nUnit or the test runner that we need to change to get our tests (no matter how long they take) to pass or is there some other problem at work here?

Related

Cypress can't run multiple test

I have a weird behaviour in cypress lately
When i debug, the issue is that the test starts with this url account.domain.com
as the test goes on, it naturally move to app.domain.com.
All is good for the first test.
The second one uses the same logic, start with account.domain.com ...
While the first one ended the test with the url app.domain.com, it seems that cypress is unable to load account.domain.com in the next test, it doesn't show any error, it just keep loading
Do you have any solution for this please ?
I'm using cucumber by the way

Android Studio Unit Tests With Coverage Showing 0% On Everything

I'm trying to check my unit test coverage, all my tests are passing, but when I run the tests with 'Run Tests With Coverage' by right clicking on my test file, when it completes, everything comes back as 0%?
Looks like it's supposed to just work reading https://developer.android.com/studio/test/index.html and can't find anything saying why it would be returning 0% for everything?
Is there some hidden setting I'm missing to get this working?
Go to Run->Edit Configuration->Code coverage.
Add your package/class for which you want to run tests, in Packages and classes to record coverage data section.
Also, check Enable coverage in test folders option.
Click Apply and Ok. Re-run your tests with coverage.

TFS Test - mstest log output - final test results

A couple of days ago our vs2012 mstest started producing two logs of test results in the one session, the initial "Results Top Level Tests" then Final Test Results:" "Results Top Level Tests"
As we parse the file, naturally we came undone with two lots of results.
Why is their two lots of results and - or how was this triggered ?
What is "Final Test Results" about?
(the console output from mstest is piped to a file)
Thanks
Based on my test, the issue should be caused by the test cases or the test processes which have something wrong. And the "Final Test Results" will appear there.
Simply say, when the message "Final Test Results" appears, that means maybe there are something wrong with the configuration of your test project or test processes.
So, please check and debug the test cases, processes, environments etc...
Firstly make sure the tests running without any error within local Visual Studio.
Reference:
MSTest hangs when used from command line
MSTest.exe command-line options

TFS Build VS Test Runner - Run only tests with no TestCategory

I currently have around 6000+ tests running on over 30+ projects.
Some of these tests are only able to run locally, so have been decorated with the attribute:
TestCategory="Manual Tests"
this also applies to any functional tests, these are decorated with:
TestCategory="Functional Tests" etc...
I have read a number of MSDN and user articles on this and have setup a build to run only the Functional Tests
Test Case Filter: TestCategory=Functional Tests
(This successfully runs only the Functional Tests)
Question is, is there a test case filter I could use that will ignore both the TestCategory "Functional Tests" and "Manual Tests" and only run the tests that have not been decorated with a TestCategory Attribute.
If have used the below filter cases with no joy:
**Test Case Filter:**
!Functional Tests|!Manual Tests
TestCategory!=Functional Tests|Manual Tests
TestCategory!=Functional Tests|!Manual Tests
TestCategory!=Functional Tests|TestCategory=Manual Tests
TestCategory!=Functional Tests||TestCategory=Manual Tests
(TestCategory!=Functional Tests)|(TestCategory=Manual Tests)
(TestCategory!=Functional Tests)||(TestCategory=Manual Tests)
I am running this on Visual Studio 2012 (Update 4) with TFS 2012 (Update 4)
Many Thanks
Fix the issue by using "()" around your filter. Also | is or, and & is and so using x!=y or y!=z will not work. Use & for not equal to evaluations.
/TestCaseFilter:"(TestCategory!=PreTest&TestCategory!=PostTest&TestCategory!=CleanUp)"
Start small then build up..have you just tried one statement, say:
TestCategory!='Functional Tests'
Looking at the documentation my first punt for the full command would be:
TestCategory!='Functional Tests'&TestCategory!='Manual Tests'

Coded Ui-Data driven tests

I am automating a test scenario which runs on different test inputs.The inputs are passed from a CSV file or MTM. During the test run,the first iteration went through successfully but the 2nd iteration fails for the same flow for which the first has gone through successfully.
Could anyone say the cause for this problem,why is it happening? I thought it would be due to the objects which are set to some value(during the first run) and not initialized to null in the second run.So when the next run happens it fails on some controls saying "Unable to find control" on some objects.But the tool recognized it successfully in the first run.If this is the problem kindly help us on the solution asap.Thanks in advance!!
regards
Amsaveni
You will get this error if your test is running but the controls or app has not yet been loaded. Say Round 1 is finished and round 2 has begun. If you are not starting the app from a same starting point or not waiting for the control, then you will get this exception.
Verify that after each test has completed you app starts in the same state
Verify that you are waiting for your controls
Hand code and debug your test

Resources