Multiple Categories not working with MSTEST command-line - visual-studio

I am trying to use MSTEST to run visual studio tests, but when I try to use /category:"&" the tests won't run, and it will say that it does not recognize the category.
I want to run multiple categories at once without using different MSTEST calls so that in one MSTEST call I can run all of the categories and publish one output results file.
My categories are correct because it runs successfully with 1 category, I'm just having trouble appending them.
For example,
mstest /testcontainer:.(...).dll /testcontainer:.(...).dll /category:"Defect Tests&Functional Tests"
returns
Loading .\(...).testrunconfig
Loading .\(...).dll
Loading .\(...).dll
Starting execution...
No tests to execute.
However, if I were to use just one category, say:
\category:"Defect Tests"
It would work totally fine.

I didn't realize that I should use | as the literal OR logical operator, and not something else. I was using & and was ending up with no tests to run, because I thought it would run both test suites, but in reality, it was only running tests that had both category labels on them... which was none of them.
For Example (based on https://msdn.microsoft.com/en-us/library/ms182489.aspx#category):
/category:"group1|group2" runs tests that are in test category "group1" or "group2".
Tests that are in both categories will also be run.
/category:!group1&!group2 exclude tests with categories "group1" and "group2".
/category:group1 runs tests in the test category "group1".
/category:"group1&group2" runs tests that are in both test categories "group1" and "group2." Tests that are only in one of the specified test categories will not be run.
/category:"group1&!group2" runs tests from the test category "group1" that are not in the test category "group2." A test that is in both test category "group1" and "group2" will not be run.

Related

Active Tag in Cucumber Java

Is there anyway to identify which is the current running cucumber tag in Cucumber-Java for API testing?
I am using Cucumber-Java, along with TestNG. For grouping and executing in different environments, I am using cucumber tags.
The tags are given in feature level. Multiple tags have been specified for same feature. Like:
#regression-staging #regression-production
Feature: Add to cart
Scenario:
.
.
.
Same code is using for staging and production. And as build took I am using Maven. Since TestNG is used, the test is triggered from RunTestNGTest class that I wrote. Inside the RunTestNGTest, I have #BeforeSuite and #AfterSuite methods.
The test is run using mvn command
mvn test -Dcucumber.filter.tags=#regression-staging
or
mvn test -Dcucumber.filter.tags=#regression-production
Is there anyway I can get which tag is currently running? (In my case, either one will be active at a time). I want to log which tag is currently using, and also want to use the same in the HTML report. I tried scenario.getSourceTagNames();, but that returns all the tags for the scenario, not the currently running one.
You can simply access cucumber.filter.tags from your code like you would access any other system property:
String myCurrentTag = System.getProperty("cucumber.filter.tags");
Now you can parse the value (split by commas or additionally remove # symbol, etc.)

How to check if ModuleController has selected Controller before the test runs?

I have tests (JMX) with modular controllers and sometimes throw an error when they are started when there are modular controllers without a controller selected.
Is there a way to verify if every (enabled) modular controller has an associated controller?
As of JMeter 5.4.1 it is not possible to "validate" the Module Controllers without actually running your tests, the Test Plan Tree is being built in the runtime from the test elements provided and controllers like Module Controller or Include Controller basically modify the Test Plan Tree on the fly creating one big test plan from reusable fragments or external scripts.
So the options are in:
Perform a dry-run with 1-2 users/iterations to see whether your test still works, produces .jtl file without errors, etc.
It's also possible to run JMeter from Java code so you could come up with an utility which will do the test plan checking basing on your acceptance criteria

MsTest /category:"group1&group2" does not work

http://msdn.microsoft.com/en-us/library/ms182489.aspx#category
/category:"group1&group2" runs tests that are in both test categories "group1" and "group2." Tests that are only in one of the specified test categories will not be run.
This filter type '&' does not work for me! I can successfully use /category:"group1|group2" as a workaround.
But has anyone experienced this?

Select list for QUnit modules in test runner bar?

I recall having seen at some point screen shots of a select list of QUnit test modules in the test runner toolbar of QUnit. My impression was that selecting one of the modules in the select list would cause that module's tests to be run.
Question: Does such a feature actually exist OOB for QUnit? I know one can set filter via the URL but I would like a more "discoverable" option.
Thanks!
The select list only shows itself if you have defined more than one module in your test suite.
Also, make sure that your test suite is ready before QUnit initializes itself. i.e. QUnit initializes itself when the page finishes loading (the onload event). If you happen to define your test suite after this, then you have to call the (undocumented) QUnit.load() method to notify QUnit that your test suite has been defined.
Demo: http://jsfiddle.net/brianpeiris/98fc8/show/

Open specific Test Plan, Test Case and Test Result in Microsoft Test Manager

Is there any way to call/start TFS 2010's Test Manager with either a given Test Plan, a Test Case or Test Result to be opened?
What I want to do is to do some sort of evaluations on those items, but want to give the user the option to 'view' the underlying element natively.
If you invoke any Browser (I tried with Firefox & IE) something like this:
mtm://tfsName:8080/tfs/CollectionName/p:TeamProjectName/testing//testplan/open?id=123
mtm://tfsName:8080/tfs/CollectionName/p:TeamProjectName/testing//testcase/open?id=123
mtm://tfsName:8080/tfs/CollectionName/p:TeamProjectName/testing//testrun/open?id=123
MTM will load with respecting view opened (testplan 123, testcase 123, testrun 123)

Resources