Session [(null externalkey)] not available and is not among the last 1000 terminated sessions.

2,143 views
Skip to first unread message

almightyjoygasm

unread,
Oct 16, 2014, 11:10:55 AM10/16/14
to seleniu...@googlegroups.com
Hi

Im using Selenium Grid.  When I run a test against my test site, I will hit the following error.

Message = System.InvalidOperationException : Session [(null externalkey)] not available and is not among the last 1000 terminated sessions. Active sessions are[]

StackTrace = at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByCssSelector(String cssSelector) at OpenQA.Selenium.By.<>c__DisplayClass1e.<CssSelector>b__1c(ISearchContext context) at OpenQA.Selenium.By.FindElement(ISearchContext context) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by) at AutomatedTests.MAP_ClientList.RefCode(IWebDriver driver, String refCode) in c:\TFSProjects\BlueMoonUKTax\Main\Automated Tests\Automated Tests\AutomatedTests\TestMaps\MAP_ClientList.cs:line 80 at AutomatedTests.ClientList.ValidateData(IWebDriver driver, StringBuilder verificationErrors, D_ClientList classData) in c:\TFSProjects\BlueMoonUKTax\Main\Automated Tests\Automated Tests\AutomatedTests\TestFunctions\ClientList.cs:line 151 at AutomatedTests.ClientList.Validation(IWebDriver driver, String clientList_NamedRowsValue, StringBuilder verificationErrors, List`1 clientList_DataList) in c:\TFSProjects\BlueMoonUKTax\Main\Automated Tests\Automated Tests\AutomatedTests\TestFunctions\ClientList.cs:line 108 at AutomatedTests.ReesTest1.ReesTest1_MainTest() in c:\TFSProjects\BlueMoonUKTax\Main\Automated Tests\Automated Tests\AutomatedTests\TestScripts\ReesTest1.cs:line 131

The test does not fail immediately, but will navigate around the site and to different pages before failing.

If I run the same tests without desired capabilities (i.e. not sending to the grid), the test runs fine.

I have managed to get tests running with desired capabilities before, so not sure why its failing now.

My Hub set up is batch file as follows:
cd C:\Automated Tests\Selenium
java -jar selenium-server-standalone-2.43.1.jar -role hub -hubhost my.hub..ip.address -port 4445

My Node set up is batch file as follows:
cd c:\Automated Tests\Selenium\
java -jar selenium-server-standalone-2.43.1.jar -port 5560 -role node -nodehost my.node.ip.address -hub http://my.hub.ip.address:4445/grid/register -browser "browserName=firefox,version=33.0,maxInstances=2,platform=WINDOWS" -nodeTimeout 600 -maxSession 10


I would be grateful for any help.

Best regards
AlmightyJoygasm




almightyjoygasm

unread,
Oct 20, 2014, 11:12:14 AM10/20/14
to seleniu...@googlegroups.com
Is there anybody available to assist with this issue?

Krishnan Mahadevan

unread,
Oct 24, 2014, 10:53:41 PM10/24/14
to Selenium Users
You would need to add a bit more context around the below two statements.

If I run the same tests without desired capabilities (i.e. not sending to the grid), the test runs fine.

I have managed to get tests running with desired capabilities before, so not sure why its failing now.





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/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/33ce29db-4edb-4450-be16-a7330c1d98de%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

shree vaze

unread,
Sep 22, 2015, 9:34:50 PM9/22/15
to Selenium Users
Hello,

This issue may occur sometimes due to stale elements as well. Although the error message is not relevant but this occurs when you are using old object references in your script.

Try instantiating new objects of your elements when you close a driver session.

Hope this helps.

Thanks,
Shrirang
Reply all
Reply to author
Forward
0 new messages