How to exclude particular scenarios in BDD using QAF BDD2 framework? - bdd

I have a feature file containing multiple scenarios, few of them are manual. When I run my scenarios I want to exclude Manual scenarios. How to exclude Manual scenarios using QAF BDD2?
Ex: Feature Hello
#channel.. #run
Scenario: Run this scenario
Given ...
When ..
Then..
#Manual
Scenario: Exclude this scenario
Given ...
When ..
Then..
When I run this, it picks all scenarios and skips the one with have #Manual tag saying no def found which is valid but I dont want this scenario to run and skip. I want to exclude this scenario, I tried adding exclude tags in config xml file like below it did not work.
<groups>
<run>
<exclude name="Manual"></exclude>
</run>
</groups>

it should work with qaf latest version. As alternate you also can try using meta-data filter providing exclude property instead of groups tag. For example:
<parameter name="exclude" value="{'groups': ['Manual']}" />

Related

How to apply filters while running BDD scenarios using QAF BDD2 framework?

We have feature file with scenarios that are applicable to only mobile and desktop. I want to run only mobile scenarios in my regression. How should I add this filter so that it picks only mobile scenarios using QAF BDD2?
Ex: Feature Hello
#channel['desktop','mobile']
Scenario: This is applicable for desktop and mobile
Given ..
When ..
Then ..
#channel['desktop']
Scenario: This is applicable for desktop only
Given ..
When ..
Then ..
#channel['mobile']
Scenario: This is applicable for mobile only
Given ..
When ..
Then ..
When I try to run this it runs and skips desktop scenarios. How shoud I add filter just to run Mobile scenario and avoid skipping desktop scenarios? I tried below code adding in config xml did not work
<parameter name="include" value="{'channel': ['mobile']}" />
and added
<method-selectors>
<method-selector>
<selector-class name="com.qmetry.qaf.automation.testng.pro.QAFMethodSelector" />
</method-selector>
</method-selectors>
in xml also. Filter is not working. Please help me here.
You are missing : to separate Meta key value pair. For example:
#channel:['desktop','mobile']

Jmeter 3.0 can't generate the ANT HTML report

I am on the verge of pulling all my hair out, someone please help me..
I am using JMeter 3.0 and am trying to generate the dashboard report from my jtl files, but I get the error -
result.jtl' does not contain the field names header, ensure the jmeter.save.saveservice.* properties are the same as when the CSV file was created or the file may be read incorrectly
my user.properites file contains -
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.timestamp_format=ms
jmeter.save.saveservice.timestamp_format=yyyy-MM-dd HH:mm:ss
jmeter.save.saveservice.print_field_names=true
these values are the same in the jmeter.properties file as well, just to ensure I haven't lost anything...
I really can't work out why I can't get the jtl to include the headers, I have followed every guide I can find, and I seem to be doing it right..
Can someone point to me what I am missing, or include a zipped version of their jmeter with it all working that I can try and point my ant project to?
Hope someone can help.
Double check <jmeter> section of your build.xml file. Default JMeter Ant Task assumes XML out put format for .jtl result files so if you have the following line:
<property name="jmeter.save.saveservice.output_format" value="xml"/>
just comment it out or delete it and your issue should be resolved.
I don't think JMeter Ant Task respects overrides via user.properties file, it is better to use jmeterproperties attribute or explicitly specify the relevant configuration in the Ant build file like:
<target name="test">
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${testpath}/${test}.jmx"
resultlog="${testpath}/${test}.jtl">
<property name="jmeter.save.saveservice.output_format" value="csv"/>
<property name="jmeter.save.saveservice.print_field_names" value="true"/>
<property name="jmeter.save.saveservice.timestamp_format" value="ms"/>
<!--etc.-->
</jmeter>
</target>
I would also recommend choosing one of jmeter.save.saveservice.timestamp_format properties (either ms or yyyy-MM-dd HH:mm:ss as it might cause problems with the dashboard generation), having duplicate property names with different values is not a very good practice.
See Five Ways To Launch a JMeter Test without Using the JMeter GUI article for more information on running JMeter tests via Ant task and other ways of kicking off a JMeter test
I had noticed before you posted, but it is correct, the XML type was hardcoded in the build.xml, now I have changed that, all is working :)

filter list of directories using ant

I'm pretty new with ant, but I need to implement a filter for directories which starts fro example with 'example'. Lets suppose, that I have a folder
A:
-example.a
-example.b
-example.c
-test1
-test2
So, basically I want to get the list of folders, which starts with example.* and do some work with them...
I have this, but it does not work, the echo output is still empty
<dirset id="aa" dir="../../../../A" includes="example.*"/>
<property name="bb" refid="aa"/>
<echo>${bb}</echo>
Do you have any ideas, what I;m doing wrong?

Add multiple exclusion filters to OpenCover

I know how I can add 1 exclusion filter but, what if I want to exclude multiple projects at one? Do I repeat the "-" statement? or is it comma separated? Particularly, I'm trying to exclude Tests and Installer from the coverage calculation:
<property name="coverage.report.filter" value="+[${product}*]* -[${product}*Installer.Designer*]* -[${product}*Tests]* " />
Sorry, newbie to OpenCover :)
Thanks in advance!
If you type OpenCover.Console.exe on the command line I think you will see that it is accepts space separated filters. This is also detailed on the supplied documentation that should be installed with OpenCover - assuming you are using the download from GitHub.
The information is also available on the WIKI

Can I compile 2 build templates in the same solution?

I've got a class library project set up to do template editing and wanted to drop in another copy and customize it. However I get
The type 'TfsBuild.Process' already contains a definition for '_contentLoaded'
and 22 more of the same with the other _ names.
Also Type 'TfsBuild.Process' already defines a member called 'Process' with the same parameter types C:\Projects\MSBuild.Tasks\TechnicalDebtTaskLib\BuildProcessTemplate\obj\Release\CodeMetric.g.cs 62 16 BuildProcessTemplate
i've tried hand editing different parts of the xaml to try to find what key might need to be more unique, but no luck.
How do I work on multiple build process templates in the same solution or copy a process template that makes it unique?
Summary:
<activity mc:ignorable="sap" x:class="Tfs2008Template.Process" ... xmlns:this="clr-namespace:Tfs2008Template">
two tags must be changed for example:
<activity mc:ignorable="sap" x:class="Tfs2008Template2.Process" ... xmlns:this="clr-namespace:Tfs2008Template2">
For whatever reasoning the two tags that are related and need to be in sync are usually at the beginning and end of a very long list of attributes.
Full Article on my blog

Resources