Forum Discussion

farhanahmed's avatar
farhanahmed
Contributor
14 years ago

How to insert Data in Text boxes from attached file during test execution?

Hi

I have a scenarion where i have to insert Test Data in Text boxes during Test Run.

How can i do it?

Regards

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Several ways, actually.



    Say, for example, your TextBox is referenced as Aliases.MyApp.MyTextBox.



    Depending upon the application, component, etc., any number of these could work.



    Aliases.MyApp.MyTextBox.Keys("This is my text")




    Aliases.MyApp.MyTextBox.SetText("This is my text")




    Aliases.MyApp.MyTextBox.wText = "This is my text"




    Aliases.MyApp.MyTextBox.value= "This is my text"




    This is just a sampling, you can find more information on interacting with edit controls at http://smartbear.com/support/viewarticle/14840/
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Sure thing.  It's just a matter of pulling the data out of the file and then using one of the above methods to do the data entry.  Search the help for topics on Data Driven Testing.
  • Can you post me any sample code for this scenario?

    will be grateful to you ..:P