execute click action on a div element

2 posts, 1 answers
  1. Richard
    Richard avatar
    4 posts
    Member since:
    May 2005

    Posted 06 Feb 2015 Link to this post


    I do have following HTML code:

    ... <a href='#'><div class='navTileLabel' style='color:#000000;' title='Testrubrik'>Testrubrik</div></a>...

    it is part of a framesource.

    I can find this element by following code:

    Browser frame = myManager.ActiveBrowser.Frames.ById("cat");
    Element testrubrik = frame.Find.ByAttributes("title", "Testrubrik");

    that works. And I would like to simulate a click on this element:


    that works not. Even if I use another way:



    myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, testrubrik.GetRectangle());

    it does not what I want.

    What can I do to execute a click on this element?

    Best regards

  2. Answer
    Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 11 Feb 2015 Link to this post

    Hello Juergen,

    The issue here is not with the click action. Your find expression is slightly incorrect. It should look like:

    Browser frame = myManager.ActiveBrowser.Frames.ById("cat");
    HtmlDiv testrubrik = frame.Find.ByAttributes<HtmlDiv>("title=Testrubrik");
    //Real Click

    Hope this helps.

    Boyan Boev
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top