Results 1 to 20 of 25

Thread: Descriptive Programming Concepts - Good thread for Starters

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    Re: Descriptive Programming Concepts - Good thread for Starters

    Hi anshoo, it is very useful techniques to write a dp for starters.
    I am also giving some techniques for dp....
    Here i am giving dp to click on a specified button....

    using object repository

    '''''''''''''''''''1st method'''''''''''''''''''''
    window("flight reservation" ).winbutton( "update order").click 'common method

    '''''''''''''''''''''2nd method'''''''''''''''''''''''
    set wndobject=window( "flight reservation" ) ' assigning window object to an object variable
    wndobject.winbutton ("update order").click ' following normal syntax ( click on a button)

    ''''''''''''''''''''''''''3rd method''''''''''''''''''''''''''''
    set btnobject=window( "flight reservation" ).winbutton( "update order") ' assigning button object to an object variable
    btnobject.click ' clicking on button using button object variable

    ''''''''''''''''''4th method'''''''''''''''''''''''''''
    with window("flight reservation" ) ' using with statement .winbutton(" update order").click
    end with

    using dp:

    '''''''''''''''''1st method''''''''''''''''''''''''Without Object Repsitory

    window("text: =flight reservation" ).winbutton( "text:=&update order").click ' descriptive programming

    '''''''''''''''''''2nd method''''''''''''''''''''''''''
    set odes=description. Create ' creating a description object
    odes("nativeclass" ).value=" button" ' assigning description to the description object
    odes("text") .value="&update order"
    window("text: =flight reservation" ).winbutton( odes).click ' clicking on button using the created description object

    ''''''''''''''''''3rd method''''''''''''''''''''''''''''
    set odes=description. Create ' creating a description object
    set btnobjlist=window( "text:=flight reservation" ).childobjects( odes) ' 'flitering the objects
    for objindex=0 to btnobjlist.count- 1 propval=btnobjlist( objindex) .getroproperty( "text") ' get property value from object if propval="&update order" then ' compare property value btnobjlist(objindex ).click ' click on identified object exit for ' exit for loop after clicking on the button end if
    next

    ''''''''''''''''''4th method'''''''''''''''''''''
    public const wndflight="text: =flight reservation" ' assigning window object description to a constant
    public const btnupdate="text: =&update order" ' assigning button object description to a constant window(wndflight) .winbutton( btnupdate) .click ' click on a button using description constants '''''''''''''''

    If any body is having other techniques please post them...

    Thank you
    Arun Singh Rajaputra

    Last edited by rajaputra; 02-19-2008 at 01:01 PM.

  2. #2

    Re: Descriptive Programming Concepts - Good thread for Starters

    Hi
    Am new to QTP.Have little knowledge of the same.Can any one please help me in learning QTP by giving me approriate links.Also I want to know about VB Scripting used in QTP.

    Thanks
    Nidhi


  3. #3
    Junior Member
    Join Date
    May 2009
    Answers
    1

    Re: Descriptive Programming Concepts - Good thread for Starters

    Quote Originally Posted by rajaputra View Post
    hi anshoo, it is very useful techniques to write a dp for starters. I am also giving some techniques for dp.... Here i am giving dp to click on a specified button.... using object repository '''''''''''''''''''1st method''''''''''''''''''''' window("flight reservation" ).winbutton( "update order").click 'common method '''''''''''''''''''''2nd method''''''''''''''''''''''' set wndobject=window( "flight reservation" ) ' assigning window object to an object variable wndobject.winbutton ("update order").click ' following normal syntax ( click on a button) ''''''''''''''''''''''''''3rd method'''''''''''''''''''''''''''' set btnobject=window( "flight reservation" ).winbutton( "update order") ' assigning button object to an object variable btnobject.click ' clicking on button using button object variable ''''''''''''''''''4th method''''''''''''''''''''''''''' with window("flight reservation" ) ' using with statement .winbutton(" update order").click end with using dp: '''''''''''''''''1st method''''''''''''''''''''''''without object repsitory window("text: =flight reservation" ).winbutton( "text:=&update order").click ' descriptive programming '''''''''''''''''''2nd method'''''''''''''''''''''''''' set odes=description. Create ' creating a description object odes("nativeclass" ).value=" button" ' assigning description to the description object odes("text") .value="&update order" window("text: =flight reservation" ).winbutton( odes).click ' clicking on button using the created description object ''''''''''''''''''3rd method'''''''''''''''''''''''''''' set odes=description. Create ' creating a description object set btnobjlist=window( "text:=flight reservation" ).childobjects( odes) ' 'flitering the objects for objindex=0 to btnobjlist.count- 1 propval=btnobjlist( objindex) .getroproperty( "text") ' get property value from object if propval="&update order" then ' compare property value btnobjlist(objindex ).click ' click on identified object exit for ' exit for loop after clicking on the button end if next ''''''''''''''''''4th method''''''''''''''''''''' public const wndflight="text: =flight reservation" ' assigning window object description to a constant public const btnupdate="text: =&update order" ' assigning button object description to a constant window(wndflight) .winbutton( btnupdate) .click ' click on a button using description constants ''''''''''''''' if any body is having other techniques please post them... Thank you arun singh rajaputra
    hi, i have been trying to get the text value of a webelement. i have written description for the object, fetched objects matching the description and used getroproperty to get text value: set objwebelement = description.create() objwebelement("micclass").value = "webelement" objwebelement("html tag").value = "td" set lists = browser("implement").page("useragingreport").childobjects(objwebelement) numberoflists = lists.count() for i = 0 to numberoflists - 1 dtlastlogindate = lists(i).gerroproperty("innertext ") if some action to be taken end if next but i'm getting error something like: this object cannot use getropropety function


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact