Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looping and seting value
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
I need to write a code using descriptive prog to get all the edit boxes on a page. and now have to set value for the 6 - 10th edit boxes object to a particular value.
That is e.g from the set the edit box value to 7, same for the 8th, 9th and 10th box.

Can anyone help please.

Thanks
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi
Below is the solution,

Code:
Set oEdit = Description.Create()
oEdit("micclass").value = "WebEdit"

set Childobj = Browser("").page("").ChildObjects(oEdit)

For I = 6 to Childobj.Count-1
Childobj(I).Set "Test value"
Next
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Modified :

Code:
Set oEdit = Description.Create()
oEdit("micclass").value = "WebEdit"

set Childobj = Browser("").page("").ChildObjects(oEdit)

For I = 6 to 10
Childobj(I).Set "Test value"
Next

I hope your criteria is only to fill the edit boxes from 6th to 10th.

UrsVinod : There could be 30 edit boxes, so there is no need to loop through all of them and set the same value. Just the required ones only.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Yes it is. Thanks.
The other issue is I have a datatable with 3 values in there. The loop works correctly but the issue i now have is after iterating through the 3 values it continues to look for a fourth one and i have just 3 values in there. I dont know why it keeps doing this.
My code is
Code:
For i = 1 to Datatable.Globalsheet.GetRowCount
Datatable.GlobalSheet.SetCurrentRow i
Browser..........
Next.
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Laura -
thread Hijack. Please open a new post.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
Laura,

Wanted to draw your attention towards #7 in posting guidelines. Please limit one query per thread. It helps the forum run more efficiently.

@basanth27. Thanks for the heads-up.

Thread Closed.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to use looping statement dmvelic083185 1 1,278 09-26-2017, 08:46 PM
Last Post: Ankur
  Excel_Datasheet Looping problem Saadat Chowdhury 0 1,732 10-05-2012, 08:42 AM
Last Post: Saadat Chowdhury
  problem in looping statements... navyasatish 5 4,173 02-02-2012, 02:23 PM
Last Post: rajpes
  Hitting enter key aftrer seting value in webedit tbull 7 33,147 03-12-2010, 11:36 AM
Last Post: DhanavanthaG
  Looping wont stop laura 3 3,170 07-06-2009, 02:11 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 2 Guest(s)