Page 1 of 1

Finding a Web Link

Posted: Mon Apr 02, 2012 7:05 pm
by SurajJaldu
Hi,

I am trying to find a link in AUT and click it.
The following code is working for me.

Code: Select all

 Ranorex.WebDocument mppApp = repoMPP.HomePage.Self;
            Ranorex.Unknown mppElement = mppApp.FindSingle<Ranorex.Unknown>(".//a[@id='CompanyManagementCheckButton']");
            mppElement.Click();
But, the following doesn't. Can you give me an insight, why?

Code: Select all

 Ranorex.WebDocument mppApp = repoMPP.HomePage.Self;
            Ranorex.Link mppElement = mppApp.FindSingle<Ranorex.Link>(".//a[@id='CompanyManagementCheckButton']");
            mppElement.Click();
I get the error "The element does not support the required capability 'link'. "
I prefer to know the type of object I am finding.

Thanks,
Suraj

Re: Finding a Web Link

Posted: Tue Apr 03, 2012 8:26 am
by Support Team
Hi,

as you are going to automate a ATag pleas try to use the following code instead:
Ranorex.ATag mppElement = mppApp.FindSingle<Ranorex.ATag>(".//a[@id='CompanyManagementCheckButton']");
Regards,
Tobias
Ranorex Team

Re: Finding a Web Link

Posted: Tue Apr 03, 2012 8:47 pm
by SurajJaldu
Thanks. ATag is working. (Just curios) Where do we use 'Ranorex.Link'?

Re: Finding a Web Link

Posted: Wed Apr 04, 2012 4:18 pm
by Support Team
Hi,
SurajJaldu wrote:Thanks. ATag is working. (Just curios) Where do we use 'Ranorex.Link'?
Ranorex.Link is a Role. Ranorex.LinkTag is the linktag inside a HTML header.

Regards,
Peter
Ranorex Team

Re: Finding a Web Link

Posted: Thu Apr 12, 2012 7:29 pm
by SurajJaldu
Okay. Thank You.