0% found this document useful (0 votes)
197 views

1.launch The Below URL's in Firefox Browser

The document describes launching various URLs in Firefox, Chrome, and Internet Explorer browsers using Selenium WebDriver. Code snippets are provided to launch URLs like www.greenstechnologys.com, facebook.com, amazon.in in each browser. The URLs are launched, the window is maximized, there is a 1 second delay, and then the browser is closed.

Uploaded by

Rani rani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
197 views

1.launch The Below URL's in Firefox Browser

The document describes launching various URLs in Firefox, Chrome, and Internet Explorer browsers using Selenium WebDriver. Code snippets are provided to launch URLs like www.greenstechnologys.com, facebook.com, amazon.in in each browser. The URLs are launched, the window is maximized, there is a 1 second delay, and then the browser is closed.

Uploaded by

Rani rani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

1.

Launch the below URL's in firefox browser

1) http://www.greenstechnologys.com/
package com.test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class BrowserLaunch {


public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.gecko.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\geckodriver.exe");

WebDriver driver = new FirefoxDriver();

driver.get("http://www.greenstechnologys.com/");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}

2) https://www.facebook.com/:-
package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class BrowserLaunch {
public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.gecko.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\geckodriver.exe");

WebDriver driver = new FirefoxDriver();


driver.get("https://www.facebook.com/");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}

3. https://www.amazon.in:
package com.test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class BrowserLaunch {
public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.gecko.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://www.amazon.in");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();
}
}

4.) http://www.greenstechnologys.com/selenium-course-content.html

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class BrowserLaunch {

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.gecko.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();

driver.get("http://www.greenstechnologys.com/selenium-course-
content.html");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}

2.Launch the below URL's in chrome browse

1. http://www.greenstechnologys.com/

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class BrowserLaunch {

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.chrome.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\chromedriver.exe");

WebDriver driver = new ChromeDriver();

driver.get("http://www.greenstechnologys.com/");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}

2. http://gmail.com/

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class BrowserLaunch {


public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.chrome.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\chromedriver.exe");

WebDriver driver = new ChromeDriver();

driver.get("http://gmail.com/");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}

3. www.flipkart.com/

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class BrowserLaunch {

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.chrome.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\chromedriver.exe");

WebDriver driver = new ChromeDriver();

driver.get(" www.flipkart.com/");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
4. http://www.greenstechnologys.com/selenium-course-content.html

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class BrowserLaunch {

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.chrome.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\chromedriver.exe");

WebDriver driver = new ChromeDriver();

driver.get("http://www.greenstechnologys.com/selenium-course-content.html");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}

3.Launch the below URL's in IE browser

1. http://www.greenstechnologys.com/

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class BrowserLaunch {

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.ie.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\IEDriverServer.exe");

WebDriver driver = new InternetExplorerDriver();

driver.get("http://www.greenstechnologys.com/");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}
2. http://demoqa.com/registration/

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class BrowserLaunch {

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.ie.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\IEDriverServer.exe");

WebDriver driver = new InternetExplorerDriver();

driver.get("http://demoqa.com/registration/");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}

3. http://www.greenstechnologys.com/selenium-course-content.html

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class BrowserLaunch {

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.ie.driver", "D:\\c
language\\programs\\seleniumTesting\\Drivers\\IEDriverServer.exe");

WebDriver driver = new InternetExplorerDriver();

driver.get("http://www.greenstechnologys.com/selenium-course-content.html");
driver.manage().window().maximize();
Thread.sleep(1000);
driver.quit();

}
}

You might also like