Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
1.3k views
in Selenium by
edited

http://www.managility.com.au/images/stories/amol.pandey/blog1/img/blog1_pic3.png

I have a task here to write the automation script for maps that are similar to google maps. so the test steps are as follows.

clicking on the region drop down.
selecting a radio button from region drop down.
Once the region is selected a particular area in maps get highlighted (This highlighted area changes every time we select a different region from the above step).
Now if we click in the area that highlighted in the map a popup window will get displayed.
My question is how to identify that highlighted area using selenium as it is not an element. If we click anywhere else in the map other than highlighted one there won't be any change.

 

A similar image can be seen from attached url

1 Answer

0 like 0 dislike
by
selected by
 
Best answer
You can get CSS value of that element by using webelement.getCssValue("color") as a String and loop it till its highlighted.

You may click on highlighted area by creating relative xpath.

Hope it helps.
by
Hi Mayur,

Thank you very much for your response. If you don't mind can you please help me by posting a sample script in getting css value and looping. I am actually new to Selenium.
by
Post HTML of your webpage. One of our users can help you writing the code.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...