vins
vins

Reputation: 37

How to find all the elements in the following html using selenium webdriver

<div class="summary-number-lg ng-binding" name="ib-summary-revenue"> $ 248 </div>

I need to validate if the summary revenue is $248 or not.

Is there any way to validate the name and the value? And how to select them using find elements?

Upvotes: 0

Views: 30

Answers (1)

alecxe
alecxe

Reputation: 473983

Locate the element, for example, by name and assert its text. Example in Python:

summary_revenue = driver.find_element_by_name("ib-summary-revenue")
assert summary_revenue.text.strip() == "$ 248"

Upvotes: 1

Related Questions