locked
How to paramterize a URL using a data source in a web test? RRS feed

  • Question

  • Hi I have a URL like bellow

    https://test/{{parameter}}.com

    I want to parameterize the 'parameter'  of the url  from the data source added in the web test .

    Is it possible ?


    Abhisek Biswal

    Friday, June 9, 2017 12:15 PM

Answers

  • Yes, do it exactly as you show in the question. But you will need to type the full text of the data source access into the properties field of the url.

    One way I have used to get the full text is to add a header field to a request and bind its value to the wanted datasource field. View the properties of that field and copy the text of its value. It will be something like "Datasource1.TheFileName#csv.TheFieldName". View the properties of the url and edit its value to be "https://test/{{Datasource1.TheFileName#csv.TheFieldName}}.com". By copying from the temporarily added header field you have text that can be pasted into the field between the curly braces. Delete the header field as it was just used to get the full text of the datasource field name.

    If the value is not found when the test is run then, firstly, check the spelling and capitalisation. Second, check the values shown in the context tab of the web test results. Lastly, you may need to modify the properties of the datasource to have "Select columns" set to "Select all columns".

    Regards

    Adrian



    Friday, June 9, 2017 1:13 PM
  • Hi Abhisek Biswal,

    Adrian's suggestion is correct, you need to bind the data source directly in your URL, and then set the correct data source property.

    If you get any latest information, please feel free to let us know.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by AbhisekB Thursday, June 15, 2017 11:34 AM
    Thursday, June 15, 2017 2:35 AM

All replies

  • Yes, do it exactly as you show in the question. But you will need to type the full text of the data source access into the properties field of the url.

    One way I have used to get the full text is to add a header field to a request and bind its value to the wanted datasource field. View the properties of that field and copy the text of its value. It will be something like "Datasource1.TheFileName#csv.TheFieldName". View the properties of the url and edit its value to be "https://test/{{Datasource1.TheFileName#csv.TheFieldName}}.com". By copying from the temporarily added header field you have text that can be pasted into the field between the curly braces. Delete the header field as it was just used to get the full text of the datasource field name.

    If the value is not found when the test is run then, firstly, check the spelling and capitalisation. Second, check the values shown in the context tab of the web test results. Lastly, you may need to modify the properties of the datasource to have "Select columns" set to "Select all columns".

    Regards

    Adrian



    Friday, June 9, 2017 1:13 PM
  • Hi Abhisek Biswal,

    Adrian's suggestion is correct, you need to bind the data source directly in your URL, and then set the correct data source property.

    If you get any latest information, please feel free to let us know.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by AbhisekB Thursday, June 15, 2017 11:34 AM
    Thursday, June 15, 2017 2:35 AM