Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98788

Selenium : Selecting elements with similar properties using sequence

$
0
0

Need some help with the selenium script i'm writing using c#.

I'm trying to click an element by the using "class" property but the issue is, there is another similar element that shares the exact same property and this element comes first hence my click,is hitting the first element instead

Also "Class" is the only attribute available for this element.

Element A (Comes first)

<div class="cam-taxpicker">
  <div class="cam-taxpicker-button"></div>
</div>

Element B (Comes second)

<div class="cam-taxpicker">
  <div class="cam-taxpicker-button"></div>
</div>

Is there any way keep these elements in a list and iterate to the second element and only then perform the action? Is this the best way for this?

Or is there any other way to perform this action?

Many thanks in advance,


Viewing all articles
Browse latest Browse all 98788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>