Checking on stackover flow to find some related comments concerning about initializing driver where by our written webdriver seems not to have been well initialized here startWebDriver, how am also skeptical about this ,because ideally since chrome is initialised i would think firefox would also by default get initialized under the hood . Could anyone help me out about the reall cause of this error about sessionID being null after using webdriver.quit() which would be really the real cause as indicated here link
i think Driver is not null and hence causing NullPointerException which is also part of the error logs
Your Help would be muchly appreciated cc @k.joseph , @dkayiwa@ibacher@raff
SesssionID being null, might ideally caused by the following
Implementation of SauceOnDemandSessionIdProvider class which was being used 8 years ago and its still being used, am thinking we might have something more elaborate to implement on ratherthan SauceOnDemandSessionIdProvider since i would say it may not be stable at the moment.
. Since this class is the origin of the method that might be the cause as seen here
public interface SauceOnDemandSessionIdProvider {
/**
* Return the session id for the SeleniumRC/WebDriver instance - this equates to the Sauce OnDemand
* Job id.
* @return string representing the session id for the SeleniumRC/WebDriver instance
*/
String getSessionId();
}
And here, we might need its improvements however, we find a way initializing sessionID using webdrivers with in that TestBase rathar than implementing SauceOnDemandSessionIdProviders, neverthlesss we only use one if implemented methods
it seems webdrivers both chrome and firefox are being quit() even before they get reached in tearDown methods something like
@After
public void tearDown() throws Exception {
driver.quit();
}
Updating sauceLabs library Most of this part of this framework depend on sauceLab library and we had ignored its use case , i think we would like to resurect it also to make things sorted out cc @k.joseph
Using @After method is being called before @Before method under any test method which is ideally a wrong implemetation of objects cc @k.joseph@dkayiwa@ibacher, any suggestion will be muchly appreciated
.
the @After is getting triggered after the parent classes fail to initialise which triggers the respective @before, attach the entire log and steps to reproduce it and i will take a look from my end
The problem was with the driver configuration with in eclipse and shifting to intelij made things very easy , Besides that this method wasn’t executable , inotherowords the driver could quit in the before method hence returning null before enhancing other methods , For intellij , it made life simpler
@After
public void tearDown() throws Exception {
headerPage.clickOnHomeIcon();
headerPage.logOut();
}