Forum Discussion
The following pic is the control in inspection window. I believe this control is an ASP.net control.
- jab47436 years agoContributor
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.
- PingS6 years agoOccasional Contributor
I am able to type in letters and numbers
- PingS6 years agoOccasional Contributor
I can type in characters and numbers. The following is the function that performs the setting text. When I stepinto the code, I can see the right textArea object on the page is selected and jas the focus when txtObj.Click() is executed, but the next line txtObj.SetText(inpVal) does not set the data on the page.
'******************************************************************************************
'Function:EnterTextAreaValue
'Description:Function to enter text in any text area
'Input Parameters :txtObj - the textArea object, lblName-the textArea Lable, inpVal-the input value
'******************************************************************************************
Public Function EnterTextAreaValue(txtObj,lblName,inpVal)
EnterTextAreaValue=true
If (txtObj is nothing) Then
fnInsertResult "Object does not exists","Please recheck object properties of textarea, " &lblName ,"",gFail
End If
If Not (txtObj.Exists) Then
fnInsertResult "Object does not exists","Please recheck object properties of textarea, " &lblName ,"",gFail
End If
If Not (txtObj.Visible) Then
fnInsertResult "Object does not visible","Please recheck object properties of textarea, " &lblName ,"",gFail
End If
If Not (txtObj.Enabled) Then
fnInsertResult "Object does not enabled","Please recheck object properties of textarea, " &lblName ,"",gFail
End If
On Error Resume Next
txtObj.Click()
aqutils.Delay(50)
txtObj.SetText(inpVal)
aqutils.Delay(50)
txtObj.Keys("[Tab]")
aqutils.Delay(50)
getPage().wait()
If Err.Number <> 0 Then
Log.Error gException & "EnterTextAreaValue"& Err.Description
EnterTextAreaValue = False
end if
On Error GoTo 0
End Function
Related Content
- 6 months agoCliffYoung
- 3 years agoApisathS