Micro Focus QTP (UFT) Forums

Full Version: How to get the dynamic value displayed on the page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

My web page displays the search results and a text at the top of the results table as " 100 records" , " 200 records"..etc.. basically the number of records returned from the Search,

Now I have to capture that text for my testing.

This text is mentioned in the table row inside the <TD> tag..

i was able to capture the web element from the Active screen for that element, but i am not sure which property to use to extract the value


The screen looks like this

--------------------------------------------------------------------
Summary 100 records
--------------------------------------------------------------------


Here is my code: this returns the value "Summary" but i am looking to get the value as "100 records"


Code:
txtstr1 = Browser("MDC").Page("MDC").Frame("mdma_bottom").WebElement("pgrSdpSummary:Page:ddlPage").GetROProperty("text")

any help??

Thanks,
Geetha
hi Geetha,

i think the data i.e. Summary 100 records in displaing in the WebTable. If it is so, then we can handle the situation.

Please let me know whether that's a table or not, Based on your input i will provide the solution.
Hi King,
Could u please tell me , how to fetch the dynamic values from the web page and please see the attachment for the better understanding
Hi venkatbatchu ,

After you click on the particular letter or <All>, as the data i.e. "7 Record displayed..." will display in the webTable, you can capture the dynamic value easly by use "GetCellData" method.

Let me know if you need any more info.
Hi ,

my issue is some what different now..

Now my code shows the 500 records in the msg box..but it always works out if the inout returns 500 records only,if i give a different search criteria..it says object not defined since it tries to return other number than 500 records..i realized, the regular expression needs to be there for my code.. but i am not sure how i can do that.

here is my code

Code:
Browser("MDC").Page("MDC").Frame("mdma_bottom").Link("POD").Click
'Browser("MDC").Page("MDC").Frame("mdma_bottom_2").WebEdit("ClassName:=WebEdit", "Name:=txtSearchCriteria").Set "geetha"
Browser("MDC").Page("MDC").Frame("mdma_bottom_2").WebEdit("txtSearchCriteria").Set "kim"
Browser("MDC").Page("MDC").Frame("mdma_bottom_2").WebButton("Search").Click
Browser("MDC").Page("MDC").Frame("mdma_bottom_2").WebList("ddlSearchType").Select "Customer Name"
Browser("MDC").Page("MDC").Frame("mdma_bottom_2").WebButton("Search").Click
Browser("MDC").Page("MDC").Sync

txtstr1 = Browser("MDC").Page("MDC").Frame("mdma_bottom_2").WebElement("pgrSdpSummary:Page:ddlPage").GetROProperty("innertext")
'WebElement("pgrSdpSummary:Page:ddlPage").Object.innerHTML

msgbox txtstr1


any help?