Selenium C#: Store element's position on graph as a variable

240 Views Asked by At

enter image description here

I want to store the position of a circle from this graph as a variable, so I can compare it to the position saved in the database.

<circle class="" ng-touch="manualGraph($event, c, 'left')" ng-mousedown="manualGraph($event
, c,'left')" ng-show="audiogram.leftEnabled && manual" ng-repeat="c in audiogram.tonePoints
| filter: {'resultSet': 'left'} | orderBy : 'stimulusFrequency'" fill="black" ep-r="8" ep-c
y="146.1820459269123" ep-cx="42" cy="146.1820459269123" cx="42" r="8">

The value I want to store is ep-cy or cy from above.

I currently interact with the circles using an index like below:

var circles = Driver.Instance.FindElements(By.TagName("circle"));
var circle = circles[circleIndex];
1

There are 1 best solutions below

0
On BEST ANSWER

Assuming you already have your circle element found as you stated, you should be able to do this:

string position = circle.GetAttribute("cy");