ripplegupta
9 years agoContributor
How to get type of data source step like jdbc or excel via groovy
Hi, I have question that how to get type used in data source step in groovy like jdbc, data connection, excel etc.
If (getTestStep.config.type == "datasource")
As per above script, if condition can validate if step is of type data source but what if i want to validate if datasource is of type jdbc ?
If (getTestStep.config.type == "datasource")
As per above script, if condition can validate if step is of type data source but what if i want to validate if datasource is of type jdbc ?
Take a look at the getDataSource() method of the class WsdlDataSourceTestStep, this returns a DataSource object which has a getType() method.
I've never had to use this so don't know if this is the most approprate solution for you, but perhaps its a good place to start.