PDA

View Full Version : Descriptive Programming



mv8167
08-12-2011, 08:27 AM
:dunno
Can I use variables with Descriptive Programming that are "Strings" or Numeric?

My code (which returns null for the Set TableObj


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

thx for any ideas?

Bob Phillips
08-13-2011, 03:57 AM
You need to explain what you mean by that first sentence.

frdq19
12-12-2011, 11:28 PM
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).

Paul_Hossler
12-20-2011, 05:01 PM
Is this VBA? It's just that I've never seen the synax or the objects before (limited experience) and didn't recoginize it



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


Paul