I am trying to find an element that its data-stock value is greater than 0. I can find elements with specific stock values using:
findElement(By.xpath("//div[@data-stock='2']"))
But since the stock is always changing I want to find the first element that has data-stock greater than zero using xpath or css. Tried using "//div[@data-stock!='0']" but it doesn't work.
<div class="product" data-price="100.00" data-stock="0">...<div>
<div class="product" data-price="30.00" data-stock="2">...<div>
<div class="product" data-price="3.00" data-stock="10">...<div>
I want to use findElement() and get the first element with stock greater than zero, which in this case is the second one.