Micro Focus QTP (UFT) Forums

Full Version: help me understand the mentioned vb script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear friends ,

Please explain the part of the script in Bold.

Code:
Const constBaseWebEditIndex = 9

Dim intIndex,vectPartNumber

vectPartNumber = Split( DataTable( "Part_Number", "MR_Creation" ), "," )

For intIndex = 0 To UBound( vectPartNumber )
    Browser("Browser").Page("HUB").WebButton("Add").Click
    Wait(4)

    Browser("Browser").Page("HUB").[b]WebEdit("name:=WebEdit",    "Index:=" & constBaseWebEditIndex + intIndex*3 )[/b].Set        Trim( vectPartNumber( intIndex ) )

Next
Hi,
This is Descriptive Programming, but you mentioned, name:=WebEdit, which is not right,
WebEdit is ClasssName or Native Class and other is Index,
You trying to use 2 properties to identify the object without OR.
Karthik -
There is no vbscript in the question you have asked. As ramesh pointed out you are dealing with a Descriptive programming instead of using a Object from the Object Repository.From the code i understand that you are trying to set a value in a particular webedit on the page whose index matches "IntIndex*3" value. This is a good approach when you have multiple objects and you want to work on one of them. Instead of adding all the objects on to the Object Repository it is handy to use this approach.

Let me know if this helps.