Micro Focus QTP (UFT) Forums
Automate same input for multiple input box - 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: UFT / QTP Interview Questions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Interview-Questions)
+--- Thread: Automate same input for multiple input box (/Thread-Automate-same-input-for-multiple-input-box)



Automate same input for multiple input box - noopur - 01-14-2010

Hi

How many lines of code do you required to write down for feeding same input to 50 text boxes.
This 50 Text boxes are not of an Array type.
I think we can write it down with the help of the for loop
but how can we got about it. do we need to use Index of Text box in foor loop and increment it by 1.


Thanks in advance for help


RE: Automate same input for multiple input box - sreekanth chilam - 01-15-2010

Hi Noopur,

Let me clear you with an example of Editbox in a Web Application.

Code:
set textbox_obj=Description.Create
  textbox_obj("micclass").Value="WebEdit"
  Set obj=Browser(...).Page(..).ChildObjects(textbox_obj)
  For i=0 to obj.count-1
      obj(i).Set "Sample Input"
  Next


In the same way, you can implement in other environments as well Smile


RE: Automate same input for multiple input box - noopur - 01-15-2010

Thanks Sreekanth for this answer.