GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — was01/src/test/java/dataDriven/Test2.java at master · javaandselenium/was01

Expand file tree

/

Test2.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
51 lines (38 loc) · 1.38 KB
/

Test2.java

Copy path

File metadata and controls

51 lines (38 loc) · 1.38 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package dataDriven;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
import com.mysql.cj.jdbc.Driver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Test2 {
@Test
public void tc3() throws SQLException {
//Step:1 register the database
Driver driver=new Driver();
DriverManager.registerDriver(driver);
//step:2 connect to database
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/wsa01","root","root");
//Step:3 create sql query statement
Statement statement = con.createStatement();
String query="select * from logindetails";
//Step:4 execute the query
ResultSet result = statement.executeQuery(query);
while(result.next()) {
System.out.println(result.getString(1));
System.out.println(result.getString(2));
WebDriverManager.chromedriver().setup();
WebDriver driver1=new ChromeDriver();
driver1.get("https://demoapp.skillrary.com/login.php?type=login");
driver1.findElement(By.id("email")).sendKeys(result.getString(1));
driver1.findElement(By.id("password")).sendKeys(result.getString(2));
//Step:5 close the connection /db
con.close();
}
}
}
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.