Karthick Vanithurai
2018-11-17 18:26:07 UTC
Hi i am trying to open a new window using the below code but its not
working, please help...
package Practice;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
public class OpenNewWindow {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\vanbt\\OneDrive\\Desktop\\Gecko\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
//Open an browser
driver.navigate().to("https://bing.com");
Thread.sleep(3000);
//Open a new window
driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL + "n");
}
}
working, please help...
package Practice;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
public class OpenNewWindow {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\vanbt\\OneDrive\\Desktop\\Gecko\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
//Open an browser
driver.navigate().to("https://bing.com");
Thread.sleep(3000);
//Open a new window
driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL + "n");
}
}
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0d44a86c-ad8b-475c-b578-8951aaffd18c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0d44a86c-ad8b-475c-b578-8951aaffd18c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.