Session ID Is Null Using WebDriver after calling quit()

Hello Friends, Am Trying to work on uitest framework test related to AddFormTest in reference application distro and encounting such an error NFO] Downloaded from openmrs-repo: - , this test passes on chrome driver locally however it fails on firefox driver, considering this seems to be related with my current changes since there are those tests that pass :slightly_smiling_face:

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

can we catchup and review this tomorrow first thing in the morning?


Sure thanks @k.joseph for response

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

  1. it seems webdrivers both chrome and firefox are being quit() even before they get reached in tearDown methods something like

    public void tearDown() throws Exception {


  2. 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

1 Like

From With ReferenceApplication-distribution uitest

  • We can use AddFormTest for testing purpose

  • Then i had configured this test to be able to pick TestBase as its source under debug configuration

  • Then we can run a junit test or in debug mode without any changes on the code

  • nosuchsessionexception-session-id-is-null-using-webdriver-after-calling-quit()? is thrown

is that happening on a specific browser, i don’t seem to face that at all. provide a little more details @sharif

That error happens on only firefox browser , for chrome all is well thanks

I have tried with firefox still and didn’t have this issue, could we catch up again. BTWm have you tried my pointer from yesterday about your ide?

Yes sure i changed from eclipse to intellij IDEA

Probably my IDE could be not well configured, hopefully we can catch up again thanks

@sharif are you still blocked with this

Nope thanks

1 Like

what happened?

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 :slightly_smiling_face:

    public void tearDown() throws Exception {