How do I locate images on a carousel in a webpage?
For example in www.Amazon.com how can I locate the image "Amazon FireTV"? I tried using firebug and firepath to get it's xpath. Here is the generated code
.//*[@id='image-map-ns_0ZQX7SFF6V0EPC565G2P_12436_']/div/div/map/area
I am aware that the element is dynamic. I tried using the 'contains' keyword but I still can't locate the element. Here is the xpath that I tried
.//*[@id='image-map-ns_0ZQX7SFF6V0EPC565G2P_12436_']/div/div/map/area[contains(@alt, 'Amazon Devices')]
Steps to recreate the scenario I'm doing
Go to www.amazon.com
On the carousel click the 5th bullet(This shows the image of the Amazon FireTV)
locate the element usin Firebug and Firepath
On the carousel click the 5th bullet
On the carousel click the 5th bullet(currently it shows Fire HD Kids Edition )
$x("//a[contains(@class,'herotator-goToPage-5')]");
locate the element
select the image Fire HD Kids Edition using the alt attribute
//div[@class='cropped-image-map-center-alignment']/map/area[contains(@alt,'Fire HD Kids Edition')]
I tested the xpath in browser console it was working fine shortcut $x("xpath")
Hope this helps you...kindly get back if you face any problems