01-11-2012, 06:51 PM
(This post was last modified: 01-11-2012, 07:25 PM by indranilgoswamimcb.)
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:
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:
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)"