How to get count for the notification at the header

Hello,

please share HTML code of this element to see if there is any usable attribute.

My code

String productscountinbasket = WebUI.getText(findTestObject(‘Object Repository/Page_Login_STIHL/Header/product_count_in_cart’))

println’count of products in the cart are : ’ + productscountinbasket

response:::

2019-07-09 14:23:10.732 DEBUG _Quantity_selection_for_Product_selected - 30: println("count of products in the cart are : " + productscountinbasket)
count of products in the cart are :
2019-07-09 14:23:11.909 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/Verify_Quantity_selection_for_Product_selected/Verify_Quantity_selection_for_Product_selected

You need this:

String productscountinbasket = WebUI.getAttribute(findTestObject("Object Repository/Page_Login_STIHL/Header/product_count_in_cart"), "data-qty-value")

data-qty-value attribute holds actual number of items in your basket - you can get the value using getAttribute() method.

Thank you so much…will check and update you…as my site is down for sometime

Thank you, I got the count :slight_smile: hurraayyy

I am glad to help you.