title: Using Selenium Webdriver to interact with Stripe Card Element iFrame - Cucumber/Selenium Java
body: <p>I have an form that I want to automate using Cucumber and Selenium Webdriver in Java - in this form, we have a card element which we use from Stripe. We call the div, and stripe does the rest. I'm unsure if this is an iFrame, but when I use the </p>
  
  <pre><code>Hooks.driver.findElement(By.xpath("xpathOfTheCardNumberField")).sendKeys("123");
  </code></pre>
  
  <p>command, it does not interact with it and returns the "Unable to locate element" error in the console log.</p>
  
  <p>I have asked our front-ender to perhaps try and add some ID's or Name tags to the fields, but he informs me that he cannot interact with the markup for the fields inside of the card element, only the card element itself - as Stripe deal with everything else.</p>
  
  <p>Attached is a picture of the card element, as well as the markup for the card element in question.</p>
  
  <p>Is it possible to get Selenium to interact with this element?</p>
  
  <p>Any help is greatly appreciated. <a href="https://i.stack.imgur.com/VtifI.png" rel="noreferrer">Card element front end</a></p>
  
  <p><a href="https://i.stack.imgur.com/Z8eCU.png" rel="noreferrer">Mark up for the card element</a></p>