How Do I keep a Selenium Session alive and active even if I log off?

Greetings..

With help from EE I was able to overcome some Issues that I was having with automating a UPC listing program on Declutr.com. To facilitate the automation program Selenium WebDriver was used along with the default FireFox Driver.

The application is on a Virtual server and is accessed via RDC (Remote Desktop Connection). The program accesses a Long list of UPC's and presents them to the Declutr.com web program for processing.  To go through the entire list of UPC's can take a Very long time to run and Process...

Here is the Question: Is there a way to tell Selenium and or the FireFox driver  to keep the Session Alive/Active/Open even after the RDC connection has been dropped.

It turns out that the small C# program that presents the UPC codes to the 'Web Page' remains active but the Selenium based web page ceases to respond or accept additional UPC's after the connection to the server is dropped.

I think ( but I don't know) that there may be a way to do this with the Chrome WebDriver but that Driver had problem running properly on the Hosted Virtual Server..

Thanks in advance for any help in this matter.
LVL 2
rrbeckerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rrbeckerAuthor Commented:
Hi all..

A little update...
If I log into the Virtual server via RDC and fire off my program, The Selenium FireFox Browser window Will stop 'Processing' the UPC's even if I just Minimize the RDC window

BTW the Website in question is www.declutr.com

So... is there a way to run this 'Headless' and still have access to the Browser window after All the UPC's have been processed?? After the UPC codes have been process the I need to 'Submit' the entire batch so that they can be 'Credited/Updated' to my account...
Bob LearnedCommented:
Let's start with a simple question first:

Are you logging out from the RDC session, or disconnecting?
rrbeckerAuthor Commented:
Hi Bob...  I'm sorry about having to ask for help again but this is a bit strange to me.. It doesn't make much sense...

Anyway.. When 'leaving' the RDC Connection I always just Disconnect and Not Log off.

The interesting this is that it I leave the connection open and just minimize the connection window, the 'Browser' stops processing the UPC codes. If I maximize the 'Connection Window' then it will continue processing UPC's if there are any left. The C# program continues to cycle through the UPC's as though all was well...


BTW.. I know that I really can not run this as headless but is there an available 'FirefoxDriver Capability()' that will force the Browser to run in a kind of 'Modal' mode??

I mentioned that the ChromeDriver had problems on the Windows 2008 Server but it you think that the Chrome Driver is a better way to go then I'll implement that again and we can work out the issues with Win 2008 server...

Thanks again for your help... Sorry tha I am such a pain... BTW.. it works well as long as the connection is active and the Window is 'Up'.


Rick
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

Bob LearnedCommented:
Rick,

How many UPCs do you have to process?  I am thinking outside of the box here, but I was wondering if would help to check the connection, and attempt to reconnect.  I was reading where Firefox driver doesn't support keep alive after 2.13 (see "ScalingWebDriver).

Another approach, which would seem inherently slower, would be to recreate the web driver for every request, in order to keep everything fresh and connected.
Bob LearnedCommented:
Also, there are different web drivers:

AndroidDriver
ChromeDriver
EventFiringWebDriver
FirefoxDriver
HtmlUnitDriver
InternetExplorerDriver
PhantomJSDriver
RemoteWebDriver
SafariDriver

RemoteWebDriver example:

IWebDriver WebDriver = null;


try
{
  System.Uri uri = new System.Uri("http://localhost:7055/hub");
  WebDriver = new RemoteWebDriver(uri, DesiredCapabilities.Firefox());
  Console.WriteLine("Executed on remote driver");
}
catch (Exception)
{
  WebDriver = new FirefoxDriver(firefoxProfile);
  Console.WriteLine("Executed on New FireFox driver");

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob LearnedCommented:
Reading up on headless now:

SELENIUM WEBDRIVER - USING A HEADLESS BROWSER IN .NET
http://deanhume.com/home/blogpost/selenium-webdriver---using-a-headless-browser-in--net/69
rrbeckerAuthor Commented:
Hey Bob...  Thanks for the replay...

I am sorry to tell you  ( or happy depending on your perspective ) that I Changed out the Firefox Driver and replaced it with Your Original suggested Chrome Driver. I then worked out the problem that I had originally on the 2008 server and started up the tests again...

This time ALL went well... I can now Close the RDC connection and or minimize the window and every thing continues to work... It is obvious that the Firefox Driver ( which I guess is the default driver for Selenium )  has some very strange issues...

Anyway Thanks for your help again and working with me..

Rick
rrbeckerAuthor Commented:
Thanks again Bob...
rrbeckerAuthor Commented:
Hi Bob...

I also looked at the possibility of running it Headless but decided that it would not be any good for me since there as some 'Post Processing' things that need to be done..

Changing to the Chrome Drive took care of the 'Immediate' issues...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Remote Access

From novice to tech pro — start learning today.