Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Dynamic URL in Scripts

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
We have a question regarding using dynamic URLS with WebKing. We have URLS which have unique identifiers on them which change with every run of each test. (i.e. http://www.foobar.com/strategy?id=554)



Is there a way to capture the id when it?s generated and then use it to compose the URL for subsequent use in the test scripts?



Thanks.

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    Yes, this can be accomplished by setting the "id" parameter to transient in WebKing. This tells WebKing to use the first value it sees in an address for that parameter for the remainder of that test run, updating with each test run.

    To set a parameter to transient, go to the Project Tree and select the site (for example, www.foobar.com) where the parameter is used. Select the "Misc" tab in the right-hand panel. Under this panel you will see a list of all the parameters that WebKing has encountered (none if you have not yet created a path using any parameters). Check the parameter that you wish to mark as transient, or add the parameter if it is not already in the list. It is recommended to add a parameter to this list and mark it as transient before creating a path that will use that parameter. If you are using "Expand Using Browser" to create your path, you may also want to choose "After Browsing" or uncheck "Path allows multiple sessions" when creating your path.

    Though this will work in most cases, each site is different and has different ways of generating these unique parameter values. If setting the parameter to transient is insufficient, please contact support at webkingsupport@parasoft.com where we can provide more specific support for your site.