Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9237407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:31:43+00:00 2026-06-18T07:31:43+00:00

i folks, i am using junit with selenium web driver 2.28. the problem is

  • 0

i folks,
i am using junit with selenium web driver 2.28.
the problem is if i run a successful test case the web drives is able to close the firefox instance, but when a test case fails the selenium web driver is not able to close the firefox.
i am using FF 15.0.1 with selenium-server-standalone-2.28.0.jar.
please respond
thanks
Sahil

private void startWebdriver() throws UIException{
    //2) Prevent re-use.
    if(UIHandlerWD.this.profile == null)
        throw new 
            UIException(
                UIException.Code.UI, 
                    "Webdriver instance cannot be instantiated."
            );              

    //3) Configure Selenium Webdriver.
    if (this.profile.browserType.equalsIgnoreCase("*firefox")){
        FirefoxProfile fProfile = new FirefoxProfile();

       // profile.SetPreference("network.http.phishy-userpass-length", 255);
        fProfile.setAcceptUntrustedCertificates(true);
        DesiredCapabilities dc = DesiredCapabilities.firefox();
        dc.setJavascriptEnabled(true);
        dc.setCapability(FirefoxDriver.PROFILE, fProfile);

        //this.webdriver = new FirefoxDriver(dc);
        this.webdriver = new FirefoxDriver(dc);
    }
    else if (this.profile.browserType=="INTERNETEXPLORER")
        this.webdriver = new InternetExplorerDriver();
    else
        throw new 
        UIException(
            UIException.Code.UI, 
                "Unknown browser type '" + this.profile.browserType +"'."
        );          


    //4) Start Webdriver.
    this.webdriver.get(this.profile.getURL().toString());
    this.webdriver.manage().timeouts().
    implicitlyWait(5, TimeUnit.SECONDS);
    this.webdriver.manage().timeouts().
    pageLoadTimeout(this.profile.timeout, TimeUnit.SECONDS);

}

void stopWebdriver() {
    if(this.webdriver != null){
        try{
        Thread.sleep(5000);
        }
    catch (Exception e) {
        // TODO: handle exception
    }
        this.webdriver.close();
    }
    this.webdriver = null;
    this.profile = null;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:31:44+00:00Added an answer on June 18, 2026 at 7:31 am

    Add webdriver.quit() to an @AfterClass method.

    close() will shut the current active window. If the current active window is the last window it is functionally equivalent to performing a quit().

    It does however need to have a valid active session to be able to do this. If your test has failed that session is probably dead, so when you call a close() it doesn’t know where to send the command and throws an Exception.

    quit() will end all sessions and shut down all clients, it’s basically a clean up everything command. It will also not throw any Exceptions if all clients/sessions have already been closed/ended.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Folks, I'm tryning to extract data from web page using C#.. for the moment
Here's the problem folks I'm using a Telerik RadGrid. Within is a FormTemplate with
Folks, I'm using git tools such as git bisect run which need to call
Folks, I am using SIMPLEHTMLPARSER. I am not able to parse HTML, When i
Folks, I have a problem. I'm using AngularJS and I am setting up a
folks, I met a weird problem while using mathematica. As you can see from
I was simply wondering what methods folks are using to test their javascript's execution
folks, I am able to read the excel sheet using apache POI in grails
I'm using ASP.NET 4 / VB.NET / IIS to build a web application. Folks
Folks, We have been using OpenXml APIs found in System.IO.Packaging for creating a package

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.