Micro Focus QTP (UFT) Forums
Retrieving default value from embedded webedit from webtable - 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: Retrieving default value from embedded webedit from webtable (/Thread-Retrieving-default-value-from-embedded-webedit-from-webtable)



Retrieving default value from embedded webedit from webtable - indranilgoswamimcb - 01-11-2012

I need to retrieve the default value from webedit which is embedded in a webtable and compare the value with some standard value. Below given is the code:

Code:
Set oPage = browser("Creationtime:=0").Page("title:=.*")
On error resume next

Set OTableCount=Description.Create
OTableCount("micclass").value="WebTable"
Set OTableIndex=oPage.ChildObjects(OTableCount)

For i=0 to OTableIndex.count-1
            iRows=OTableIndex(i).rowcount
            iCols=OTableIndex(i).getroproperty("cols")
  For j=1 to iRows
  For k=1 to iCols
Set abc=OTableIndex(i).childitem(j,i,"WebEdit",0)

If abc.getroproperty("value")="1,000.00" then
    
print "abc"
'do some things

end if
next
next
next


To summarize, the code above should go through all the webtables in a page.It verifies whether the cell of the webtable has an webedit.If the webedit is present then it should retrieve the default value and compare with 1,000.00

when I ran this code it is printing "abc" for every loop.Am not sure what is going wrong.
Thanks in advance for the help.
The issue has been resolved. Mistakenly put i instead of k in "Set
Code:
abc=OTableIndex(i).childitem(j,i,"WebEdit",0)
".The corrected code is "Set abc=OTableIndex(i).childitem(j,k,"WebEdit",0)"



RE: Retrieving default value from embedded webedit from webtable - sshukla12 - 01-12-2012

Hi,
Code:
Set abc=OTableIndex(i).childitem(j,i,"WebEdit",0)
use
Code:
Set abc=OTableIndex(i).childitem(j,k,"WebEdit",0)

Regards,
Sankalp