Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help on replacing the long lines..
#1
Solved: 11 Years, 4 Months ago
Hello. I have a problem with replacing the long lines and reusing the short lines in tests.
I have next approach:
'next line is written within GlobalVariables.qfl file, from where it is called in test scripts:
Code:
Set EnvironmentURL = Browser("URL:=http://test.st").Page("URL:=http://test.st")

In test scripts I am calling it like this, e.g.:
Code:
EnvironmentURL.WebEdit("name:=name_of_textfield").Set "test"

NOW: when I am running the tests what are using such kind of description, the system do not see all the time the 'EnvironmentURL' object. Why can be that?! Maybe the GlobalVariables.qfl should be saved in .vbs extension..
Please Help, it is a very important problem for me now..
Any idea can be very useful.
Thanks a lot!
#2
Solved: 11 Years, 4 Months ago
Hi Lotos,

You can make use of With....End With Statement.

For example,

Code:
With Browser().Page()
.WebEdit().Set ""
.Link().Click
End With
#3
Solved: 11 Years, 4 Months ago
Hi PrabhatN, thanks a lot..
I know that, but I really need the 'EnvironmentURL', because I have more than one, and I will add a comment for the line I don't need - and the object's variable vill be the same, for e.g. I will have:

Code:
Set EnvironmentURL = Browser("URL:=http://test.st").Page("URL:=http://test.st")
'Set EnvironmentURL = Browser("URL:=http://test.at").Page("URL:=http://test.at")
'Set EnvironmentURL = Browser("URL:=http://test.ut").Page("URL:=http://test.ut")

and the used one will be the uncommented line

Also I will be able to call this var in next way:

Code:
With EnvironmentURL
.WebEdit().Set ""
.Link().Click
End With

I will not be able to use Browser().Page() in all my functions and classes, because It will be need of change in a lot of lines, when I will test on another environment than the firstone - from this sample.
#4
Solved: 11 Years, 4 Months ago
The Most important problem is that 'EnvironmentURL' is not all the time visible or found by QTP when the tests are running. Maybe someone had such problems and can help me with that please..
#5
Solved: 11 Years, 4 Months ago
Create Objects. Should help.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
#6
Solved: 11 Years, 4 Months ago
Hi Lotos,

Did you associate the library file to your scripts.
Please do that if not done..
FileMenu--->Settings-->Resources-->Assocaiate function library
I tried your scenario , but I was not able to replicate your issue as I associated the function to my main script.

Please let me know if this doesn't work.

Regards,
Niveditha
#7
Solved: 11 Years, 4 Months ago
Thanks a lot guys, I've used XML, and everything is ok now!
#8
Solved: 11 Years, 4 Months ago
Hi,
In continuation to previous thread, I have a question on how to set dynamic address depending on the environment the Test Application will run.

We have multiple environment. How can I run the same test script by using dynamic URL?

Thanks in advance for the help.
Subha
#9
Solved: 11 Years, 4 Months ago
Subha -
There is no continuation here. Please open a new thread.
This thread is closed.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP Takes Long time to Run prasaad44 4 4,893 04-10-2014, 01:53 AM
Last Post: prasaad44
  select an item from a very long drop down list vijayendra.shukla 0 2,723 12-03-2013, 09:40 PM
Last Post: vijayendra.shukla
  popup window takes a long time bistritapcv 4 3,578 04-17-2013, 09:35 PM
Last Post: bistritapcv
  Creating multiple lines under a header - SAP Fredodo 7 5,844 01-02-2013, 04:54 PM
Last Post: Saleel Prabhu
  delete blank lines in excel cell QAVA 2 5,690 12-07-2012, 09:36 PM
Last Post: elango87

Forum Jump:


Users browsing this thread: 1 Guest(s)