package selenium_examples;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Test {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.funandknowledge.blogspot.com");
Capabilities cap = ((RemoteWebDriver) driver).getCapabilities();
String browserName = cap.getBrowserName().toLowerCase();
System.out.println(browserName);
String version = cap.getVersion().toString();
System.out.println(version);
}
}
Output :-
firefox
19.0
No comments:
Post a Comment