WebDriver - All test cases skipped because of one failure

4,121 views
Skip to first unread message

fmtjatt

unread,
Jul 11, 2013, 3:02:47 PM7/11/13
to webd...@googlegroups.com
 Hi All,

I occasionally run into issues where ALL tests cases are skipped if one of the test cases failed. I again faced this problem today as my first test case failed and remaining 52 tests were skipped even though they don't have any dependency on the failed test.
The test case failed because it was expecting a model dialogue but it didn't appear in time as page was probably still loading. Has anyone faced this problem before?

Test case failed because this error:
org.openqa.selenium.NoAlertPresentException: No alert is active (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 149 milliseconds Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21' Session ID: 8746c401-d77c-4223-ad96-7c3a89f624b4 Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{platform=WINDOWS, elementScrollBehavior=0, javascriptEnabled=true, enablePersistentHover


===============================================
Regression.Suite
Total tests run: 53, Failures: 1, Skips: 52
Configuration Failures: 65, Skips: 76
===============================================

I'm using Java/TestNG with WebDriver 2.32 and IE 8.

Thanks,

Ashok Tulachan

unread,
Jul 11, 2013, 3:26:44 PM7/11/13
to webd...@googlegroups.com
Seems like you are adding dependency on your test cases such as dependsOnGroups or dependsOnMethods which is one of the feature of TestNG.

Remove those and you should be good to go.

Dependency are made so that it skips all tests if one of the test fails.

Also, No Offense but try to understand more about TestNG or any tool before blindly implementing it :).

Hope that helps!




--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
- "If you haven't suffered, you haven't lived your life."

Regards,
Ashok Tulachan
 

fmtjatt

unread,
Jul 11, 2013, 4:37:41 PM7/11/13
to webd...@googlegroups.com
Ashok,

As I mentioned in my post there are NO group or method Dependencies on this test. This has happened with other tests as well which also had no dependecies. It seems like IE driver or WebDriver triggers some chain reaction, in case one test case fails the rest are skipped. This does not happen with ALL failures. It only happens with some unexpected failures, such as this case where Model dialogue did not appear in time. 

Thanks,

Ashok Tulachan

unread,
Jul 11, 2013, 5:03:17 PM7/11/13
to webd...@googlegroups.com
Then you need to post your tests cases and html page here in order to find out what went wrong.

We cannot just randomly guess the solution for your problem



Thanks,

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Krishnan Mahadevan

unread,
Jul 11, 2013, 10:33:02 PM7/11/13
to webd...@googlegroups.com
Gagan,

To begin with your problem is more TestNG centric than WebDriver centric. 

You would need to show us how have you designed your tests and how are you executing them to dig more on the failures part. You would need to do that on the TestNG-users forum and NOT here. 


--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
Message has been deleted

fmtjatt

unread,
Jul 12, 2013, 1:10:53 PM7/12/13
to webd...@googlegroups.com
Krishnan,

Thanks for your reply. I don't think the problem is entirely TestNg Centric. One of my test failed again today and it caused others to skip. The tests which are being skipped have no dependency on the tests which are failing.
It is some sort of chain reaction which is causing WebDriver or IE driver to thing that the session is NULL and it cannot continue with the next test. The others skipped due to following error:

org.openqa.selenium.remote.SessionNotFoundException: Session ID is null Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21' Driver info: driver.version: InternetExplorerDriver at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:273) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:66) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569) at org.openqa.selenium.ie.InternetExplorerDriver.getScreenshotAs(InternetExplorerDriver.java:88) at test.java.core.WebDriverSetup.takeScreenshot(WebDriverSetup.java:102) ... Removed 25 stack frames

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died. Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569) at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:423) at test.java.core.WebDriverSetup.tearDown(WebDriverSetup.java:91) Caused by: org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:16264 refused Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:75) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527) ... 29 more Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:16264 refused at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190) at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:151) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:125) at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:701) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:517) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906) at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:316) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:295) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:66) ... 30 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) at java.net.Socket.connect(Socket.java:579) at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180) ... 38 more ... Removed 26 stack frames


On Thursday, July 11, 2013 7:33:02 PM UTC-7, Krishnan wrote:
Gagan,

To begin with your problem is more TestNG centric than WebDriver centric. 

You would need to show us how have you designed your tests and how are you executing them to dig more on the failures part. You would need to do that on the TestNG-users forum and NOT here. 

On Friday, July 12, 2013, Ashok Tulachan wrote:
Then you need to post your tests cases and html page here in order to find out what went wrong.

We cannot just randomly guess the solution for your problem
On Thu, Jul 11, 2013 at 3:37 PM, fmtjatt <> wrote:
Ashok,

As I mentioned in my post there are NO group or method Dependencies on this test. This has happened with other tests as well which also had no dependecies. It seems like IE driver or WebDriver triggers some chain reaction, in case one test case fails the rest are skipped. This does not happen with ALL failures. It only happens with some unexpected failures, such as this case where Model dialogue did not appear in time. 

Thanks,

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.

To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
- "If you haven't suffered, you haven't lived your life."

Regards,
Ashok Tulachan
 

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.

To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Marcus Merrell

unread,
Jul 12, 2013, 1:43:39 PM7/12/13
to webd...@googlegroups.com
It's hard to know how to proceed, so I'll go with a series of questions I'd have for myself if I were to have this problem. I'd probably write down these questions when I was far away from a computer so I could really try to wrap my head around the problem, rather than just continually hacking away. These are mostly questions for you to try to answer yourself--without a ton more information we can't help much more than this, and with a ton of information, it would still be difficult.

If you can get to where you can ask and answer these questions yourself on similar issues, you might find a lot less frustration and need for help...

Questions for you to ponder:
- Does the same thing happen in Chrome and/or Firefox if these tests fail? I understand if your requirement is to run them in IE, but it would be helpful to know whether or not it's an IE-specific thing
- If you run the tests individually, do they pass?
- If you run them in small groups (using the -Dgroups flag from the command-line), does a failure still induce skippage?
- If you were to add dependsOn annotations, in effect running the problem test last, would it help or hurt matters?
- Does it matter the *nature* of the failure? I.e. is it only WebDriverExceptions or NoSuchElementExceptions that cause the skippage, or is it any and every time there is a failure?
- Can you do a step-through debugging, where you set a breakpoint at a known area of breakage, and then step through the WebDriver code? This isn't nearly as daunting as it sounds, and can be quite instructive for other issues. You can download the sources via Maven if you're using it
- Do the surefire reports generated from TestNG illuminate anything?
- Is there any amount of logging or exception handling you can add that will further reveal the state of the test when it failed?

- If it is an IE-specific thing, can you put a breakpoint near the area of breakage, then when you're at that breakpoint, keep an eye on the IE browser itself as it dies?
- After IE dies, is there some leftover process that's still running? If you kill IE, will that make it "come back to life" again?
- Is there some set of IE event or error logs you can access that can tell you what happened when it died and why WebDriver might not be able to connect again?

I'm certain I could think of a bunch more, but these are a jumping-off point. I have no idea how to even begin to answer some of these questions, but they are answerable, and if I had to do it I know the procedure for getting the answers would just be a few Googles away...

Let us know what kind of progress you are able to make...
MM



To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.

fmtjatt

unread,
Jul 12, 2013, 2:01:59 PM7/12/13
to webd...@googlegroups.com
Marcus,

Please see my answers inline below in Red:


On Friday, July 12, 2013 10:43:39 AM UTC-7, Marcus Merrell wrote:
It's hard to know how to proceed, so I'll go with a series of questions I'd have for myself if I were to have this problem. I'd probably write down these questions when I was far away from a computer so I could really try to wrap my head around the problem, rather than just continually hacking away. These are mostly questions for you to try to answer yourself--without a ton more information we can't help much more than this, and with a ton of information, it would still be difficult.

If you can get to where you can ask and answer these questions yourself on similar issues, you might find a lot less frustration and need for help...

Questions for you to ponder:
- Does the same thing happen in Chrome and/or Firefox if these tests fail? I understand if your requirement is to run them in IE, but it would be helpful to know whether or not it's an IE-specific thing
        Our application only support IE 8 at this point, so I'm unable to verify it in other browsers.
- If you run the tests individually, do they pass?
     Yes
- If you run them in small groups (using the -Dgroups flag from the command-line), does a failure still induce skippage?
      Have not tried this option. I will try it and report back
- If you were to add dependsOn annotations, in effect running the problem test last, would it help or hurt matters?
      No it should not hurt but the problem is that any random test which fails can cause the chain failure/skip reaction. So it is hard to pin point  which tests to run at last
- Does it matter the *nature* of the failure? I.e. is it only WebDriverExceptions or NoSuchElementExceptions that cause the skippage, or is it any and every time there is a failure?
    The nature of failure can range from not finding an element, an unexpected model dialogue box popping up and today WebDriver did not click on Submit button and went on to next step. Since next step was not available yet the test failed and that caused rest of the tests to skip.
- Can you do a step-through debugging, where you set a breakpoint at a known area of breakage, and then step through the WebDriver code? This isn't nearly as daunting as it sounds, and can be quite instructive for other issues. You can download the sources via Maven if you're using it   
  I can do step-through debugging it if it was one or two tests. Since tests fails randomly it is hard to debug. 
 
- Do the surefire reports generated from TestNG illuminate anything?
     Not sure what do you mean here. But what I notice is that once a test fails for any reason (element not found, Model dialog is present) then rest of the test fail due to Session ID is NULL or  Unable to reach browser errors
- Is there any amount of logging or exception handling you can add that will further reveal the state of the test when it failed?
I'm new to Java, if you can recommend something then i would be more than happy to add additional loggin.
- If it is an IE-specific thing, can you put a breakpoint near the area of breakage, then when you're at that breakpoint, keep an eye on the IE browser itself as it dies?
     Since random tests fail at random points it has been hard to debug but I will try to see if I can pinpoint the problem
- After IE dies, is there some leftover process that's still running? If you kill IE, will that make it "come back to life" again?
I checked and most of the time all IEDriver and iexplorer process are cleaned up, so there are no lingering processes left after tests fails
- Is there some set of IE event or error logs you can access that can tell you what happened when it died and why WebDriver might not be able to connect again?
  Checked System Events and did not find anything in there for today related to IE. However, I found the following for WebDriver in yesterday's log:
Faulting application name: IEDriverServer.exe, version: 2.32.3.0, time stamp: 0x516c55c6
Faulting module name: IED4152.tmp, version: 0.0.0.0, time stamp: 0x516c55ba
Exception code: 0xc0000005
Fault offset: 0x00000000000a87bb
Faulting process id: 0xfe8
Faulting application start time: 0x01ce7e7d09978059
Faulting application path: C:\automation\EPMS\InternetExplorerDriver\IEDriverServer.exe
Faulting module path: C:\Users\AppData\Local\Temp\IED4152.tmp
Report Id: 6bb75474-ea70-11e2-bb9d-000c291bf922

Krishnan Mahadevan

unread,
Jul 12, 2013, 2:05:55 PM7/12/13
to webd...@googlegroups.com
I somehow have this feel that your tests are not working with a local WebDriver instance [ either created inside the test method or using ThreadLocal ] but seem to be sharing the same global browser instance!!

You would need to add more contextual information than you already have.. Else its as good as shooting in the dark. 

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

darrell

unread,
Jul 12, 2013, 2:59:18 PM7/12/13
to webd...@googlegroups.com
I can see how everyone might think this is TestNG centric. I don't use TestNG but the fact that it is reporting:

===============================================
Regression.Suite
Total tests run: 53, Failures: 1, Skips: 52
Configuration Failures: 65, Skips: 76
===============================================

makes me see that TestNG is skipping 52 tests. So the question I would ask is why does TestNG print a test was skipped. What is the criteria for a test to be SKIPPED. This is what I'm thinking as I read your post. If I go to the TestNG documentation, within 10 seconds I find out that a 'skipped' test is a test which fails in the @Before. So you have:

@Before - setup for the test
@Test - run the test but it fails due to an unexpected alert (or something)
@After - should be putting the test in exactly the same starting before as before the @Before
// report the failure
@Before - the last test did not clean up properly, so the @Before fails
// report a skipped
@Before - the last test did not clean up properly, so the @Before fails
// report a skipped
@Before - the last test did not clean up properly, so the @Before fails
// report a skipped
@Before - the last test did not clean up properly, so the @Before fails
// report a skipped
@Before - the last test did not clean up properly, so the @Before fails
// report a skipped
@Before - the last test did not clean up properly, so the @Before fails
// report a skipped

This goes on for 52 test cases. Technically, I figured out what was going wrong without a single discussion of Selenium or WebDriver. Realistically, you now know the problem is that the last failure did not tear down properly. So maybe posting the @Before, @After and the @Test which fails will help us understand how to make the @After tear down all tests properly. Or maybe you can figure that out now that you understand the problem.

Darrell

P.S. sometimes the easiest way to do an @Before is force the app into a known state thus making all tests start at the same state rather than trying to make the @After handle the different states each test ends at. Maybe all @Before have a driver.get() to put you at the home page regardless of were the last test left off.

fmtjatt

unread,
Jul 12, 2013, 3:24:52 PM7/12/13
to webd...@googlegroups.com
"You would need to add more contextual information than you already have.. Else its as good as shooting in the dark."

Krishnan,

Please let me know what additional information can I provide? I have a setup method which creates the WebDriver instance before each test method. The method is below:

         @BeforeMethod(alwaysRun=true)
        @Parameters({"environment", "browser"})
        public void setup(String environment, String browser) throws InterruptedException, FileNotFoundException, IOException {
           
            File file = new File("C:/automation/EPMS/InternetExplorerDriver/IEDriverServer.exe");
            System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
           
            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); 
            capabilities.setCapability("requireWindowFocus", true);
           
                   
            //Open browser based on what is being passed as parameter in testng.xml file
            if(browser.contains("IE")){
                driver = new InternetExplorerDriver();
            }else if(browser.contains("FF")){
                driver = new FirefoxDriver();
            }else{
                boolean invalidBrowser = true;
                Assert.assertFalse(invalidBrowser, "Browser type must be IE or FF");
            }
       
           
            //Navigate to the test url by what is being passed as parameter in testng.xml file           
            if (environment.contains("branch")){
                baseUrl = "https://xxxxx/login.jsp";
                Reporter.log("Performing tests on "+environment+ " environment");
            }else if (environment.contains("autotrunk")){
                baseUrl = "https://xxxxx/login.jsp";
                Reporter.log("Performing tests on "+environment+ " environment");
            }else if(environment.contains("production")){
                baseUrl = "https://xxxxx/login.jsp";
                Reporter.log("Performing tests on "+environment+ " environment");
            }else if(environment.contains("trunk")){
                baseUrl = "https://xxxxx/login.jsp";
                Reporter.log("Performing tests on "+environment+ " environment");
            }else{
                baseUrl=null;
                Reporter.log("Please provide valid test environment");
                Assert.assertNotNull(baseUrl, "Please provide valid test environment");
            }
           
            //Navigate to URL, Maximize the window, Setup page and object timeout to 30 seconds
            driver.get(baseUrl);
            driver.manage().window().maximize();
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
           
            if(!environment.contains("production"))    {       
                //In IE if Security certificate message is displayed then click continue to website link
                driver.navigate().to("javascript:document.getElementById('overridelink').click()");
                Thread.sleep(3000);
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.

To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Krishnan Mahadevan

unread,
Jul 12, 2013, 3:27:15 PM7/12/13
to webd...@googlegroups.com
Is this setup method part of a common base class ? If yes the. What you are seeing is perfectly valid behavior from TestNG. 

If the configuration method fails then TestNG skips the test methods. 
I'm certain I could think of a bunch more, but these are a jumping-off point. I have no idea how to even begin to answer some of these questions, but they are answerable, and if I had to do it I know the procedure for getting the answers would just be a few Googles away...

Let us know what kind of progress you are able to make...
MM



On Fri, Jul 12, 2013 at 12:10 PM, fmtjatt <> wrote:
Krishnan,

Thanks for your reply. I don't think the problem is entirely TestNg Centric. One of my test failed again today and it caused others to skip. The tests which are being skipped have no dependency on the tests which are failing.
It is some sort of chain reaction which is causing WebDriver or IE driver to thing that the session is NULL and it cannot continue with the next test. The others skipped due to following error:

org.openqa.selenium.remote.SessionNotFoundException: Session ID is null Build info: version: &apos;2.32.0&apos;, revision: &apos;6c40c18&apos;, time: &apos;2013-04-09 17:23:22&apos; System info: os.name: &apos;Windows 7&apos;, os.arch: &apos;amd64&apos;, os.version: &apos;6.1&apos;, java.version: &apos;1.7.0_21&apos; Driver info: driver.version: InternetExplorerDriver at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:273) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:66) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569) at org.openqa.selenium.ie.InternetExplorerDriver.getScreenshotAs(InternetExplorerDriver.java:88) at test.java.core.WebDriverSetup.takeScreenshot(WebDriverSetup.java:102) ... Removed 25 stack frames

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died. Build info: version: &apos;2.32.0&apos;, revision: &apos;6c40c18&apos;, time: &apos;2013-04-09 17:23:22&apos; System info: os.name: &apos;Windows 7&apos;, os.arch: &apos;amd64&apos;, os.version: &apos;6.1&apos;, java.version: &apos;1.7.0_21&apos; Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569) at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:423) at test.java.core.WebDriverSetup.tearDown(WebDriverSetup.java:91) Caused by: org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:16264 refused Build info: version: &apos;2.32.0&apos;, revision: &apos;6c40c18&apos;, time: &apos;2013-04-09 17:23:22&apos; System info: os.name: &apos;Windows 7&apos;, os.arch: &apos;amd64&apos;, os.version: &apos;6.1&apos;, java.version: &apos;1.7.0_21&apos; Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:75) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527) ... 29 more Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:16264 refused at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190) at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:151) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:125) at org.apache.http.impl.client.DefaultRequestDirector.tryExecut<

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+unsubscribe@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

fmtjatt

unread,
Jul 12, 2013, 3:57:45 PM7/12/13
to webd...@googlegroups.com
Krishnan,

Yes the setup and tear downs are part of the base class. What I don't understand is why setups would skip if the test which failed ran the tear down method properly can closed the driver . Here are remaining methods in the base class:

         @AfterMethod(alwaysRun=true)
        public void tearDown() throws IOException{
            driver.quit();
        }
       
        @AfterMethod(alwaysRun = true)
        public void takeScreenshot(ITestResult result) throws IOException {
            Utilities date = new Utilities(driver);
            Reporter.setCurrentTestResult(result);
           
            if (result.isSuccess())
            return;
           
            File f = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
            File outputDir = new File("c://hold/screenshots");
            File saved = new File(outputDir, result.getName()+".png");
            FileUtils.copyFile(f, saved);
            // this works for the TestNG reporter log but not for ReportNG since the results are under the html/ subdir
            Reporter.log("screenshot for test: "+result.getName()+" Url for app under test: ="+driver.getCurrentUrl()+" <img src=\""+saved.getName()+"\">", true);
            //Reporter.log("<a href='"+ outputDir.getAbsolutePath()+"\""+ result.getName() + ".png'> <img src='"+ outputDir.getAbsolutePath()+ result.getName() + ".png' height='100' width='100'/> </a>");
        }  
       

Richard Lavoie

unread,
Jul 12, 2013, 5:23:59 PM7/12/13
to webd...@googlegroups.com
So you are refering to the web driver instance to take screenshots while the driver has quit already ?

Not a good idea. This is bound to failure. 
--

Richard Lavoie

unread,
Jul 12, 2013, 5:25:20 PM7/12/13
to webd...@googlegroups.com
Probably (need to be validated) that the order in which methods are called for the teardown is not defined so soletimes it runs tge right method (screenshot) first then quit the browser instance.

On 2013-07-12, at 15:57, fmtjatt <gagan.d...@gmail.com> wrote:

--

Richard Lavoie

unread,
Jul 12, 2013, 5:35:49 PM7/12/13
to webd...@googlegroups.com
You should take a look here :


States that the order is unspecified.

On 2013-07-12, at 15:57, fmtjatt <gagan.d...@gmail.com> wrote:

--
Reply all
Reply to author
Forward
0 new messages