Hi,
How can I insert a parameter into URL ?
here is a quick description what I want to do:
the request contains ReportID=1000 parameter in URL. This report can be deleted. I would like to do not specify a specific ReportID. Instead of this I would like to click on the first searched report on the page. How can I insert a parameter into URL ?
Thanks
How can I insert a parameter into URL ?
here is a quick description what I want to do:
the request contains ReportID=1000 parameter in URL. This report can be deleted. I would like to do not specify a specific ReportID. Instead of this I would like to click on the first searched report on the page. How can I insert a parameter into URL ?
Thanks
7 Answers, 1 is accepted
0
Hi Nastia,
Thank you for choosing to evaluate WebUI Test Studio!
Here's some info you might find useful:
http://tv.telerik.com/watch/automated-testing-tools/using-element-extraction-variables-webui-test-studio
Also, check out the section on DataDriven testing from our user guide (QA and Dev edition):
http://www.telerik.com/documents/automated-testing-tools/WebUITestStudioQAEditionStepByStep.pdf
http://www.telerik.com/download/TestStudio/Developer_edition.pdf
Could you please explain in more detail what you're trying to do. Also, if possible, please go ahead and include some screenshots.
Hope to hear from you soon!
Regards,
Thank you for choosing to evaluate WebUI Test Studio!
Here's some info you might find useful:
http://tv.telerik.com/watch/automated-testing-tools/using-element-extraction-variables-webui-test-studio
Also, check out the section on DataDriven testing from our user guide (QA and Dev edition):
http://www.telerik.com/documents/automated-testing-tools/WebUITestStudioQAEditionStepByStep.pdf
http://www.telerik.com/download/TestStudio/Developer_edition.pdf
Could you please explain in more detail what you're trying to do. Also, if possible, please go ahead and include some screenshots.
Hope to hear from you soon!
Regards,
Stoich
the Telerik team
0

nastia
Top achievements
Rank 1
answered on 17 Feb 2011, 05:06 PM
Thank you for a quick reply.
When I navigate to Edit screen a list of reports is displayed (a full list of ReportIDs that exist on the page comes in response). New reports can be added or some reports can be deleted. The next step that I want to do is to open any existent report on the page in edit mode.
The requested URL is: http://host/sitename/Edit.aspx?ReportId=21314&Action=edit
I want to add a parameter into this URL so the next time when I will run this script I will open the first searched report (because recorded ReportID can be deleted and then this test will fail). My question is it possible to add a parameter into URL like that: http://host/sitename/Edit.aspx?ReportId='parameter'&Action=edit. or any other ideas how to gather information from the page and add it to requests?
Thank you,
Nastia
When I navigate to Edit screen a list of reports is displayed (a full list of ReportIDs that exist on the page comes in response). New reports can be added or some reports can be deleted. The next step that I want to do is to open any existent report on the page in edit mode.
The requested URL is: http://host/sitename/Edit.aspx?ReportId=21314&Action=edit
I want to add a parameter into this URL so the next time when I will run this script I will open the first searched report (because recorded ReportID can be deleted and then this test will fail). My question is it possible to add a parameter into URL like that: http://host/sitename/Edit.aspx?ReportId='parameter'&Action=edit. or any other ideas how to gather information from the page and add it to requests?
Thank you,
Nastia
0
Hi Nastia,
it sounds like a Data-driven test is exactly what you need.
Check out the section on Data Driven testing from our user guide:
http://www.telerik.com/documents/automated-testing-tools/WebUITestStudioQAEditionStepByStep.pdf
Step by step here's what you need to do:
First bind your navigation step. Let's say we want to bind it to a variable named test. See screenshot 1.
Now you need to add a data source to your test. I'm going to add an Excel that looks like screenshot 2.
Now when you execute this test it will be executed 3 times for each value of the variable and that value will be used as a parameter in the navigation URL.
In the absolute same way you can setup your test to parametrize your reportID.
Let me know if you need further assistance with this!
Kind regards,
it sounds like a Data-driven test is exactly what you need.
Check out the section on Data Driven testing from our user guide:
http://www.telerik.com/documents/automated-testing-tools/WebUITestStudioQAEditionStepByStep.pdf
Step by step here's what you need to do:
First bind your navigation step. Let's say we want to bind it to a variable named test. See screenshot 1.
Now you need to add a data source to your test. I'm going to add an Excel that looks like screenshot 2.
Now when you execute this test it will be executed 3 times for each value of the variable and that value will be used as a parameter in the navigation URL.
In the absolute same way you can setup your test to parametrize your reportID.
Let me know if you need further assistance with this!
Kind regards,
Stoich
the Telerik team
0

nastia
Top achievements
Rank 1
answered on 17 Feb 2011, 07:35 PM
Right, but in this way I need to prepare all testing data before test execution (I need to know Report ID before I click Run button, right? ). I wanted to do it automatically (like you can do it in QTP): I create a new parameter and specify properties of it (e.g. XPath or boundaries of a parameter that I can take from a Source Page View or from a response); I add this parameter to URL and the program automatically adds a value of this parameter to the next request.
0
Hello nastia,
All the best,
Cody
No problem! You can use the same data binding approach that Stoich just showed you and combine it with our Extraction feature or even simply set the value in code to some calculated or predetermined value. Here's a video showing you how to use Element Extraction and variables. If you just want to set the value of the variable in code via calculations or a fixed constant you use code like this:
string
area =
"Atlanta"
;
SetExtractedValue(
"test"
, area);
Cody
the Telerik team
0

nastia
Top achievements
Rank 1
answered on 17 Feb 2011, 10:20 PM
Could you please explain how to do that step by step?
1. I highlighted Edit link and selected Quick Task menu
2. I have 3 available options for Extract method:
- Extract - text contains Edit
- Extract - element is visible
- Extract - element is not visible
Note: I don't have an option to extract a value from href
3. I selected Extract - text contains Edit
4. Click Edit link
5. Stop recording
- What should I do next to assign RecordID to a request ?
* I get "please select a property in the tree view above..." message when I try to assign created value in Data Driven Editor but I don't have properties in this tree.
Thank you in advance
1. I highlighted Edit link and selected Quick Task menu
2. I have 3 available options for Extract method:
- Extract - text contains Edit
- Extract - element is visible
- Extract - element is not visible
Note: I don't have an option to extract a value from href
3. I selected Extract - text contains Edit
4. Click Edit link
5. Stop recording
- What should I do next to assign RecordID to a request ?
* I get "please select a property in the tree view above..." message when I try to assign created value in Data Driven Editor but I don't have properties in this tree.
Thank you in advance
0
Hello Nastia,
I've recorder a Jing video demonstrating how to Extract a variable and then use it inside your test. Please check it out here:
http://www.screencast.com/users/TelerikTesting/folders/Jing/media/c85d61a1-9724-41d4-abc2-03975b07bf23
Let me know if you have any questions on this!
Regards,
I've recorder a Jing video demonstrating how to Extract a variable and then use it inside your test. Please check it out here:
http://www.screencast.com/users/TelerikTesting/folders/Jing/media/c85d61a1-9724-41d4-abc2-03975b07bf23
Let me know if you have any questions on this!
Regards,
Stoich
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!