Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save the "name" of a wbfgrd to a vbscript variable

Status
Not open for further replies.

kdjonesmtb2

Technical User
Nov 19, 2012
93
US
Hello,
tt
I looking for a way to save the "name" of a wbfgrd to a vbscript variable. I want to be able to utilize a datatable to select a check box in wbfgrid if the strvalue in the grid equals the string value of a column in a datatable


I am using the HP QTP test tool which utilizes vbscript

The last 13 bytes of the WbfGrid below change with access of the Grid.

Is there command to get the value of the Wbfgrid and save it off?

Dim intRowCount

intRowCount=Browser("ABN-NHP-APP-T15 - QNXT").Window("Select Provider by Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT_1362412170050").RowCount()





'Check the availablity of respective data in the Grid
For intRow=1 to intRowCount

'Get the AffiliationID from grid
strName=Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation").Page("Select a Pay-To Affiliation").Frame("Frame").WbfGrid("dgAffil_DT_1362412170050").getcelldata(intRow,2)


'Pass the dummy error flag
blnErrorFlag=True

'Comparing with input data

If strName=DataTable.Value("Affiliationid","Global") Then

Reporter.reportEvent micPass,"Data is matching","Expected Data is:"&DataTable("Affiliation","Global")&" and Actual data is:" &strName




blnErrorFlag=False

'NOW HERE AFTER COMPARISON I WANT TO CLICK THE DATA . I AM NOT GETTING HOW TO TAKE COMPARED DATA AND CLICK THAT
'Browser("New Incident").Page("NewIncident").Frame("ifrmLookup").WbfGrid("EHDataGrid1").???????????? (AFTER wbfGrid THIS WHAT SCRIPT TO WRITE to click the data which I am comparing?)

'Browser("ABN-NHP-APP-T15 - QNXT").Window.("Select a Pay-To Affiliation").Page("Select a Pay-To Affiliation").Frame("Frame").WbfGrid("dgClmNetwork_DT_1362163099643").Select intRow



'Browser("New Incident").Page("NewIncident").Frame("ifrmLookup").WbfGrid("EHDataGrid1").Select intRow

Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT_1362412170050").Select intRow
On Error Resume Next

'To exit/move out from the loop
Exit For

End If

'Check the error flog is true
If blnErrorFlag=True Then

Reporter.reportEvent micFail,"Data is mismatching","Expected Data is:"&DataTable("Affliationid","Global")&" and Actual data is:" &strName

End If

Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top