Micro Focus QTP (UFT) Forums
Search criteria check based on some filter - 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: Search criteria check based on some filter (/Thread-Search-criteria-check-based-on-some-filter)



Search criteria check based on some filter - Ganta - 12-03-2009

Hi,
There is a filter for us to search the application that were submitted with in a certain range.when i clicked on search it gives list of application in a table format, it also gives the count of theApplications.Now i need to check,
1.The count number and the number of applications in the grid are same.
2.Search option based onone particular scenario for EgSadAll Matched).How can i check whether all the applicatons searched with status Matched.(there is a separate column for Status in the Grid).

Thanks
Ramakrishna


RE: Search criteria check based on some filter - nil - 12-04-2009

Code:
for i=0 to browser(111).page().frame().webtable().RowCount
          if browser(111).page().frame().webtable().GetCellData(i,coloumnNumber)="Matched" then
                      Flag=True
            else
                       Flag=False
                       Exit for
             Next

if Flag=True then
            Report Pass
else
            Report Fail
End if



This will help you

Thanks
~Nilesh


RE: Search criteria check based on some filter - MahalakshmiDevi - 12-04-2009

Code:
'get the numbe of application in the table
i=browser("bbb").page("bbb").frame("fff").webtable("kkk").RowCount
'comparing the count number and number app displayed in table
if (i=browser("bbb").page("bbb").WebEdit("tt").getROProperty "value"
msgbox "The count number and the number of applications in the grid are same."
pcount=0;fcount=0;
for x=0 tobrowser("bbb").page("bbb").frame("fff").webtable("kkk").RowCount -1
  if browser(111).page().frame().webtable().GetCellData(i,coloumnNumber)="Matched" then
     Pcount=Pcount+1
  else
     Fcount=Fcount+1
  end if
--This woud return number of pass and fail


RE: Search criteria check based on some filter - nil - 12-04-2009

Hi MahalaxamiDevi,

what is the logic behid


Code:
browser("bbb").page("bbb").frame("fff").webtable("kkk").RowCount -1

substracting 1 from Row Count


Can you Pls Explain?


Thanks


RE: Search criteria check based on some filter - Saket - 12-04-2009

@Everyone - please wrap your code to make the most more readable.


RE: Search criteria check based on some filter - v_selvam - 12-04-2009

For webtable, the The first object has an index(cell) of 0. So instead start from 1, you should start the 0 and substracting 1 from Row Count as end value.


RE: Search criteria check based on some filter - Ganta - 12-07-2009

Thank you all for Responding, i will try this and come back


RE: Search criteria check based on some filter - Ganta - 12-08-2009

Hi
Itried the code given by Nilesh, but i am facing problem like not able to identify the Object. So i just want to explain the Table and id's defined as there is no permission for me to attach the screen shot. I apolize for that.
The main Table is defined by the id:_ct10_cphContent_downloadAspxGrid_DXMainTable
Headers in the Table are defined as id : _ct10_cphContent_downloadAspxGrid_DXHeaderRow
The columns in the table are defined by id : _ct10_cphContent_downloadAspxGrid_DXTScol3(3-12)
The Rows are Defined as id : _ct10_cphContent_downloadAspxGrid_DXDataRow0(0-9)
Below is the summary to give the count and it is defined as
id : _ct10_cphContent_downloadAspxGrid_DXPageBottom.

The code used by me:
Code:
Browser("Company Downloads").Page("Company Downloads").WebList("_ctl0:cphContent:searchFilterC").Select "Last 30 Days"
Browser("Company Downloads").Page("Company Downloads").WebButton("Search").Click
for i=0 to Browser("Company Downloads").Page("Company Downloads").Frame("_ct10_cphContent_downloadAspxGrid_DXMainTable").WebTable("_ct10_cphContent_downloadAspxGrid_DXPageBottom").RowCount

        If  Browser("Company Downloads").Page("Company Downloads").Frame("_ct10_cphContent_downloadAspxGrid_DXMainTable").WebTable("_ct10_cphContent_downloadAspxGrid_DXTcol11").GetCellData(i, 11)="Matched" Then
            Flag=True
            Else
            Flag=False
        End If
Next
Before writing this code i have whole page to the repositary.Even then when i am executing this code it shows an error.Please some one help me...


RE: Search criteria check based on some filter - nil - 12-08-2009

which object you are not able to identify?
Try to highlight the object , check the Propertys of the object.




Thanks


RE: Search criteria check based on some filter - Ganta - 01-04-2010

Hi Nil,
Sorry for Responding Late.Here i have attached the code used in the test executed by me.Here it is not able to identify ("_ct10_cphContent_downloadAspxGrid_DXMainTable").