title: Fetching a value from the database and using that value as an input field in Selenium Webdriver
body: <p>I am doing automation testing at my work and i'm stuck in a scenario.</p>
  
  <p>My first test consist of creating a new user account which creates a username and a password. <strong>P.S. My password is always the same</strong></p>
  
  <p>My second test is basically login as a user with the username and password that I created in the first test. </p>
  
  <p>Also, as the account is created, the database gets updated, and i'm able to connect to the database and execute the query (select user_name from accounts where password = 'pass123' order by created_dttm desc;)  </p>
  
  <p>So, since i'm able to execute and get the value from the db, how can I fetch that value and insert it into my username field in order to login as a customer. </p>
  
  <p>Because i'm stuck in this situation, I always have to edit my 2nd test case with a different username that is created in my first tc. I would like my test script to take the username from the db and insert it into the username field automatically. </p>
  
  <p>I'm kinda new to Java and automation, therefore, any kind of help will be highly appreciated. Thanks a ton!</p>