Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package LandingPage;
- import java.util.Scanner;
- import org.openqa.selenium.chrome.ChromeDriver;
- public class LandingPage {`public static String getValue(String x)
- {
- System.out.println(x);
- return x;
- }
- static Organization obj;
- public static void main(String[] args) throws InterruptedException {
- char ch;
- String org ;
- do
- {`System.out.println("List of Landing Page, Now we have 33 Landing page: nn" +"Google n" + "Roche n" +"Bayer n" + "Cartus n");
- Scanner reader = new Scanner(System.in);
- System.out.println("Enter a Organization Name: n ");
- org = reader.nextLine();
- obj=Organization.valueOf(org);`switch(obj)
- {
- case Google:
- String getvalue =google.G_LP();
- String y = getvalue;
- getValue(y);
- System.out.println(getvalue+" ");
- break;
- case Roche:
- Roche.R_LP();
- break;
- case Bayer:
- Bayer.bayerfill();
- break;
- case Cartus:
- Cartus.Cartusfill();
- break;
- default:
- System.out.println(" Organization is not listed into the list please select from the list: n ");
- }
- package DataBase;
- import java.sql.*;
- import LandingPage.LandingPage;`public class Database {
- public static void main(String[] args ) throws InterruptedException {
- String dbURL = "jdbc:mysql://qa-0.ls.vu:3306/learnship_local";
- String username ="root";
- String password = "learnship";
- String query_1, value, value_1;
- LandingPage ob=new LandingPage();
- String getmail=ob.getValue(x);
- System.out.println(getmail);
- Connection dbCon = null;
- Statement stmt = null;
- try {
- Class.forName("com.mysql.jdbc.Driver");
- //getting database connection to MySQL server
- dbCon =DriverManager.getConnection(dbURL, username, password);
- System.out.println("connection successful");
- stmt = dbCon.createStatement();
- query_1= "SELECT first_name,last_name FROM person WHERE email= '" + getmail + "'";
- ResultSet result = stmt.executeQuery(query_1);
- while ( result.next() ) {
- value = result.getString("first_name");
- value_1 = result.getString("last_name");
- String name=value+""+value_1;
- System.out.println(name);
- // con=value.value1;
- }
- result.close();
- } catch (Exception ex) {
- System.err.println("Got an exception! ");
- System.err.println(ex.getMessage());
- }
- }
- }
- public class google extends LandingPage {
- public static String G_LP() throws InterruptedException{
- String getmail="aali3009@outlook.com";
- System.setProperty("webdriver.chrome.driver","E:\workspace\chromeDriver\chromeDriver.exe");
- ChromeDriver driver = new ChromeDriver();
- driver.get("http://qa-0.ls.vu/v2/landing-page/google");
- driver.findElement(By.xpath("/html/body/div[3]/div/div/div/p[2]/a/small")).click();
- driver.findElement(By.xpath("/html/body/div[9]/div/div[2]/div/div/div/form/div[3]/div[1]/input")).sendKeys("Emmaname");
- driver.findElement(By.xpath("/html/body/div[9]/div/div[2]/div/div/div/form/div[3]/div[2]/input")).sendKeys("Mohaname");
- driver.findElement(By.xpath("/html/body/div[9]/div/div[2]/div/div/div/form/div[4]/div/input")).sendKeys(getmail);
- driver.findElement(By.xpath("/html/body/div[9]/div/div[2]/div/div/div/form/div[5]/div")).click();
- driver.findElementById("checkbox2").click();
- driver.findElementById("checkbox1").click();
- driver.findElementById("js-register").click();
- return getmail;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement