Forum Discussion

PingS's avatar
PingS
Occasional Contributor
7 years ago

cannot enter data to a <textarea> control

I am writing tests for a web application. On one page, there is a <textarea></textarea> control. I tried to record the actions of typing data into the control, but the recorded test seems not able to record the text entered.

I tried to write script to enter data, it also failed. I tried two ways to do it, but both did not work.

Can anyone help to let me know how to work this out? Your help are appreciated!

 

The two options that I tried:

1)

txtObj.Click()
aqutils.Delay(50)
txtObj.SetText(inpVal)
aqutils.Delay(50)
txtObj.Keys("[Tab]")
aqutils.Delay(50)

 

2)

txtObj.Click()
aqutils.Delay(50)
txtObj.wText = inpVal
aqutils.Delay(50)
txtObj.Keys("[Tab]")
aqutils.Delay(50)

 

The pic is the <textarea> in inspection window. I believe this control is an ASP.net control.

 

  • PingS's avatar
    PingS
    Occasional Contributor

    The following pic is the control in inspection window. I believe this control is an ASP.net control.

    The <textarea> control on the page.

    • jab4743's avatar
      jab4743
      Contributor

      Are you able to manually enter the data in the field?  The field states it must be a number.  If you are manually able to enter the data, does your script follow exactly the same process of your manual test?  Sometimes on an error you have to clear a field prior to entering the correct data.

      • PingS's avatar
        PingS
        Occasional Contributor

        I am able to type in letters and numbers