Header Ads

Working with EditBox

Below is the Code related to EditBox.Frequently we need to get data from a edit box which is under a webpage and set the data to the box.
Below is the very popular code to Set and get data from webpage.
Set obj=Browser("ABC").Page("XYZ")
You may create object upto where it is necessary.(For more help ...go to OR and check the hirerchy)
objname=Name of the edit box.

'*****************************************************************************************************************
'FUNCTION : setWebEdit
'ARGUMENTS : obj,objname,entervalue
'DESCRIPTION : Enters value into webedit
'RETURNS : None '**************************************************************************************************************

Function setWebEdit(obj,objname,sValue)
If obj.WebEdit(objname).exist Then
If Not obj.WebEdit(objname).GetROProperty("disabled") Then
obj.WebEdit(objname).click
obj.WebEdit(objname).Set sValue
End If
End If
End Function
'*****************************************************************************************************************
'FUNCTION : getWebEdit
'ARGUMENTS : obj,objname
'DESCRIPTION : Gets particular webedit's value
'RETURNS : value of webedit '**************************************************************************************************************

Function getWebEdit(obj,objname)
If obj.WebEdit(objname).Exist(5) Then
If Not obj.WebEdit(objname).GetROProperty("disabled") Then
obj.WebEdit(objname).click
getWebEdit = obj.WebEdit(objname).GetROProperty("value")
End If
End If
End Function
Powered by Blogger.