package seleniumExamples;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class Open3Browsers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//open firefox browser
// System.setProperty("webdriver.Firefox.driver", ""))
WebDriver driver = new FirefoxDriver();
//System.setProperty("webdriver.chrome.driver", "C:\\Users\\Public\\Jars\\ChromeDriver.exe");
System.setProperty("webdriver.chrome.driver", "C:\\Users\\sreekanth\\Desktop\\Technical\\Selenium\\Selenium training\\chromedriver_win32\\chromedriver.exe");
//System.setProperty("webdriver.chrome.driver","C:\\ChromeDriver.exe");
WebDriver driverchrome = new ChromeDriver();
//IE driver is found in the link: "http://code.google.com/p/selenium/downloads/detail?name=IEDriverServer_x64_2.38.0.zip"
System.setProperty("webdriver.ie.driver", "C:\\Users\\sreekanth\\Desktop\\Technical\\Selenium\\Selenium training\\IEDriverServer_Win32_2.38.0\\IEDriverServer.exe");
//System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer.exe");
WebDriver driverIe = new InternetExplorerDriver();
}
}
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class Open3Browsers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//open firefox browser
// System.setProperty("webdriver.Firefox.driver", ""))
WebDriver driver = new FirefoxDriver();
//System.setProperty("webdriver.chrome.driver", "C:\\Users\\Public\\Jars\\ChromeDriver.exe");
System.setProperty("webdriver.chrome.driver", "C:\\Users\\sreekanth\\Desktop\\Technical\\Selenium\\Selenium training\\chromedriver_win32\\chromedriver.exe");
//System.setProperty("webdriver.chrome.driver","C:\\ChromeDriver.exe");
WebDriver driverchrome = new ChromeDriver();
//IE driver is found in the link: "http://code.google.com/p/selenium/downloads/detail?name=IEDriverServer_x64_2.38.0.zip"
System.setProperty("webdriver.ie.driver", "C:\\Users\\sreekanth\\Desktop\\Technical\\Selenium\\Selenium training\\IEDriverServer_Win32_2.38.0\\IEDriverServer.exe");
//System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer.exe");
WebDriver driverIe = new InternetExplorerDriver();
}
}
#Commandtoopenbrowser:
ReplyDeleteHow many commands we have to open the browser or In how many could we open browser using Selenium?
Starting the Browser
Deletecsharp java
setUp("http://www.google.com/", "*firefox");
perl php python ruby
Each of these examples opens the browser and represents that browser by assigning a “browser instance” to a program variable. This program variable is then used to call methods from the browser. These methods execute the Selenium commands, i.e. like open or type or the verify commands.
The parameters required when creating the browser instance are:
host
Specifies the IP address of the computer where the server is located. Usually, this is the same machine as where the client is running, so in this case localhost is passed. In some clients this is an optional parameter.
port
Specifies the TCP/IP socket where the server is listening waiting for the client to establish a connection. This also is optional in some client drivers.
browser
The browser in which you want to run the tests. This is a required parameter.
url
The base url of the application under test. This is required by all the client libs and is integral information for starting up the browser-proxy-AUT communication.
Note that some of the
We can also use:
DeleteSystem.setProperty("webdriver.ie.driver", "C:\\Users\\sreekanth\\Desktop\\Technical\\Selenium\\Selenium training\\IEDriverServer_Win32_2.38.0\\IEDriverServer.exe");
WebDriver driverIe = new InternetExplorerDriver();