Burak
Burak

Reputation: 310

Prrogrammatically selecting links from a table

I am using UFT to test Salesforce. The Acme Corp. account has 2 contacts: "James Bean" and "Marsha Smith". but it can have more contacts. I am trying to programmatically select the links for these contacts and click on them. I wrote this code to get all the links on that page

Dim oDesc
Set oDesc = Description.Create
oDesc("micclass").value = "Link"

'Find all the Links
Set obj = Browser("Contacts | Salesforce").Page("Contacts | Salesforce").ChildObjects(oDesc)

enter image description here

The problem is when I loop trough obj, there is no way to programmatically distinguish the 2 Contacts links from the other links on the Menus. They all have the same class.

How can I access the table and its contents programmatically from an Action?

I attached screenshots of the contacts object and the HTML table of the links.

enter image description here

Upvotes: 2

Views: 40

Answers (1)

Motti
Motti

Reputation: 114805

If the links you're interested in are all nested inside a table which you know how to identify, you can call ChildObjects on the WebTable rather than on the Page.

See this blog post.

Upvotes: 1

Related Questions