usha,
Where to start...
Semantics, but you need to give ctr a starting value, otherwise you're adding 1
to nil, which isn't going to fly.
Look at your if statement - it is looking at ie.link().exists? for each link on
the page. This is going to result in a zero if the link does not appear, and a
count of all links on the page if the link appears once or more since a single
instance of the link is going to mean that no matter how many times you look at
the page, you're always going to find it again - Not the count I believe you're
looking for.
Let's try this:
item_search=/blah.com/
ctr = 0
ie.links.each do |l|
ans=l.href =~ item_search
if ans
ctr = ctr+1
end
end
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5543&messageID=15421#15421
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general