Highlighted
Valued Contributor.
Valued Contributor.
242 views

Set value to a Webelement with Autocomplete

Hello,

I'm using Descriptive Programming, and trying to set a value to a WebElement.

I have about 6 data entries on the page, 4 have autocompletes. So, when I set a value, it works only for three WebEdits, two without autocmplete and one with autocomplete. 
I'm using a function for that:

Function WebEdit_Input(name,strValue,srtDesc)

Set oDesc = Description.Create
oDesc("html tag").Value = "INPUT"
oDesc("name").Value = name
 

Set oWebEdit = Browser("title:=.*").Page("title:=.*").WebEdit(oDesc)


If oWebEdit.Exist(30) Then
oWebEdit.Set strValue
value = oWebEdit.GetROProperty("value")

If lcase(strValue) = lcase(value) Then
WebEdit_Input = "Pass"
Reporter.reportEvent micPass,"Set Value to "& srtDesc,strValue & " was Successfully inserted"
Else
Reporter.reportEvent micFail,"Set Value to "& srtDesc," WebEdit was not found"
WebEdit_Input = "Fail"
End If
End If


Set oDesc = Nothing
Set oWebEdit = Nothing

End Function

 

Please help me to set the value, or how to SPY an object when it only appears when I start typing. Object spy can't detect that autocomplete object, as it dissapears whenever I want to spy it.

 

0 Likes
1 Reply
Highlighted
Super Contributor.
Super Contributor.

Re: Set value to a Webelement with Autocomplete

Sorry I don't get a clear picture about the WebElement. Edit and AutoComplete. Can't we just directly set the value and not consider the autocomplete? 

For the spy issue, we'll have the hover spy functionality in coming release 14.50 soon. I think that can solve the spy problem.

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.