Desptive Programming for YahooMail - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Desptive Programming for YahooMail (/Thread-Desptive-Programming-for-YahooMail) Pages:
1
2
|
Desptive Programming for YahooMail - Akhila - 04-15-2008 After reading Ankur's post on Descriptive Programming I tried to write a small script for the yahoomail...script as follows <<<< Code: Dim USERNAME 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, RE: Desptive Programming for YahooMail - niranjan - 04-15-2008 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" RE: Desptive Programming for YahooMail - sherinvg - 04-16-2008 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 RE: Desptive Programming for YahooMail - Ankur - 04-16-2008 @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) RE: Desptive Programming for YahooMail - sherinvg - 04-17-2008 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" ' Later i wrote the code Code: 'Browser("name:=google").Page("title:=google").webedit("html Tag:=Input","name:=q").Set "test" ' 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 RE: Desptive Programming for YahooMail - niranjan - 04-17-2008 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" RE: Desptive Programming for YahooMail - sherinvg - 04-19-2008 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 RE: Desptive Programming for YahooMail - niranjan - 04-20-2008 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 RE: Desptive Programming for YahooMail - sherinvg - 04-20-2008 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 RE: Desptive Programming for YahooMail - niranjan - 04-20-2008 Its not mandatory that you have to only include those. You can include any properties you want. |