Clicking on an image area.

2 posts, 0 answers
  1. Rad
    Rad avatar
    8 posts
    Member since:
    Feb 2013

    Posted 13 Feb 2013 Link to this post

    Hi, 

    I have a website that consists of a big image showing items that are on promotion. Clicking on an area of this image will show a div that shows details of that item. What is the code to click on a map-area on an image? I will appreciate any help.
    The following is how the map and areas are mentioned and I would like the code to click on the first area.

    <map id="pagemap_3636171" name="pagemap_3636171">
    <area href="javascript:void(0)" coords="33,674,313,987" shape="rectangle" data-mapareaid="50053070" data-listingid="-2056081385" data-pageid="3636171" data-link="" data-tracking-method="click" data-tracking-origin="browse ad" class="action-tracking-nav"
    data-maphilight="{"fade":false, "fadeDuration":999999}">

    <area href="javascript:void(0)" coords="586,1734,890,1993" shape="rectangle" data-mapareaid="50053071" data-listingid="-2056082548" data-pageid="3636171" data-link="" data-tracking-method="click" data-tracking-origin="browse ad" class="action-tracking-nav" data-maphilight="{"fade":false, "fadeDuration":999999}">
    </map>

    Thanks
    R
  2. Rad
    Rad avatar
    8 posts
    Member since:
    Feb 2013

    Posted 13 Feb 2013 Link to this post

    thats fine...I got it:

    List<Element> children = Find.ByAttributes("id=pagemap_3636171").Children.ToList();
                Element e = children.Find(x => x.Attributes.ToList().Find(t => t.Name == "data-mapareaid").RawValue == "50053070");
                Actions.Click(e);
Back to Top