Highlighted
Valued Contributor.
Valued Contributor.
267 views

Getting InnerText Value that is not separated by commas in UFT

I am trying to get the count value of a WebElement from the inntertext properties.

Can anyone help with getting the numeric total or count ?? or Parse them them to separate and then count them?

 

Lets say innerText value = ABCDEFG..

***********************************************************************************

1 Dim WEbElementValue, CountVal

2 If Browser("A").Page("B").WebElement("html id:= b-a1").Exist Then
3     WEbElementValue= Browser("A").Page("B").WebElement("html id:= b-a1").GetROProperty("innertext")
4    
5    msgbox WEbElementValue  ( " This works the message box opens and the values are listed) 
6    
7    CountVal= WEbElementValue.count

 I'm Getting error issue here on line 7--> 

Object required: 'ABCD'

Line (7): "CountVal= WEbElementValue.count".


  8  msgbox WEbElementValue.count
    
9 End If

*******************************************************************************

 

0 Likes
3 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: Getting InnerText Value that is not separated by commas in UFT

If you are trying to get a count of the characters in the WebElement you can use:

CountVal= Len(WEbElementValue)

 

Mark Smith.

0 Likes
Highlighted
Valued Contributor.
Valued Contributor.

Re: Getting InnerText Value that is not separated by commas in UFT

That is great to know and Thanks, but I am trying to separate them and then get the inner value.

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Getting InnerText Value that is not separated by commas in UFT

Hi,

Can you please share the "WEbElementValue" output value what exactly you get.

Ex:

WEbElementValue= Browser("A").Page("B").WebElement("html id:= b-a1").GetROProperty("innertext")

msgbox WEbElementValue

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.