Micro Focus QTP (UFT) Forums
how to get values of childItem of a 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: how to get values of childItem of a webtable (/Thread-how-to-get-values-of-childItem-of-a-webtable)

Pages: 1 2


RE: how to get values of childItem of a webtable - inborntester - 02-23-2012

Code:
inrtxt=Browser("Name:=CDD").Page("Title:=CDD").WebTable("name:=Refresh View").WebTable("name:=Ignore").Object.rows(1).cells(1).innertext
identifier ="innertext:="&inrtxt
a=Browser("Name:=CDD").Page("Title:=CDD").WebTable("name:=Refresh View").WebTable("name:=Ignore").WebElement( identifier).GetROProperty("outertext")
msgbox(a)




RE: how to get values of childItem of a webtable - zeeshanyshaikh - 02-24-2012

Hey inborntester, thanks for the reply but i m getting msgbox blank.
and can you please explain me what is
Code:
.Object.rows(1).cells(1).innertext



RE: how to get values of childItem of a webtable - inborntester - 02-24-2012

its a DOM feature, google it further to get idea.
Ensure row and column index may differ from gtp identification.
try the codes after removing ".WebTable("name:=Refresh View")"



RE: how to get values of childItem of a webtable - zeeshanyshaikh - 02-24-2012

hi,

I think i got my solution on using just
Code:
inrtxt=Browser("Name:=CDD").Page("Title:=CDD").WebTable("name:=Refresh View").WebTable("name:=Ignore").Object.rows(1).cells(1).innertext
msgbox inrtxt

Thank you inborntester...
cheers.


RE: how to get values of childItem of a webtable - zeeshanyshaikh - 02-28-2012

hi friends,

Need help!!


1st Problem:
As suggested i am getting outerhtml of webtables.
Now i want qtp to wait until outerhtml of my webtable changes

I am using the below code:
Code:
Browser("Name:=CDD").Page("Title:=CDD").WebTable("name:=Refresh View").WebTable("name:=Ignore").Object.rows(1).cells(1).waitproperty "outerhtml", micRegExpMatch("<TD style=" & "COLOR: \#([f|F|0]{6})"& ">[\w\W]*?</TD>")

Error message:: "Object doesn't support this property or method"


2nd Problem:
I am having problem in asking qtp to wait until a button appears:-
but button appears when my outerhtml of above cell is blue(td color), and if it is red then button doesn't appear(that means there is some error)

problem is when button is red my second webtable name changes to "Delete" and when it is blue it changes to "Ignore"

so if i tell qtp to wait until button is visible, then qtp fails when there is some error(because button will not visible if it is failed)
Please suggest the correct way..

(I know my question is not related to this post but as a reference of code snippets posted earlier, posting in this thread )

Thanks & Regards
Zeeshan




RE: how to get values of childItem of a webtable - inborntester - 02-28-2012

for the first problem try below code. i am not sure with micRegExpMatch of your needs. object identification should work for the below code. get back if any issues in regexp.

Code:
outerHTML=Browser("Name:=CDD").Page("Title:=CDD").WebTable("name:=Refresh View").WebTable("name:=Ignore").Object.rows(1).cells(1).outerHTML
identifier="outerhtml:="&outerHTML
a=Browser("HTML Tables").Page("HTML Tables").WebElement(identifier).waitproperty "outerhtml", micRegExpMatch("<TD style=" & "COLOR: \#([f|F|0]{6})"& ">[\w\W]*?</TD>")




RE: how to get values of childItem of a webtable - Jagdish - 09-15-2013

Refer below code:

Quote:rc=Browser("name:=Web Table").page("title:=Web Table").WebTable("html tag:=TABLE").RowCount
For r=1 to rc
cc=Browser("name:=Web Table").page("title:=Web Table").WebTable("html tag:=TABLE").ColumnCount®
Next

For r=1 to rc
For c=1 to cc
if Browser("name:=Web Table").page("title:=Web Table").WebTable("html tag:=TABLE").ChildItemCount (r,c,"Link")>0 then
set linkobj1= Browser("name:=Web Table").page("title:=Web Table").WebTable("htmltag:=TABLE").ChildItem(r,c,"Link",0)
print "Row:"&r&" Column:"&c&" "+ linkobj1.Getroproperty("innertext")
end if
msgbox linkobj1.Getroproperty("innertext")
Next
Next



RE: how to get values of childItem of a webtable - sivaji - 11-06-2017

(12-09-2009, 02:08 PM)can you try these one  set oObj =  Browser("B").Page("P").WebTable("WT:").ChildItem(2, 1, "WebEdit", 0)b=' oObj.GetROProperty("value")msgbox b Wrote: hi everyone ,

i have an issue with WebTable.
one of the cell of my web table has a "WebEdit" object
And my requitment is to read the value of WebEdit object and display it using msgbox.

i tried following:
--------------------- cut from code------------------------------------
Code:
set  a =  Browser("B").Page("P").WebTable("WT:").ChildItem(2, 1, "WebEdit", 0)
b= a.GetROProperty("value")
msgbox b
-------------------- end of cut-----------------------------------------

when i run this script , I get error message " Object required a"
what must be the problem with above code?

MY OR contains following:

browser-->page-->webedit,webtable