Firefox webdriver not starting, driver showing as Null - java

driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get(URL);
I'm trying to run my test in Firefox using version 46.0.1 and webdriver 2.53.0 but when I run the test I see Firefox start and then close very quickly. I've got all other browsers to work and am at a loss as to what I'm missing here.
#BeforeClass
public static void setUp() {
System.out.println("****************");
System.out.println("launching Browser");
driver = new FirefoxDriver();
driver.get("url");
#Test
public void testPageTitleInBrowser() {
FirstPage firstPage = PageFactory.initElements(driver, FirstPage.class);
firstPage
.logIn(username, password)
.clickHolidayLink()
.completeHolidayFormAndSubmit("12/05/2016");
}
#AfterClass
public static void tearDown() {
if (driver != null) {
System.out.println("Closing browser");
driver.quit();
}
}
Mainpage has been changed to firstpage
import com.google.common.annotations.VisibleForTesting;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import static Internal.BaseTest.driver;
public class FirstPage {
#VisibleForTesting
#FindBy(id = "ctl00_MCPH_MainLogin_UserNameTextBox")
WebElement usernameInput;
#VisibleForTesting
#FindBy(id = "ctl00_MCPH_MainLogin_PasswordTextBox")
WebElement passwordInput;
#VisibleForTesting
#FindBy(id = "ctl00_MCPH_MainLogin_LoginButton")
WebElement loginButton;
public BookAHoliday logIn(String username, String password){
usernameInput.sendKeys(username);
passwordInput.sendKeys(password);
loginButton.click();
return PageFactory.initElements(driver, BookAHoliday.class);
}
}

As there is no test case written in the above code snippet, firefox driver will get opened in the #BeforeClass and as the condition driver != null is satisfied in #AfterClass, firefox is getting closed. This is expected behavior, as per your code.

Add Thread.sleep(3000); before driver.quit();or remove driver.quit();and see what happens. As you are not doing much in your test, it may be behaving correctly.

I was facing a similar problem. Firefox would open and then close without even navigating to the specified URL. Upgrade to the latest selenium(2.53) fixed the problem.
There was another instance where even the upgraded did not work. This was due to some plugins that my organization had installed.
Temporarily rename the "distribution" directory that is present in the location where Firefox is installed, and see if this works. Ex: C:\Program Files (x86)\Mozilla Firefox\ or /usr/lib/firefox/ This worked for me.

Related

Selenium 4 : frameToBeAvailableAndSwitchToIt doesn't seem to work

I am trying to work with a webpage in Selenium 4. The page has a few iframes and I am trying to wait for an iframe to load completely and then switch to it.
However, the code below doesn't seem to work:
driver = new ChromeDriver(options);
driver.get("https://www.stagecoachliquor.com/online-store-1/Whiskey-c20954043");
WebDriverWait wait = new WebDriverWait(driver,Duration.ofSeconds(30));
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.cssSelector("#TPASection_iw75naz9 > iframe")));
System.out.println(driver.getPageSource());
The system out just prints an empty HTML snippet below:
<html><head></head><body></body></html>
As a result, when I try to select any element after the switch, it fails. The iframe is loading alright in the chrome window which seems strange to me. I have tried implicit wait as well which did not work and had the same result.
After a few hours of debugging, I have not been able to identify the root cause. Any help is much appreciated.
Best,
R
I've reproduced the issue.
This behavior looks like a selenium bug, because, when it switches to frame, the frame has no any product elements (they are loaded a few seconds later). But then, when I was in debug and all the products loaded, and a I call driver.getPageSource(), the result is <html><head></head><body></body></html>, and when I call this again, it loads the correct page source, but still the driver cannot find any element inside the iframe.
So, I've added a custom expected condition, which switches to frame and check if some element present for workaround this.
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;
import static java.time.Duration.ofSeconds;
public class ChromeIframeTest {
#Test
public void test() {
// I use https://github.com/bonigarcia/webdrivermanager lib for download chromedriver
WebDriverManager.chromedriver().setup();
ChromeOptions options = new ChromeOptions();
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.stagecoachliquor.com/online-store-1/Whiskey-c20954043");
WebDriverWait wait = new WebDriverWait(driver, ofSeconds(30));
wait.until(
frameToBeAvailableAndSwitchToItAndElementToBeAvailable(
By.cssSelector("#TPASection_iw75naz9 > iframe"),
By.cssSelector(".grid-product__shadow") // product in iframe
)
);
System.out.println(driver.getPageSource());
driver.quit();
}
// Custom expected condition
public static ExpectedCondition<Boolean> frameToBeAvailableAndSwitchToItAndElementToBeAvailable(
By frame, By frameElement) {
return new ExpectedCondition<>() {
private boolean isLoaded = false;
#Override
public Boolean apply(WebDriver driver) {
if (ExpectedConditions.frameToBeAvailableAndSwitchToIt(frame).apply(driver) != null) {
isLoaded = ExpectedConditions.presenceOfAllElementsLocatedBy(frameElement).apply(driver) != null;
}
if (!isLoaded) {
driver.switchTo().defaultContent();
}
return isLoaded;
}
#Override
public String toString() {
return String.format("element \"%s\" should present in frame \"%s\", is present: \"%b\"", frameElement.toString(), frame.toString(), isLoaded);
}
};
}
}
The root cause is your condition is always true, iframe is available after you get the HTML. You can simply add a Thread.sleep to verify it.
For now: I can't find any condition that is suited for your situation.
WebDriver driver = new ChromeDriver();
driver.get("https://www.stagecoachliquor.com/online-store-1/Whiskey-c20954043");
Thread.sleep(10000);
driver.switchTo().frame(driver.findElement(By.cssSelector("#TPASection_iw75naz9 > iframe")));
System.out.println(driver.getPageSource());
driver.quit();

Cannot invoke "org.openqa.selenium.WebDriver.findElement(org.openqa.selenium.By)" because "this.driver" is null

when I try to run below code in testNg null pointer exception shown in Eclipse
public class ImgDDChkbxRadio {
WebDriver driver;
#BeforeTest
public void LaunchBrowser()
{
System.setProperty("webdriver.chrome.driver","F:\\chromedriver_win32\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("http://www.leafground.com/");
}
#Test
public void Img()
{
driver.findElement(By.xpath("//img[#src='images/image.png']")).click();
driver.findElement(By.xpath("//*[#src=\"../images/home.png\"]")).click();
driver.navigate().back();
driver.findElement(By.xpath("//*[#src=\"../images/abcd.jpg\"]")).click();
}
}
Just remove the WebDriver from LaunchBrowser() and I hope this
will work for you ;)
public class ImgDDChkbxRadio {
WebDriver driver;
#BeforeTest
public void LaunchBrowser()
{
System.setProperty("webdriver.chrome.driver","/Users/chrome/chromedriver");
driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("http://www.leafground.com/");
}
#Test
public void Img()
{
driver.findElement(By.xpath("//img[#src='images/image.png']")).click();
driver.findElement(By.xpath("//*[#src=\"../images/home.png\"]")).click();
driver.navigate().back();
driver.findElement(By.xpath("//*[#src=\"../images/abcd.jpg\"]")).click();
}
}
I've learned since I've made this comment.
My new suggestion is - delete all imports at the beginning of your file and add them again. Be cautious about proper imports - especially versions of your test suite - issue can occur when code uses few different versions.
How to add imports? Move your cursour over marked classes, methods, etc. and react accordingly to your IDE suggestions (Alt + Enter for IntelliJ for Windows).
OLD and probably unsafe workaround:
My old suggestion can be a workaround for your issue but could make a lot of new instances and I guess it's not a wise thing to do. Tests will work but more like a by-product.
Create an instance of ChromeDriver before using it in your LaunchBrowser() method:
public class ImgDDChkbxRadio {
WebDriver driver = new ChromeDriver();
#BeforeTest
public void LaunchBrowser()
{
System.setProperty("webdriver.chrome.driver","F:\\chromedriver_win32\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("http://www.leafground.com/");
}
#Test
public void Img()
{
driver.findElement(By.xpath("//img[#src='images/image.png']")).click();
driver.findElement(By.xpath("//*[#src=\"../images/home.png\"]")).click();
driver.navigate().back();
driver.findElement(By.xpath("//*[#src=\"../images/abcd.jpg\"]")).click();
}
}
I think it may be the result of some changes made in JUnit 5 in annotations (#).
It could be the the site is not being loaded - are you able to launch the site manually?
If yes try this:
Make WebDriver object static (write static before the variable name)
Try to add Thread.Sleep(5000) to LaunchBrowser method, after you open the site using the browser
You are creating an object of the Browser with the help of the WebDriver Interface.
WebDriver{ driver = new new EdgeDriver();}
but the scope of this driver is within method only. To use it, you declared it publicly.
The lifetime of the driver is only in the WebDriver interface.
Making it: driver=new EdgeDriver();
can only solve your issues:
java.lang.NullPointerException: Cannot invoke "org.openqa.selenium.WebDriver.findElement(org.openqa.selenium.By)" because "this.driver" is null
package ADUMMYExersice;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class stackoverflowNull {
WebDriver driver;
#BeforeTest
public void LaunchBrowser()
{
System.setProperty("webdriver.edge.driver", "C:\\Selenium Files\\BrowserExe\\msedgedriver.exe");
driver=new EdgeDriver();
driver.manage().window().maximize();
driver.get("http://www.leafground.com/");
}
#Test
public void Img()
{
driver.findElement(By.xpath("//img[#src='images/image.png']")).click();
driver.findElement(By.xpath("//*[#src=\"../images/home.png\"]")).click();
driver.navigate().back();
driver.findElement(By.xpath("//*[#src=\"../images/abcd.jpg\"]")).click();
}
}
I had simular problem.
I changed
"WebDriver driver" to
"public static Webdriver".
This worked by me.
It could be an issue with your Chrome browser too - try it with Firefox and still does not work then try to change your workspace.
Had the same issue wasted 6hrs trying and searching. worked for me with Firefox.
protected static WebDriver driver;
use above and check if you have used web driver in any other class ?
I had two classes and in that I gave a variable name as public WebDriver driver; but it did not work it throwed me a error message saying
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.openqa.selenium.WebDriver.findElement(org.openqa.selenium.By)" because "this.driver" is null.
After that I found an answer which we need to give static before the variable public static WebDriver driver;
We I have create a test script and using testing I have facing center code here` that kind of problem Please Check my code and resolved my Prblem
package testcase;
import org.openqa.selenium.By;
import org.testng.annotations.Test;
import base.Basetest;
public class MyFirstTestFW extends Basetest{
#Test
public static void LoginTest() throws InterruptedException
{
System.out.println("Clicked Successfully");
driver.findElement(By.linkText("Sign in")).click(); //locals----properties
driver.findElement(By.id("login_id")).sendKeys("vaishali.verma#techinfini.in");
driver.findElement(By.xpath("//span[normalize-space()='Next']")).click();
Thread .sleep(4000);
driver.findElement(By.xpath("//input[#id='password']")).sendKeys("Vaishu#123");
Thread .sleep(4000);
driver.findElement(By.xpath("//button[#id='nextbtn']//span[contains(text(),'Sign in')]")).click();
Thread .sleep(4000);
}
}

Selenium cant access a hidden element

breaking my head over the following piece of code in Java, trying to solve a recaptcha for my selenium tests at work before implementing them.
The use case I use: https://www.google.com/recaptcha/api2/demo
WebDriver driver = Selenium.getInstance();
Selenium.goToWebPage("https://www.google.com/recaptcha/api2/demo");
WebDriverWait wait = new WebDriverWait(driver, 5);
List<WebElement> allIFrames = SeleniumUtil.getWebElementNicelyByTagName(driver, wait, "iframe");
if(allIFrames == null){
return;
}
Optional<WebElement> captchaIFrame = allIFrames.stream().filter(webElement -> webElement.getAttribute("src").contains("recaptcha/api2/anchor")).findFirst();
if(!captchaIFrame.isPresent()){
return;
}
WebDriver frame = driver.switchTo().frame(captchaIFrame.get());
//System.out.println(frame.getPageSource());
WebElement recaptchaTokenElement = SeleniumUtil.getWebElementNicelyByXPath(frame, wait, "//*[#type='hidden']");
System.out.println(recaptchaTokenElement);
So with the system.outs i'm trying to find my way to the captcha token, but every time it returns a null element. What the SeleniumUtil so far does is mainly:
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(xpath)));
return driver.findElement(By.xpath(xpath));
And the same for By.CssSelector etc.
I am already in the right IFrame, because the page source is printen out correctly, but searching by #recaptcha-token (cssselector), recaptcha-token (id), //*#id="recaptcha-token" does not work.
Maybe someone can help me with this?
There is a iFrame where the driver needs to be switched to.
After few tries I've got:
standard chromedriver setup:
package selenium;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class WebDriverSetup {
public static String userDir = System.getProperty("user.dir");
public static String chromedriverPath = userDir + "\\resources\\chromedriver.exe";
public static WebDriver driver;
public static WebDriver startChromeDriver() {
System.setProperty("webdriver.chrome.driver", chromedriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--start-maximized");
driver = new ChromeDriver(options);
driver.manage().window().maximize();
return driver;
}
}
And getting the token:
package selenium;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class GoogleRecaptchaDemo extends WebDriverSetup {
public static void main(String[] args) {
WebDriver driver = startChromeDriver();
driver.get("https://www.google.com/recaptcha/api2/demo");
List<WebElement> frames = driver.findElements(By.tagName("iframe"));
driver.switchTo().frame(frames.get(0));
WebElement rc = driver.findElement(By.id("recaptcha-anchor-label"));
rc.click();
WebElement recaptchaToken = driver.findElement(By.id("recaptcha-token"));
String token = recaptchaToken.getAttribute("value");
System.out.println(token);
driver.quit();
}
}
My output, last line is the token:
Starting ChromeDriver 86.0.4240.22 (398b0743353ff36fb1b82468f63a3a93b4e2e89e-refs/branch-heads/4240#{#378}) on port 25872
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Pro 01, 2020 4:30:45 ODP. org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
03AGdBq24MumCzjDlQCrcb4N3BuIiHm6O7V5IKSNGP1wChYe9g1Vc1GR7_NsvKqKV1Jzb5yLUXCB-ko8satP3fgkXIZ1rbjz76FITaLRRZqRJteQdVzlyzYoUgsSWQ_xjCspDvKNl6uTRGP7EzhesblTBf7HyYmjDU26BZkji8NqMFypQUzUIWUE6CF1W_UeiGCwV4Cfr2UduHJPskDubiwT7jxhRrLKFF_nK8zruV9dStwynSGzrMjwtemZSZmj2ZVJPiTxiYIV2QRIPUYPQ7dXMezrqJDG2Vwn2M9AxHOacoFcBTDIiFYoENq11-jNDJTY0a8PWl6bixpqv1itwTJw4FYnz9vSAQUCztQf7WXPLFgxp8iHjqB-uSIY39ikLJfa_rkFOke90PkF7sRlsKoQjptp_uCpJJ6aktscF97lGWA7EXJfpuOxaCMRt3VkuDZ9mzA5RFiHnQOX9I8VFWWe03t71r69aoj5y1dNoFUVT29lMsZf-X3y00eUxlLiT4JZzRFPfbF1fd4bqdH3SzpvWROxHe-IGRFz7Z_C4Hf7oNCQSXfpus2DIm2INW-JRPgfqZ_XQTaxphinGcoJ3EMvWZo6a3qDFYUB06HduULNO_5GwZ_eHUxE1wvXxGHdq2uoJ4Bkzzfu01ZD2Q13gJ6Mslup5dZlqAQGNggJY9aJYbmnRKNnUCtSY5Y8xHMr3Lnt_07SuFc_UdEDSV_KdtwgpVWEFL8OgAFP_KZaFqdaeUq_CTnHpHiTcAhNosT7V_H4gKx0A4BgHnI5NVxsLU1p09OOZ0GLJMqeP174pl03EpQy9iqnv0_e-w7NUeO7ZFgETt_pvEbqR6VqjfDO35BNd4aItzer9IdiSfzjdIAR6c0Z3_36o1WQyLXQZv_xTuZXaRYoZUTtV38aG3z5uK-pyRnNDqMZGffy5DPUn4WrDMnPM9lfI5nRZwXS503KJas54w4d0fRrZWOyhxYWeiCYhFJMDDwpqHJAzDlIqwPbQX90vVum0zEaJd_TU0l9t5QioUAwb3BuEdTeaOI8gM2OcpBScsQYTioMivi8-eRYpPvJIP239DJz6Rp5Ptk_52kC4_2rAWuG_cocuco_cA61yE3yu2WCw_e1EauOM3Ug2nGeFKFxZZdGWPdNj0E3YA3N6f3IaJYWHrQAz4odFQZaD-HZ4qnRZlJlnMzV31_o3_NLl-_2CGSywE8kuJf8wAIIplncfDdHSIlUn7WhrIOrSOX83NdKaQYAlTqLI9CTSTjaA3AyhG5OcF2dukVeACOItczNBSJcZeenTMCo1Es986nt770A3tQYC7S9r2ESxlYJl-eWGo8SKuM9udx7ZuO5lKgW-V-EUg1I-YFSoguRmGzUK-liu2-afTBn4X-97VXuiv-tdcKdi9Bx4DtlhqzNGvVbQmIOND

How to effectively change the browser name of the WebDriver object?

I intend to perform some tests by using selenium with multiple web browsers. To distinguish between the different web drivers, I use the following line of code:
((RemoteWebDriver) driver).getCapabilities().getBrowserName();
This will return a String indicating the web browser that is used by the driver object. However, for my Opera WebDriver object this will give me the String 'chrome'. I have tried changing this by explicitly setting the browser name to 'opera' using DesiredCapabilities:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setBrowserName("opera");
WebDriver driver = new OperaDriver(capabilities);
Unfortunately, this does not fix my problem. How do I effectively change the web browser name?
Your basic requirement is to identify browser initialization if I'm right, which can be done by getting user-agent from your browser using JavascriptExecutor as following:
String userAgent = (String) ((JavascriptExecutor) driver).executeScript("return navigator.userAgent;");
//following is for identifying opera browser initialization
if(userAgent.contains("OPR/"){
System.out.println("Browser currently in use is Opera");
}
Similarly you can identify other browser initilisation by referring this link
Unfortunately , you would not be able to change the BrowserName.
What instead you can try is to create function for specifically handling multiple browsers: -
package multiBrowser;
import org.testng.annotations.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.opera.OperaDriver;
import org.testng.annotations.Parameters;
public class MultiBrowserClass {
WebDriver driver;
#Test
#Parameters("browser")
public void multiBrowsers(String browserName) throws InterruptedException{
if(browserName.equalsIgnoreCase("firefox")){
System.setProperty("webdriver.firefox.marionette","D:\\My Work\\Setup\\JAR\\geckodriver.exe");
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("default");
driver = new FirefoxDriver(myprofile);
}
if(browserName.equalsIgnoreCase("chrome")){
System.setProperty("webdriver.chrome.driver", "D:\\My Work\\Setup\\JAR\\driver\\chromedriver.exe");
driver = new ChromeDriver();
}
else if(browserName.equalsIgnoreCase("IE")){
System.setProperty("webdriver.ie.driver", "D:\\My Work\\Setup\\JAR\\driver\\IEDriverServer.exe");
driver = new InternetExplorerDriver();
}
else if(browserName.equalsIgnoreCase("opera")){
System.setProperty("webdriver.opera.driver", "D:\\My Work\\Setup\\JAR\\driver\\operadriver.exe");
driver = new OperaDriver();
}
driver.manage().window().maximize();
driver.navigate().to("https://");
System.out.println(driver.getTitle());
driver.findElement(By.xpath("//div[#id='navbar-main']/ul/li[5]/a")).click();
driver.findElement(By.xpath("//div[#id='navbar-main']/ul/li[5]/ul/li/a")).click();
Thread.sleep(3000);
driver.findElement(By.name("email")).clear();
driver.findElement(By.name("email")).sendKeys("abc#mm.kk");
driver.findElement(By.name("password")).clear();
driver.findElement(By.name("password")).sendKeys("1qaz2wsx");
Thread.sleep(3000);
driver.findElement(By.xpath("//form[#id='loginform']/div[8]/button")).click();
Thread.sleep(5000);
if(driver.getPageSource().contains("Welcome abc#mm.kk")){
System.out.println("User Successfully logged in");
}else{
System.out.println("Username or password you entered is incorrect");
}
driver.quit();
}
}
=======

log in in all browsers with selenium

There is problem I cant resolve for 2 days. I need to login in many browsers in many machines on same sites. Its time-consuming task so I decide to do it with Selenium. I think problem is that while running test selenium does not save cookies. I find that its real to save cookies in file and then open them in next selenium tests but i need all browsers are logged in for manual testing. Here is my code
package automationFramework;
import java.io.File;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
public class FirstTestCase {
private WebDriver driver;
private String baseUrl;
private boolean acceptNextAlert = true;
private StringBuffer verificationErrors = new StringBuffer();
#Before
public void setUp() throws Exception {
File profileDirectory = new File(
"C:\\Users\\User\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\n8a2y7sp.default");//path to firefox profile
FirefoxProfile profile = new FirefoxProfile(profileDirectory);
driver = new FirefoxDriver(profile);
baseUrl = "http://facebook.com/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
#Test
public void testVk() throws Exception {
driver.get(baseUrl);
driver.findElement(By.id("email")).clear();
driver.findElement(By.id("email")).sendKeys(""); // login
driver.findElement(By.id("pass")).clear();
driver.findElement(By.id("pass")).sendKeys(""); //password
driver.findElement(By.id("loginbutton")).click();
}
#After
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}
What exactly do you mean? Do you try to achieve multiple browsers that access the same site simultaneously? If so, you will need to set up more than one driver instance.
If you'd like to achieve it sequentially, just use a loop where you open the driver and get the URL, do your thing, then kill the driver instance, repeat.

Categories

Resources