when I run this code my browser does not appear it flashes and disappears

0 votes
package selenium1;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class OpenBrowser

 {

public static void main(String[] args)

{

    System.setProperty("webdriver.chrome.driver", "C:/Users/karappanl/eclipse-workspace/TestSelenium1/driver/chromedriver.exe");

WebDriver driver = new ChromeDriver();

driver.get("https://bhf.org.uk");

driver.close();

}

}
Nov 21, 2020 in Selenium by anonymous
• 120 points

edited Nov 23, 2020 by Niroj 86 views

1 answer to this question.

0 votes

Hello,

The driver. close() command is used to close the current browser window having focus. 

In case there is only one browser open then calling driver. close() quits the whole browser session. So have a look on drive.close().

Hope it helps!!

answered Nov 23, 2020 by Niroj
• 82,680 points

Related Questions In Selenium

0 votes
0 answers
0 votes
1 answer

Selenium ChromeDriver issue - Want to run it in background, but not as headless browser

This is a flaw with ChromeDriver. Tried ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,520 points
5,034 views
+1 vote
2 answers
0 votes
2 answers

When executing my Jenkins tests with Selenium WebDriver, I do not see a GUI.

Hi eLiJha, I also faced the same issue ...READ MORE

answered Jul 15, 2019 in Selenium by nayan
• 160 points
7,265 views
0 votes
1 answer

I am not able to generate extent report with screenshot in selenium cucumber java .. Please help me out

Hello @kanikahans, You need to define Extent Report ...READ MORE

answered Aug 23, 2020 in Selenium by Niroj
• 82,680 points
1,740 views
0 votes
1 answer

i cannot add chromedriver to my path on mac.what should i do? can you tell me full procedure? i am new to selenium.

Hello @Divya, You can refer this regarding your ...READ MORE

answered Nov 25, 2020 in Selenium by Niroj
• 82,680 points
71 views