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
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}.
0 -
Thanks Ben
Thanks a lot for immediate response..
Regards
Udaya0 -
I am getting -1 always
public void message(Object input, ScriptingContext context){
Application .showMessage(context.getDataSourceRowIndex())
}its always returning -1.
0 -
In your Extension Tool, did you enable the "Use data source" box? Is the correct data source selected in the "Data Source" combo?
1 -
It did worked, good guess. Thanks
0 -
does anyone know what syntax is used for Jython on this?
0 -
from com.parasoft.api import * def getRow(input, context): Application.showMessage(str(context.getDataSourceRowIndex()))
0