Consulting

Results 1 to 4 of 4

Thread: Descriptive Programming

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Aug 2011
    Posts
    1
    Location

    Descriptive Programming


    Can I use variables with Descriptive Programming that are "Strings" or Numeric?

    My code (which returns null for the Set TableObj


    [VBA]For Gr = 1 to 13 'Loop thru GroupNames in Action1 file
    If DataTable.GetSheet("Action1").GetParameter("Execute").ValueByRow(Gr) = 1 then
    GroupName = DataTable.GetSheet("Action1").GetParameter("GroupName").ValueByRow(Gr)
    Browser("Wisdom").Page("WisdomLogin").Frame("parent").Link(GroupName).Click NumGr = Gr*2+3
    'Find table to extract data from
    Set TableObj = Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("Document Type.*", "name:=GroupName", "Index:=NumGr")
    Next[/vba]

    thx for any ideas?
    Last edited by Bob Phillips; 08-13-2011 at 03:14 AM. Reason: Added VBA tags
    Thx for your help.

    Lorena

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,443
    Location
    You need to explain what you mean by that first sentence.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Dec 2011
    Posts
    3
    Location
    Descriptive programming is used when we want to perform an operation on an object that is not present in the object repository. There can be various valid reason to do so. We will discuss them later in this article.

    How to write Descriptive Programming?

    There are two ways in which descriptive programming can be used

    1. By giving the description in form of the string arguments.
    2. By creating properties collection object for the description.

    When using programmatic descriptions from a specific point within a test object hierarchy, you must continue to use programmatic descriptions
    from that point onward within the same statement. If you specify a test object by its object repository name after other objects in the hierarchy have
    been described using programmatic descriptions, QuickTest cannot identify the object.

    For example, you can use Browser(Desc1).Page(Desc1).Link(desc3), since it uses programmatic descriptions throughout the entire test object hierarchy.
    You can also use Browser("Index").Page(Desc1).Link(desc3), since it uses programmatic descriptions from a certain point in the description (starting
    from the Page object description).

    However, you cannot use Browser(Desc1).Page(Desc1).Link("Example1"), since it uses programmatic descriptions for the Browser and Page objects but
    then attempts to use an object repository name for the Link test object (QuickTest tries to locate the Link object based on its name, but cannot
    locate it in the repository because the parent objects were specified using programmatic descriptions).

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Is this VBA? It's just that I've never seen the synax or the objects before (limited experience) and didn't recoginize it

    [VBA]
    For Gr = 1 To 13 'Loop thru GroupNames in Action1 file If DataTable.GetSheet("Action1").GetParameter("Execute").ValueByRow(Gr) = 1 Then GroupName = DataTable.GetSheet("Action1").GetParameter("GroupName").ValueByRow(Gr) Browser("Wisdom").Page("WisdomLogin").Frame("parent").Link(GroupName).Click NumGr = Gr*2+3 'Find table to extract data from Set TableObj = Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("Document Type.*", "name:=GroupName", "Index:=NumGr") Next
    [/VBA]

    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •