Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Desptive Programming for YahooMail
#1
Solved: 10 Years, 8 Months ago
After reading Ankur's post on Descriptive Programming I tried to write a small script for the yahoomail...script as follows
<<<<
Code:
Dim USERNAME
Set USERNAME = Description.Create
USERNAME("html tag").value = "INPUT"
USERNAME("name").value = "test.*"
SystemUtil.Run("www.yahoomail.com")
Browser("www.yahoomail.com").page("www.yahoomail.com").webedit("USERNAME").Set"testing"
>>>

On script run error message displayed as "object 'browser' is not found in the object repository"
1) Using descriptive programming we can run the script with out having obejct in OR right?
2) Can any of you suggest the methods for correcting the script?
3) Can I use complete web address in the Browser name[as I used www.yahoomail.com]?

Thanks,
Reply
#2
Solved: 10 Years, 8 Months ago
you have to specify the property name and its value. (You can use Object Spy to determine the properties and their values)
Example:
Code:
Browser("name:=google").Page("title:=google").webedit("html Tag:=Input","name:=q").Set "test"
Reply
#3
Solved: 10 Years, 8 Months ago
Hi,
Can you explain me why we write 'name' and 'title' in DP.title.The script
Browser("google").Page("google").webedit("q").Set "test" will work fine if we add all the items in OR .Please correct me if i am wrong.
Regards.
Sherin
Reply
#4
Solved: 10 Years, 8 Months ago
@sherinvg: what Niranjan told is descriptive programming and what you are doing is normal recording using object repository. These are two different approaches ( though it is always possible to mix them)
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#5
Solved: 10 Years, 8 Months ago
hi,
why i asked this question is i tried both the ways ,
First i wrote the script
Code:
'Browser("google").Page("google").webedit("q").Set "test" '
and added the objects in OR (i didnt do recording here) and i could execute the code.
Later i wrote the code
Code:
'Browser("name:=google").Page("title:=google").webedit("html Tag:=Input","name:=q").Set "test" '
, added objects in OR and then i executed the code.

Both the ways i could execute the code that too without doing normal recording.My doubt is can i say the first script which i wrote here is descriptive programming.

Thanks/Regards
Sherin
Reply
#6
Solved: 10 Years, 8 Months ago
No. The first script does not come under descriptive programming.
For DP: you manually supply Object properties and its values.

In the second script, it will work even if you dont add objects to OR. (Bcoz we are supplying all the properties and values for all the objects in the heirarchy).
You can make use of OR in the following case,
Code:
Browser("google").Page("google").webedit("html Tag:=Input","name:=q").Set "test"
In this case, we are using Browser and page objects from OR and webedit thru DP.
Reply
#7
Solved: 10 Years, 8 Months ago
hi,
thanks for your reply.it was very useful for me,thanks a lot
one more doubt.when we use DP what all properties we need to include ,for example html Tag,name,title...please help
Thanks and regards
Sherin
Reply
#8
Solved: 10 Years, 8 Months ago
As far as I know, you can use any property(and its value) that is available when you spy over the object (using object spy).
One thing to note is avoid using the properties which have numerical values...
example: height, width, abs_y, etc
Reply
#9
Solved: 10 Years, 8 Months ago
Hi,
Is that a mandatory that ,we need to include those properties in DP which we have added as mandatory and assitive properties in object identification window or else the reverse ?
Thanks and Regards
Sherin
Reply
#10
Solved: 10 Years, 8 Months ago
Its not mandatory that you have to only include those.
You can include any properties you want.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  inbox link in yahoomail site mansalata 2 2,777 05-02-2012, 12:51 PM
Last Post: sshukla12

Forum Jump:


Users browsing this thread: 2 Guest(s)