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://edureka.co/");

driver.close();

}

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

edited Nov 23, 2020 by Niroj 2,090 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,840 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 27, 2018 in Selenium by nsv999
• 5,500 points
8,116 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
13,441 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 24, 2020 in Selenium by Niroj
• 82,840 points
8,500 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,840 points
870 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP