Abort mstest test from TestInitialize - visual-studio-2013

I'm trying to Abort/Stop/Cancel test run from TestInitialize.
What I'm trying is to check if test method has custom attribute and if so ,abort the test.
TestContext doesn't have this ability ,
Is there any solutions to abort test using code?
Thanks

If you want to stop the test run, you can call Process.GetCurrentProcess().Kill() or Environment.Exit. This will stop the current process (where the tests are running).
If you want to stop only the test which is about to run. You not group your tests so that only the relevant tests are executed:
How to: Group and Run Automated Tests Using Test Categories

Related

How to use before test suite and after test suite in one test in testRigor?

I am using testRigor for Android application. I have testcases for before test suite and after test suite.
I added login test script in before test suite and logout script added in after test suite.
One Testcase for use login functions,so I can't use this three testsuite in one testing process
Because all of test cases for testRigor are executed in parallel, the way "Before test suite" works is it is executed before all other test cases. That also means that logout is unnecessary because every test case is execute on a new server in a new fresh incognito browser.
To achieve what you are looking for you need to specify app's the username and password in Settings/Authentication, and then start all of your test cases from the built-in command login

Integration test execution should wait until server is ready

I have written Selenium tests which should be executed during the build process of an web application. I am using the maven-failsafe-plugin to execute the integration tests and the tomcat7-maven-plugin to start up a tomcat server in the pre-integration-test phase and after the execution of the tests it gets stopped in the post-integration-test phase. This works fine.
The problem is that the tomcat server is caching some data when started up to improve the search speed. Some of my tests rely on that data, so the integration tests should wait for the server to finish caching the data.
How can I make that happen?
I added a process bar to show the loading progress. Once the loading is complete the process bar is not rendered anymore and the data table will be rendered. In this way I can add to the tests which depend on the data table to be loaded this line of code:
longWait.until(ExpectedConditions.presenceOfElementLocated(By.id("dataTablePanel")));
Additionally I am using org.junit.runners.Suite as a runner so that I can specify the order of how my test classes will be executed. Thereby I can execute the test which do not rely on the data first and then the ones which need it. To ensure that the data is present and I don't need to check that in every test case, I have created a test class which will only check the presence of the data and will be executed before all test cases which depend on the data.

Queue sub suites for execution in MTM

I have a test plan which contains a test suite which has 4 sub suites of automated test cases. I want to execute all the subsuites one after the other without manual intervention. Is it possible?
try running test cases from command prompt, this requires the least manual intervention, as once all things are set you need to change only the build number to run your test cases.
refer this link

MSTest -- Can i get the tests to run dynamicly?

i want to call some function once before all test started, and i need to know which tests are going to run. For example, if i selected TestMethod1 and TestMethod3 in my test plan, and run those two testcases, i need to get the test method information of 'TestMethod1' and 'TestMethod3'.
Is there any way to do that??

Cannot run VSTS LoadTest at a time

I have a VSTS project with a list of 30 LoadTest tests that I want to run sequentially. All tests are independent from each other.
When I try to run all the tests, it starts with the first test and it executes it perfectly, but once the first test is finished, it automatically starts to mark the rest of the tests as completed, but without executing them.
Do I have to configure any option to run all of them together? Am I missing something?
Note: when the first test is finished it also asks me if I want to view the "detailed results from the load test".
Any advice/comment is welcomed...
Thanks,
albert
UPDATE (16/07/2010)
More info... I'm trying to run the load tests as in the image that you can see at freeimagehosting.net/image.php?69cc93fa7b.gif. After the first loadtest is finished the rest of them are just marked as completed.
The load tests are individual tests, and have never seen a way to execute them simultaneously. You create individual web tests that you then put into a load test to run.

Resources