Micro Focus QTP (UFT) Forums
How to get the dynamic value displayed on the page - 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: How to get the dynamic value displayed on the page (/Thread-How-to-get-the-dynamic-value-displayed-on-the-page)



How to get the dynamic value displayed on the page - geethwind - 07-30-2009

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


RE: How to get the dynamic value displayed on the page - supputuri - 07-30-2009

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.


RE: How to get the dynamic value displayed on the page - venkatbatchu - 07-30-2009

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


RE: How to get the dynamic value displayed on the page - supputuri - 07-30-2009

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.


RE: How to get the dynamic value displayed on the page - geethwind - 07-31-2009

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?