I am seeking advise on how to use Environmental Variables. For example I am using a login function, which takes three parameters...
1.URL or the application
I need to make it reusable for different URL by using environmental variable or system variables if they are the same
Which application are you working in? Or what programming language is it based on?
This should be fairly simple in most applications or languages. You should be able to declare these as global, unless I'm not understanding what you're saying. Then you can embed them within a loop in order to test each ID/Pass pair against each URL.
Anyway, let me know what language you're working in and I'll see if I can help further.
That definitely helps. Sorry for not being clear enough.My application is hospitals related for registering and scheduling appointments for the patients. I am using QTP/QC business process testing and use VB Scripts for this.
Ok, well I've got no clue about QTP, but if you're using VBScript in it then you should be able to do something like:
<font class="small">Code:</font><hr /><pre>
Dim url(x) as Array
Dim user(x) as Array
Dim pass(x) as Array
For Each i in url
For Each y in user
For Each Z in pass
Go to URL(i)
Test this instance of user/pass against this URL
logwrite(Results of user(y)/pass(z) on url(i))
z= z + 1
y = y + 1
i = i + 1
This is just pseudocode, but should give you somewhere to start. Is this similar to what you are looking ot do? In this case you wouldn't need to set to a global, but you always could if that was a requirement. You would just set them within the loop if that was the case.