title: Magento 2 add product to cart programmatically with custom options
body: <p>I have created one test script file for add product into cart <strong>with custom options</strong>. I want display selected custom option of product in cart using programmatically. </p>
  
  <p>Please check my below code:</p>
  
  <pre><code>$productId = 25;
  $product = $objectManager-&gt;create('\Magento\Catalog\Model\Product')-&gt;load($productId);
  $cart = $objectManager-&gt;create('Magento\Checkout\Model\Cart');  
  $params = array();      
  $params['options[469]'] = 459;
  $params['qty'] = 1;
  $params['product'] = 25
  
  $cart-&gt;addProduct($product, $params);
  $cart-&gt;save();
  </code></pre>
  
  <p>Using objectmanager i have created cart and product object. When i have fired this script in browser, it's show me error: </p>
  
  <blockquote>
    <p>Magento\Framework\Exception\LocalizedException: Please specify
    product's required option(s).</p>
  </blockquote>
  
  <p>I have already passed custom option in params array. but still it's show error. </p>
  
  <p><strong>How can i add product into cart with selected custom options ?</strong></p>
  
  <p>Please help me.</p>
  
  <p>Any help would be appreciated.</p>