How to get current data source row number?

Hi Team,
I came across a situation where i need to get data source current row number in xpath reg-ex.
Let me know how to fetch it??
Thanks
Udaya
Tagged:
0
Hi Team,
I came across a situation where i need to get data source current row number in xpath reg-ex.
Let me know how to fetch it??
Thanks
Udaya
Comments
See com.parasoft.api.ScriptingContext.getDataSourceRowIndex(). You'll have to call this from a script or Extension Tool. Your script could store the value into a test suite variable using ScriptingContext.setValue(String variableName, String value) and then your XPath can reference the variable using ${varName}.
Thanks Ben
Thanks a lot for immediate response..
Regards
Udaya
I am getting -1 always
public void message(Object input, ScriptingContext context){
Application .showMessage(context.getDataSourceRowIndex())
}
its always returning -1.
In your Extension Tool, did you enable the "Use data source" box? Is the correct data source selected in the "Data Source" combo?
It did worked, good guess. Thanks