How to get current data source row number?

ParasofttoudayaParasofttoudaya Posts: 212 ✭✭
edited September 2017 in SOAtest

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??



  • benken_parasoftbenken_parasoft Posts: 617 ✭✭✭

    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}.

  • ParasofttoudayaParasofttoudaya Posts: 212 ✭✭

    Thanks Ben

    Thanks a lot for immediate response..


  • ParasofttoudayaParasofttoudaya Posts: 212 ✭✭

    I am getting -1 always :(

    public void message(Object input, ScriptingContext context){
    Application .showMessage(context.getDataSourceRowIndex())

    its always returning -1.

  • benken_parasoftbenken_parasoft Posts: 617 ✭✭✭
    edited September 2017

    In your Extension Tool, did you enable the "Use data source" box? Is the correct data source selected in the "Data Source" combo?

  • ParasofttoudayaParasofttoudaya Posts: 212 ✭✭

    It did worked, good guess. Thanks

Sign In or Register to comment.