Microsoft Excel Webinar

Results 1 to 4 of 4

Thread: Descriptive Programming

  1. #1

    Descriptive Programming


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

    My code (which returns null for the Set TableObj


    VB:
    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 
    
    
    Formatting tags added by mark007
    thx for any ideas?
    Last edited by xld; 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 xld's Avatar
    Joined
    Apr 2005
    Posts
    23,554
    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
    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
    Is this VBA? It's just that I've never seen the synax or the objects before (limited experience) and didn't recoginize it

    VB:
    [LEFT][COLOR=blue]For[/COLOR] Gr = 1 [COLOR=blue]To[/COLOR] 13 [COLOR=darkgreen] 'Loop thru GroupNames in Action1 file[/COLOR]    [COLOR=blue]If[/COLOR] DataTable.GetSheet("Action1").GetParameter("Execute").ValueByRow(Gr) = 1 [COLOR=blue]Then[/COLOR]         GroupName = DataTable.GetSheet("Action1").GetParameter("GroupName").ValueByRow(Gr)         Browser("Wisdom").Page("WisdomLogin").Frame("parent").Link(GroupName).Click   NumGr = Gr*2+3          [COLOR=darkgreen]'Find table to extract data from[/COLOR]        [COLOR=blue]Set[/COLOR] TableObj = Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("Document Type.*", "name:=GroupName", "Index:=NumGr")     [COLOR=blue]Next[/COLOR] [/LEFT]
    
    
    Formatting tags added by mark007
    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
  •