I am now currently working with web application using TC7. I am curious can we add a URL as a parameter?
For example I record test as a steps below:
1. open IE
2. type a URL ("http://www.test.com/default.aspx") --> it then open the page
3. click on the other page ("http://www.test.com/shoppingcart/default.aspx")
4. stop the recording
I would like this script to be running on the other site (e.g. "http://www.test1.com/"). So I need the URL ("http://www.test.com/") to become a parameter. the rest of the URL string ("shoppingcart/default.aspx") is dynamic but it always the same on both http://www.test.com and http://www.test1.com/.
The main purpose is when I want to run my script on "http://www.test1.com/" I just have to change the parameter and the rest code will follow it.
I do not have any Idea how to do that. Is there any of you that have the same problem with me or can help me?
I have 1 project suite and there are a lot of project inside it for example:
- Test Suite project (inside it there is a lot of project)
- project A
- project B
- project C
I need to declare the url variable (var url = "http://www.test.com/" in the project suite. because all the project inside it (Project A, Project B, Project C) is going to use it. Is there any idea how to declare it on general(on the project suite) so the project child is also can call the variable?
Thanks in advance [img]/images/graemlins/smile.gif[/img]
i also using parameters for different projects and iam doing it the folowing way:
i added a script to my project named constants.
in this script i declare everything needed globally.
i stored the script in a folder next to my project folder.
so here as an excample for your problem:
<ul type="square"> [*]ProjectA[*]ProjectB[*]ProjectC[*]GlobalScripts (containes Constants.scs)[/list]
in our excample you can write to the constants script
"var url = 'www.test.com';"
so every Project attaches the same file from the GlobalScripts Folder. (Use |attach|existing item)
That meand if you change the URL-Variable in any project,
it wil take effect for all projects (becaus it's the same file [img]/images/graemlins/wink.gif[/img] )
if you want to Use this variable in one of your scripts its important to include the scipt by writing
" //USEUNIT constants" on the top of your script.
after that you can use your variable anywhere in the script by typing for excample constants["url"]
hope this helps
Note: every post contains personal oppinions which are not coactive representing the oppinion of the ROSEN Group
Using: Testcomplete V 9.20.2460.7 - Jscript