Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Link count
#1
Hi

I was doing a small descriptive programming:

Code:
Set odesc = description.Create odesc("micclass").value = "Link" odesc("innertext").value = "BlueDental Care(Prepaid)" Set MyChildObj = Browser("index:=0").Page("index:=0").ChildObjects(odesc) linkcount = MyChildObj.count If linkcount > 0 Then Result = "PASS" Else Result = "FAIL" End If

I debugged this code on the page where the "BlueDental Care (Prepaid)" link was actually there but the linkcount returned 0. How is this possible?
Reply
#2
HI,

Use "CreationTime" instead of "index" for Browser object.
Reply
#3
Try with following code:
Hi

I was doing a small descriptive programming:

Code:
Dim odesc Dim linkcount Set odesc = description.Create() odesc("micclass").value = "Link" odesc("innertext").value = "BlueDental Care(Prepaid)" Set MyChildObj = Browser("index:=0").Page("index:=0").ChildObjects(odesc) linkcount = MyChildObj.count If linkcount > 0 Then Result = "PASS" Else Result = "FAIL" End If

Thanks,
Reply
#4
Not working. Still turning up with linkcount of 0.
Reply
#5
All description properties are regular expressions by default. Your innertext property has parenthesis in it that are being treated as a regular expression capturing group instead of the literal characters. You can fix this in one of two ways. Either change the innertext property's regularExpression property to False, or escape the parenthesis to force them to be treated as literal strings.

1.
Code:
Set odesc = description.Create odesc("micclass").value = "Link" odesc("innertext").value = "BlueDental Care(Prepaid)" odesc("innertext").regularExpression = False
2.
Code:
Set odesc = description.Create odesc("micclass").value = "Link" odesc("innertext").value = "BlueDental Care\(Prepaid\)"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem in identifying link vijay44 2 2,622 02-09-2010, 10:08 AM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)