1. For Database Verification in To use Selenium Webdriver, we need to use the JDBC ("Java Database Connectivity"). Its API provides following classes and interfaces: Driver Manager Connection Statement ResultSet SQLException 2. In order to test our Database using Selenium, we need to perform the following steps: a. Make a connection to the Database. Syntax is: Connection DB_Con= DriverManager.getConnection(URL, "USERID", "PASSWORD" ) And load JDBC Driver class using the syntax: Class.forName("oracle.jdbc.driver.OracleDriver"); b. Execute Queries to the Database Statement stmt = DB_Con.createStatement(); stmt.executeQuery(select * from employee;); ResultSet rs= stmt.executeQuery(query); c. Process the result set based on your need: while (rs.next()){ String FisrtName= rs.getString(1); String LastName= rs.getString(2); System.out.println("First Name is: " +FisrtName); System.out.p...
A blog about my testing stories where I pen down my thoughts about test automation covering primarily Selenium, Java, Rest Assured, Karate, Maven, TestNG, Postman, newman, Jenkins, Git, Azure DevOps, etc.