Print Page | Close Window

Childobjects function for WebEdit

Printed From: One Stop Testing
Category: Testing Tools @ OneStopTesting
Forum Name: QuickTest Pro @ OneStopTesting
Forum Discription: QuickTest Pro is a fresh approach to automated software and application testing that addresses testing needs of both business analysts and Quality Assurance professionals.
URL: http://forum.onestoptesting.com/forum_posts.asp?TID=930
Printed Date: 31May2024 at 9:58am


Topic: Childobjects function for WebEdit
Posted By: laboni
Subject: Childobjects function for WebEdit
Date Posted: 25Apr2007 at 4:43am
Hello,

I have the following function using childobjects to enter text in an edit box. However, when executed I get an error on the oChildren(intCounter).Set "something" line stating that the object does not support the property or method .Set.

What am I doing wrong?


Code:
Function EditEnterText(strObjectName, strText)
Dim oDesc, oChildren, intCounter, strType
Set oDesc = Description.Create
oDesc("micClass").value = "WebEdit"
Set oChildren=Browser("micClass:=Browser").Page("micClass:=Page").ChildObjects(oDesc(0))
For intCounter = 0 To oChildren.Count - 1
strType = oChildren(intCounter).GetROProperty("name")
If strType = strObjectName Then
MsgBox intCounter
'oChildren(intCounter).Select
oChildren(intCounter).Set "something"
End If
Next
End function



Replies:
Posted By: anjan
Date Posted: 25Apr2007 at 5:24am
Set oChildren=Browser("micClass:=Browser").Page("micClass:=Page").ChildObjects(oDesc)

Try this:

Function EditEnterText(strObjectName, strText)
Dim oDesc, oChildren, intCounter
Set oDesc = Description.Create
oDesc("micClass").value = "WebEdit"
Set oChildren=Browser("micClass:=Browser").Page("micClass:=Page").ChildObjects(oDesc)
For intCounter = 0 To oChildren.Count - 1
If strObjectName =oChildren(intCounter).GetROProperty("name") Then
oChildren(intCounter).Set strText
Exit For
End If
Next
End function




Print Page | Close Window