CUITe_HTMLHyperLink's click method

Oct 24, 2011 at 2:49 AM

I followed the quick guide and I was able to collect some hyperlink controls objects and proceeded to create my test case.

I launch the page fine but issueing my CUITe_HTMLHyperLink.Click() method does nothing on the page.

neither I can use Mouse.Click(<mypageobject>.<mylinkobject>);

How do I "navigate" simulating hyperlink clicks ?

 

Thanks

Coordinator
Oct 24, 2011 at 5:43 AM

Could be that the hyperlink control you identified is wrong. Click method works for sure.

If you can send me the html of the page and an image highlighting the link to be clicked, I can help.

Oct 24, 2011 at 5:46 AM

Thank sureba. Yes it works fine. I apologize for the false alarm.

I was working all weekend long with CUIT and did not realize that I was still running my CUIT test cases.

Once I ran my CUITe, I realized it works just fine.

Thanks.

Nov 22, 2011 at 9:08 AM

I captured the page menu links, but when I try to click the link thorugh my tests it throws "Object reference ..." error

public class CollectionsMenu : CUITe_BrowserWindow
    {       
        public CUITe_HtmlHyperlink lnkAboutCollections = new CUITe_HtmlHyperlink("Id=hl_About collections");
        public CUITe_HtmlHyperlink lnkContactUs = new CUITe_HtmlHyperlink("Id=Target_4871c498-8404-48be-9418-dbbd9146be79");       
        public CUITe_HtmlHyperlink lnkSignOut = new CUITe_HtmlHyperlink("Id=Target_a2b8f5fb-5b39-4dc0-a7b0-0eff1e20bd94");
    }

 public class MenuNavigations : TestCommon
    {

        [TestMethod]
        public void CUI_Menu_AboutCollections_Clicked()
        {
              ........

              .............


             CollectionsMenu collectionsMenu = new CollectionsMenu();

              collectionsMenu.lnkAboutCollections.Click();       // it stucks in this line with exception "Object reference not set to an instance of an object."

            AboutCollections.AssertIsAboutCollectionsPage();
        }

}

Coordinator
Nov 23, 2011 at 6:14 AM

The way you have instantiated the CollectionsMenu class is wrong. It should be:

var collectionsMenu = CUITe_BrowserWindow.GetBrowserWindow<CollectionsMenu>();

 

collectionsMenu.lnkAboutCollections.Click();      

Nov 23, 2011 at 9:22 AM

I have tried it even that fails, actually I have nearly 5-6 pages, and what I tied is seprated the menus in different class, which doesn't represent any UI page, so it fails while doing CUITe_BrowserWindow.GetBrowserWindow<CollectionsMenu>();


Is my approach wrong.

Nov 23, 2011 at 9:58 AM

Hey Suresh, thank you I was able to resolve the issue, I added all the menu links to base object which derives from CUITe_BrowserWindow, and now all my object repository instance derives from the base object which has menu

Coordinator
Nov 23, 2011 at 12:24 PM

Nice to know :).