- In order to test Database using Selenium you need to
- Make a connection to the Database
- Send Queries to the Database
- Process the results
- The Syntax to connect to Database is
- DriverManager.getConnection(URL, "userid", "password" )
- You will also need the Statement Object to send queries
- Statement stmt = con.createStatement();
- To send the query to database use execute query and store the results in the ResultSet object
- ResultSet rs = stmt.executeQuery(select * from employee;);
- Java provides lots of built-in methods to process the SQL Output using the ResultSet Object
Thursday, 4 February 2016
DB connection from selenium
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment