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

Clicking on an image area.

1 Answer 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rad
Top achievements
Rank 1
Rad asked on 13 Feb 2013, 08:38 PM
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

1 Answer, 1 is accepted

Sort by
0
Rad
Top achievements
Rank 1
answered on 13 Feb 2013, 09:32 PM
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);
Tags
General Discussions
Asked by
Rad
Top achievements
Rank 1
Answers by
Rad
Top achievements
Rank 1
Share this question
or