What’s a good design pattern to create an object hidden from the client?

I am having difficulty understanding which design pattern would be best for the following scenario. An application uses a database. That database can either be the production version (SQL) or a test version (Test). Here’s my current design:

enter image description here

The problem with this design is that application has to create Test, which it shouldn’t be doing (since it’s purely for testing). However, Application must somehow get reference to the database it’s going to use, either SQL or Test.

What design pattern could I implement to fool application into creating the Test version of the database? How would this solution look in UML?

I have already done enough research to narrow my choices to Abstract Factory, Builder, or Factory Method (or the combination of any)

Need help to send data to a hidden field

I followed the w3schools tutorial to extract the GPS location:

https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation_error

modified to start when the website loads:

 <html> <body onload="getLocation()">  <p hidden id="demo"></p>  <form> <input type="hidden" id="GPS" name="GPS" value="HERE"> <input type="submit" value="Submit"> </form>  <script> var x = document.getElementById("demo");  function getLocation() { if (navigator.geolocation) {...
Code (markup):

Need help to send data to a hidden field