| || |
Storing items from the lists of string to a class
Lets say I use this getLinks() method which gets a list of HtmlLink.
I want to store a particular link in a class called HtmlLink.
Using the HtmlLink,I want to invoke the link how can I do it?
Re: Storing items from the lists of string to a class
You can't invoke the link, there is no such a method for HtmlLink class. You can click the link using Click() or DoClick() methods. GetLinks() would return the URL of each link on the page. So ideally you would loop through the list of urls and click on the given link by something like:
However you would need to substitute all special characters in url with ?-characters. Besides there are some other pitfalls. You can do the same task easier by using GetChildren method instead. Here is the sample code that would click the link with the "Logout" caption on Infoline page:
<font class="small">Code:</font><hr /><pre>
[ ] LIST OF WINDOW lwChildren
[ ] WINDOW wChild,wLink
[ ] STRING sCaption="Logout"
[ ] Infoline.SetActive()
[ ] lwChildren=Infoline.GetChildren()
[-] for each wChild in lwChildren
[-] if ClassOf(wChild)==HtmlLink && wChild.GetCaption()==sCaption
[ ] wLink=wChild
[ ] break
[ ] wLink.Click()