Issue with accessing object properties
Posted: Thu Apr 12, 2012 1:09 am
Hi,
There are few hyper links in our web page and they look like a tabs. When I click any of them respective section displays and background of the link changes so that we know the tab has been selected. When I spy I can see that 'class' property as 'Selected' and I would like to use the same thing in my code to make sure navigation is successful.
Here goes my code.
The above code finds the element, clicks on it but fails to retrieve the class property as I found it as Null when I debug.
Interestingly, If tab was already selected then this code can click the tab again and can see the class as 'Selected'.
Thanks,
Suraj
There are few hyper links in our web page and they look like a tabs. When I click any of them respective section displays and background of the link changes so that we know the tab has been selected. When I spy I can see that 'class' property as 'Selected' and I would like to use the same thing in my code to make sure navigation is successful.
Here goes my code.
Code: Select all
Ranorex.ATag mppElement = objRepo.HomePage.Self.FindSingle<Ranorex.ATag>(".//a[@InnerText='" + tabName +"']",2000);
mppElement.Click();
If(mppElement.Class=="Selected")
{
//my Reporting
}
Interestingly, If tab was already selected then this code can click the tab again and can see the class as 'Selected'.
Thanks,
Suraj