Download How To Get Browser And OS Details On Run-Time In Selenium WebDriver - Software Testing Tutorials graphic type that can be scaled to use with the Silhouette Cameo or Cricut. An SVG's size can be increased or decreased without a loss of quality. All of our downloads include an image, Silhouette file, and SVG file. It should be everything you need for your next project. Our SVG files can be used on adhesive vinyl, heat transfer and t-shirt vinyl, or any other cutting surface
//Get Browser name and version.
Capabilities caps = ((RemoteWebDriver) driver).getCapabilities();
String browserName = caps.getBrowserName();
String browserVersion = caps.getVersion();
//Get OS name.
String os = System.getProperty("os.name").toLowerCase();
package STTA.MavenProject1;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.BeforeTest;
public class GetBrowserDetail {
WebDriver driver;
@BeforeTest
public void setup(){
driver = new FirefoxDriver();
//Check and print Firefox browser and OS detail.
CheckBrowserOS();
driver.close();
System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
driver = new ChromeDriver();
//Check and print Chrome browser and OS detail.
CheckBrowserOS();
driver.close();
System.setProperty("webdriver.ie.driver", "D://IEDriverServer.exe");
driver = new InternetExplorerDriver();
//Check and print IE browser and OS detail.
CheckBrowserOS();
driver.close();
}
public void CheckBrowserOS() {
//Get Browser name and version.
Capabilities caps = ((RemoteWebDriver) driver).getCapabilities();
String browserName = caps.getBrowserName();
String browserVersion = caps.getVersion();
//Get OS name.
String os = System.getProperty("os.name").toLowerCase();
System.out.println("OS = " + os + ", Browser = " + browserName + " "+ browserVersion);
}
}
This Is way to get browser and OS detail In selenium WebDriver.
Download How To Get Browser And OS Details On Run-Time In Selenium WebDriver - Software Testing Tutorials All SVG file downloads also come bundled with DXF, PNG, and EPS file formats. All designs come with a small business commercial license. These SVG cut files are great for use with Silhouette Cameo or Cricut and other Machine Tools.