Micro Focus QTP (UFT) Forums
GWT table property changing.....Need 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: GWT table property changing.....Need Help.. (/Thread-GWT-table-property-changing-Need-Help)



GWT table property changing.....Need Help.. - souvikghosh_diatm - 07-07-2011

Hii all....

i have a GWT application where there is a grid and some text fields on which i can provide value and filter the grid on basis of that value..

Here i need to check the row number coming in grid after a specific search. I have identified the grid-table property by adding it into Object Repository..
Drag-dropped that from OR and affix "RowCount" method provided by QTP on a table...

But i have seen that the table property(index) is getting changed on every run session that's why i am unable to get that rowcount in each case....it is not giving any run time error as that property is also present in my page, but it generating a fail statement that row not matched....This is because the table is not identified properly...The properties which is taking in object repository is "html Tag = TABLE" and the "index = 104"....this index is getting changed in each time....


My code is as follows....


Code:
If (DataTable.Value("Action", dtGlobalSheet )="GridRowCheck" ) Then


    
ExpRow = DataTable.Value("Expected_Rows", dtGlobalSheet )
ExpRow = Cint (ExpRow)
Wait(5)

Rowcame = [b]Browser("B").Page("P").WebTable("2064750").RowCount[/b]
Rowcame = Cint (Rowcame)

  If  Rowcame = ExpRow Then    
    Reporter.ReportEvent micPass, "Row Number Matched - bottom grid", "Proper row number came after selecting row from upper grid"

Else

   Reporter.ReportEvent micFail, "Row number not matched - bottom grid", "Expected row number is::"&ExpRow&" And Row Number Came after selecting from upper grid::"&Rowcame
End If

End If




This code is working properly for the particular run session on which the object of table has been added....But if i close browser and run again, then its not working.....Can any body tell me how to fix this problem??


I need any suggestion on URGENT basis......any suggestion or help will be appreciated...just do me a mail on souvikghosh.diatm@gmail.com

Thanks...


RE: GWT table property changing.....Need Help.. - rajpes - 07-07-2011

Instead of adding it to OR,
Use descriptive programming with "text" property of webtable if it is unique, otherwise use some more propertties like innerhtml

Code:
set desc=description.create
desc("micclass").value="WebTable"
desc("text").value="whatever it shows in spy"

Rowcame = Browser("B").Page("P").WebTable(desc).RowCount



RE: GWT table property changing.....Need Help.. - souvikghosh_diatm - 07-08-2011

------------------------------------------------------------------------
@@@ rajpes----


Thanks a lot for your suggestion....
i am giving an attachment of the spy result...actually i have added that table in OR to get the properties only...I will definitely remove it once i get the unique properties......these are the properties.... so can u plz tell me that which property should i take?????

Or after seeing these can you plz tell me if there is any other option....the showing index value is getting changed by different run session.....







------------------------------------------------------------------------

Thanks a lot for your suggestion....
i am giving an attachment of the spy result...actually i have added that table to get the properties only....these are the properties.... so can u plz tell me that which property should i take?????

Or after seeing this can you plz tell me if there is any other option....the showing index value is getting changed by different run session.....


RE: GWT table property changing.....Need Help.. - rajpes - 07-08-2011

You have added that object in OR doesn't mean it should work for next run session.
Delete that object from OR and change that line using DP as i suggested earlier.

try this

Code:
set desc=description.create
desc("micclass").value="WebTable"
desc("text").value=".*Kunst.*"

Rowcame = Browser("B").Page("P").WebTable(desc).RowCount



RE: GWT table property changing.....Need Help.. - souvikghosh_diatm - 07-08-2011

thank you very much for such idea and suggestion...i have applied that and it is running successfully with proper checking of row......thanks a lot once again....


Just tell me one more thing....does this particular approach known as Dynamic DP?????


Please let me know....


RE: GWT table property changing.....Need Help.. - rajpes - 07-08-2011

Welcome,
Yes it is dynamic DP
In static dp only single line contains all properties defined.