Answer the question
In order to leave comments, you need to log in
How to click on an element in selenium webdriver c#?
The element itself looks like this:
<span class="rating">
<span aria-label="Одна звезда" role="button" tabindex="0" class="rating-star" aria-checked="false" aria-pressed="false"></span>
<span aria-label="Две звезды" role="button" tabindex="0" class="rating-star" aria-checked="false" aria-pressed="false"></span>
<span aria-label="Три звезды" role="button" tabindex="0" class="rating-star" aria-checked="false" aria-pressed="false"></span>
<span aria-label="Четыре звезды" role="button" tabindex="0" class="rating-star" aria-checked="false" aria-pressed="false"></span>
<span aria-label="Пять звезд" role="button" tabindex="0" class="rating-star" aria-checked="false" aria-pressed="false"></span>
</span>
IWebElement five_stars = Browser.FindElement(By.CssSelector("span:nth-child(5)"));
five_stars.Click();
Answer the question
In order to leave comments, you need to log in
UPD:
Browser.FindElement(By.CssSelector("span.rating > span:last-child")).Click();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question