Micro Focus QTP (UFT) Forums
Problem in identifying link - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Problem in identifying link (/Thread-Problem-in-identifying-link)



Problem in identifying link - vijay44 - 02-08-2010

[/i]Hi,
I have 2 Links with process and processcomments
i have used the below code for identifying processcomments
Code:
Set WbLink = Description.Create()
WbLink("micclass").Value = "Link"
WbLink("name").Value = "C"
WbLink("href").Value=".*processComments.*"
Set AllWbLink  = Browser("micclass:=browser").Page("micclass:=Page").ChildObjects(WbLink)
            NumberOfLinks=AllWbLink.Count
            msgbox NumberOfLinks
            For i=0 to(NumberOfLinks)-1
if AllWbLink(i).GetRoproperty("href")<>"processComments.*"  then
AllWbLink(i).Click
End if
Next
Gives the exact result.
But now when i write for edit box:process
Code:
Set WbEdit = Description.Create()
        WbEdit("micclass").Value = "Link"
        WbEdit("name").Value = "C"
        wbEdit("href").Value="process.*"
        Set AllWbEdit = Browser("micclass:=browser").Page("micclass:=Page").ChildObjects(WbEdit)
        NumberOfEdits=AllWbEdit.Count
        msgbox NumberOfEdits
        For i=0 to(NumberOfEdits)-1
          if AllWbEdit(i).GetRoproperty("href")<>"process.*"  then
             AllWbEdit(i).Click
          End if
        Next
Now the problem is it matches with that of processcomments and clicks that too.
The href property of process is:javascript:Copy('process','0','2')
while the href property of processcomments is:
javascript:Copy('processComments','0','2')

I want to identify the process link with that of processcomments link
Any help will be really appreciated.
Regards;
Vijay


RE: Problem in identifying link - satan - 02-09-2010

try process'.* in second if condition


RE: Problem in identifying link - Saket - 02-09-2010

Hi Vijay,
always make sure to use proper tags in post to wrap your codes, which makes it in more readable format.
I did it for you this time, hope you will follow this onwards. for more details refer help.