Thanks, GetVisibleText worked.
On Thursday, August 25, 2016 at 12:28:59 AM UTC-4, Cuong Tran wrote:
> Have you try the method object.GetVisibleText?
> It will show all the text inside the object that you focus to.
>
> example: Msgbox
> Browser("yourbrowser").Page("yourPage").WebElement("theboxarea").GetVisibleText
>
> It maybe WebElement or WebList or WebTable or what Ever type of the text
> area that content the text needed to extract.
>
> Thanks,
> On Wednesday, August 24, 2016 at 8:33:09 PM UTC+7, [email protected]
> wrote:
>>
>> Hi,
>>
>> Thank you for the response, but this won't help me. I can only extract
>> if I see the text I'm looking for. It's a webpage with text then a box
>> with lines around it that has "Version Number 3.11.02.104" . I want to get
>> the number 3.11.02.104
>>
>> I get all the text from the page but this version number is never
>> captured. My question is how to capture a WebElement that qtp cannot see
>> or read?
>> Thanks
>>
>>
>>
>> On Tuesday, August 23, 2016 at 10:21:04 PM UTC-4, Cuong Tran wrote:
>>
>>> 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.