qaf icon indicating copy to clipboard operation
qaf copied to clipboard

key metadata is not optional when filter is being used in QAF

Open nagaraj2709 opened this issue 5 years ago • 2 comments

QAF Version: 2.1.14

Problem Statement: I'm getting an exception (mentioned below) when trying to use filter option in QAF Gherkin.

Examples: {'datafile':'Test.xls','sheetName':'TestSheet', 'filter':'run==1'}

[QAFInetrceptableDataProvider] - Applying Filter run==1 [Error] com.qmetry.qaf.automation.testng.DataProviderException: Unable to apply filter on data-set Caused by: java.lang.NullPointerException: key can not be null

But on passing key meta-data in Examples section it worked without excception. Is it mandate that we need key meta-data and configure the same in excel sheet?

Examples: {'datafile':'Test.xls','sheetName':'TestSheet', 'filter':'run==1', 'key':'ABC'}

nagaraj2709 avatar Dec 31 '19 12:12 nagaraj2709

This doesn't looks bug. I did try to reproduce with excel with data provide in documentation example. Found working fine with both GherkinScenarioFactory and BDDTestFactory2

feature file with Gherkin syntax executed using com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory as well as com.qmetry.qaf.automation.step.client.text.BDDTestFactory2

	Scenario Outline: scenario_description 1
	Given COMMENT: "some precondition ${recId}"
	And COMMENT: "something with ${Username}"
	Then COMMENT: "check ${Isvalid} is the output"			
	
	Examples: {'datafile':'resources/testdata.xls', 'filter':'Username=="test"'}

feature file in BDD2 syntax executed using com.qmetry.qaf.automation.step.client.text.BDDTestFactory2

	@filter:Username=='test'
	@dataFile:resources/testdata.xls
	Scenario Outline: scenario_description 1
	Given COMMENT: "some precondition ${recId}"
	And COMMENT: "something with ${Username}"
	Then COMMENT: "check ${Isvalid} is the output"

cjayswal avatar Jan 21 '20 03:01 cjayswal

@nagaraj2709 will you please provide more details on steps to reproduce the issue?

cjayswal avatar Sep 04 '20 23:09 cjayswal