This is a migrated thread and some comments may be shown as answers.

Creating a NavigateTo with multiple variables

3 Answers 113 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sander
Top achievements
Rank 1
Sander asked on 15 May 2013, 10:24 AM
Hi,

This seems like a common problem, but watching video's and reading other posts hasn't helped me solve it completely.

1. I want to be able to execute a webtest for 2 baseurl's. (production.xxx.com and stage.xxx.com). I've done this using a baseurl (no problem).

2. I want to be able to execute the same webtest for different projects:
Production.xxx.com/projects/1245/bla.aspx
Production.xxx.com/projects/1248/bla.aspx

(..by replacing a part of the navigateurl (the projectID))

I want to test elements of around 50 pages, per project.
A solution I could think of was also databinding the navigateUrl (/projects/1248/bla.aspx), but that means I have to create 50 records in my datasource for each navigation. So this doesn't seem feasible.

--> I'm an unexperienced scripter, so I'd love some basic scripting knowledge (How to create a navurl based on multiple variables from a datasource).

Do you have a different solution, or can you help me script this?

Kind regards,
Sander van Mourik

3 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 15 May 2013, 11:24 AM
Hi Sander,

Unfortunately you need to change the URL/BaseURL every time you want to execute on a different server/page.

An option is to data bind the navigate URL as you mentioned.

Please read more about data binding here and how to achieve it.

Also please check out how to run a Test Against Multiple Environments.

Hope this helps.

All the best,
Boyan Boev
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Sander
Top achievements
Rank 1
answered on 15 May 2013, 12:10 PM
Hi Boyan,

Thanks for your quick reply.

It doesn't really help as I'll have to add every single navigation url to my datasource, resulting in a huge file and making my test less maintainable.
What i'm looking for is a line of script which basically does;
NavigateTo a URL consisting of [baseurl (from datasource)] /projects/ [projectid (from datasource)] /somepage/bla.aspx

Resulting in navigation to
http://production.xxx.com/projects/1245/somepage/bla.aspx

Basically what this user is explaining in her first post. I just can't get that piece of script to run.
Can you provide an example of this?

Regards,
Sander
0
Boyan Boev
Telerik team
answered on 15 May 2013, 01:23 PM
Hi Sander,

If you want data bind different parts of the url this should be done in a coded step:

ActiveBrowser.NavigateTo("http://" + Data["BaseURL"] + "/project/" + Data["ProjectID"],  true);

Here is the video with the entire process from scratch.

Let me know if you need further assistance.

Kind regards,
Boyan Boev
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Sander
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Sander
Top achievements
Rank 1
Share this question
or