I have to update the Quantity of the product whose element id and name changes with product. eg for Product 1 id="quantity_11046" Product 2 id="quantity_15678"
I am using css as :
WebElement Qty=driver.findElement(By.cssSelector("div:contains(“quantity_1”)");
and
WebElement Qty=driver.findElement(By.cssSelector(""input[id$='quantity_1']");
But getting error unable to find the element.
<div>
<input type="number" maxlength="3" onkeypress="return isNumeric(event)" oninput="maxLengthCheck(this)" min="1" max="999" ng-model="qty" ng-blur="blurred()" ng-change="changed()" ng-disabled="disabled" ng-readonly="readonly" class="ng-pristine ng-untouched ng-valid ng-valid-min ng-valid-max ng-valid-maxlength" name="quantity_11046" id="quantity_11046">
</div>