Hi,
You should give the sample text to make clarify
In another way, you can use the below func to get the text between 2
special characters (if it can solve your issue)
*Function GetTextBetween2Chars(strText,firstDeli,secondDeli)
firstDelPos = InStrRev(strText, firstDeli) 'position of start delimiter
secondDelPos = InStrRev(strText, secondDeli) 'position of end delimiter
stringBwDels = Mid(strText, firstDelPos + 1,
secondDelPos - firstDelPos - 1) 'extract the string between two delimiters
GetTextBetween2Chars = stringBwDels End Function*
Using: strText = "your version: v1500 is the lastest"
strVer = *GetTextBetween2Chars(strText,"version: "," is the latest")*
*---> strver = v1500*
On Wednesday, August 24, 2016 at 1:45:34 AM UTC+7, [email protected] wrote:
>
>
>
> Hello,
>
> I want to get version number off a WebElement. I get all the text but the
> text on the Webelement that has the version number..
> Any help is appreciated. Here's the code I'm using.
>
> Thanks
>
>
> Set childobjdes = Description.Create()
> childobjdes("micclass").value="WebElement"
> childobjdes("html tag").value= ".*[A-Za-z0-9].*"
> childobjdes("outertext").value =".*[A-Za-z0-9].*"
>
>
> set allobj = .Page("ABC").ChildObjects(childobjdes)
> mycount = allobj.count
> msgbox mycount
>
> For i= 0 to allobj.count-1
> output= allobj.Item(i).GetROProperty("outertext")
>
>
> If instr(output, "Version Number") > 1 Then
> msgbox output
> End If
> Next
>
>
> thanks
>
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.