I have a button on my website with two classes:
<button class="btn_primary btn_inventory">ADD TO CART</button>
I want to click this button with this code:
cy.get('btn_primary btn_inventory').click();
I have a button on my website with two classes:
<button class="btn_primary btn_inventory">ADD TO CART</button>
I want to click this button with this code:
cy.get('btn_primary btn_inventory').click();
You can't directly use the class name as you have used here. you need to use CSS selectors. in your case, it should be corrected as,
cy.get('.btn_primary.btn_inventory').click();
Refer this to learn more about css selectors CSS Selectors W3Schools