Micro Focus QTP (UFT) Forums
Rowcount: getcelldata : compare : click on true result. Please help - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Rowcount: getcelldata : compare : click on true result. Please help (/Thread-Rowcount-getcelldata-compare-click-on-true-result-Please-help)



Rowcount: getcelldata : compare : click on true result. Please help - shamak - 02-11-2011

Hi please see the below code and somebody help me.....


I am trying to take rowcount, compare the data with input data from datatable and if the result is true then i want to click the particular cell or row. Here i am able to get data and compare but not getting how to click.

Clickcell is not working... please give me some idea....
Code:
intRowCount=Browser("New Incident").Page("New Incident").Frame("ifrmLookup").WbfGrid("EHDataGrid1").RowCount()


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

'Get the Loginid from grid
   strName=Browser("New Incident").Page("New Incident").Frame("ifrmLookup").WbfGrid("EHDataGrid1").getcelldata(intRow,2)


'Pass the dummy error flag
     blnErrorFlag=True

'Comparing with input data
      
  If strName=DataTable.Value("Loginid",1) Then

        Reporter.reportEvent micPass,"Data is matching","Expected Data is:"&DataTable("Loginid",1)&" 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
Code:
'Browser("New Incident").Page("NewIncident").Frame("ifrmLookup").WbfGrid("EHDataGrid1").???????????? (AFTER wbfGrid THIS WHAT SCRIPT TO WRITE to click the data which I am comparing?)

          '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("Loginid",1)&" and Actual data is:" &strName

     End If

Next



RE: Rowcount: getcelldata : compare : click on true result. Please help - basanth27 - 02-16-2011

Try this,

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