This is a migrated thread and some comments may be shown as answers.

Unable to click() HtmlAnchor inside HtmlDiv

3 Answers 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 15 Mar 2013, 06:12 PM
I've created a unit test that runs perfectly in chrome but is unable to click or hover an HtmlAnchor when IE = browsertype. See attached DOM tree.

[TestMethod]
        [TestCategory("Nightly")]
        public void SearchTest()                  
        {

            Manager.LaunchNewBrowser(BrowserType.Chrome);

            ActiveBrowser.NavigateTo("http://someURL.aspx");

            Pages.AdeptHome.AdeptLink.Click(false);

            Pages.AdeptWelcome.Markets.MouseHover();
            Pages.AdeptWelcome.Texas.Click(false);



3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 20 Mar 2013, 09:06 PM
Hi Chris,

...but is unable to click or hover an HtmlAnchor when IE = browsertype

What happens when it tries in IE? Do you get an error? Does the test think it worked but nothing happens in the browser? We'll need to be able to see the problem first hand by reproducing it on our machine before we can investigate what is causing the problem. Is it possible for us to get direct access to your application being tested (we don't need the source code, just a URL we can connect to)?

Greetings,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Chris
Top achievements
Rank 1
answered on 27 Mar 2013, 04:16 PM
Hi Cody,

Sorry for not responding sooner but I was able to solve the issue. Instead of defining the object as an HtmlAnchor, I defined it as an HtmlDiv and used the innertext property. The code looks like this...

public HtmlDiv Texas
            {
                get
                {
                    return Get<HtmlDiv>("innertext=Texas", "tagname=div");
                }
            }

I also switched from Click() to MouseClick() and MouseHover()

Pages.Welcome.Markets.MouseHover();
Pages.Welcome.Texas.MouseClick();
0
Cody
Telerik team
answered on 27 Mar 2013, 05:04 PM
Hi Chris,

I am very glad to hear you found a solution. Thank you for the update.

All the best,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Cody
Telerik team
Chris
Top achievements
Rank 1
Share this question
or