selenium-ide
selenium-ide copied to clipboard
Allow selenium-side-runner does not close browser instance
🚀 Feature Proposal
Launch a browser automation task (selenium test) and not close the browser when It finish so you can use manually It (the browser)
Alternatively would be a good idea yo have a selenium taskbar like favourites bar where you could launch selenium ide tests without opening selenium ide explicitly
Motivation
Can continue work that is not worth of automatize manually.
Imagine some part of your work are always the same, so you use selenium for that, but other require such automatized task and then you manually continue the work
I can imagine: run testA to login and browse to some Page with questions and checkbox - manually fill some texto - run testB which will submit and click on obvious choices
Example
We work with zenworks (a management software). It has a remote Desktop feature which need fill a search box with the name or the IP, click the search box, select the first result found, click on control remote button, click on Accept certificate, work with the remote Desktop inside a Windows which is out of browser
I would like to have a command línea tool which do such thing. Our config not allow work with native command line client
Thank you very much
I was about to ask if it was possible to run the side-runner without closing the browser, but by your request i think not. Some commands i run in the IDE don't work on the side-runner and the reverse also happens, without closing the browser would be easier to debug and fix.
Sadly I'm using ui.vision for this task. They have a nice alternative (they call selenium++) and solve some issues like this
The chromeOptions has a capability "detach" which should leave the webdriver open unless told to quit. e.g. selenium-side-runner -c "goog:chromeOptions.detach=true browserName=chrome" *.side
However, I tested this and the Se runner ignored it. The browser closes anyway. I'm running Selenium IDE on Chrome inside a Jenkins build, with Xvfb as the display. When running the test, imagemagick's import can save screenshots, but once the test completes, the screenshots are empty black. If there was an option to leave the browser open, I could capture the last screen and get a better idea of what went wrong.
you can delete the cleanup code at node_modules\selenium-side-runner\dist\index.js
if (!suite.tests) {
// not parallel
const cleanup = suite.persistSession ? '' : 'beforeEach(() => {vars = {};}); /*afterEach(async () => (cleanup()));*/' ;
I'm having the same problem and using the command line:
selenium-side-runner -c "goog:chromeOptions.detach=true browserName=chrome" *.side
does not keep the browser open after running.
I tried removing the whole line in the index.js:
const cleanup = suite.persistSession ? '' : 'beforeEach(() => {vars = {};});afterEach(async () => (cleanup()));';
but then it gave an error: cleanup is not defined.
I then tried removing the first section of the conditional statement
if (!suite.tests){
and removed:
// not parallel const cleanup = suite.persistSession ? '' : 'beforeEach(() => {vars = {};});afterEach(async () => (cleanup()));'; writeJSFile(_path.default.join(projectPath, (0, _util2.sanitizeFileName)(suite.name)), 'jest.setMock('selenium-webdriver', webdriver);\n// This file was generated using Selenium IDE\nconst tests = require("./commons.js");${code.globalConfig}${suite.code}${cleanup}
);`
and it then said 'No tests found'.
Any other ideas to keep the browser window open? I think this is a bug and it should be a command line parameter as @RLeeOSI mentioned goog:chromeOptions.detach=true
@nassausky
you can just remove afterEach(async () => (cleanup()));
,it works in my project。
And I find the settings of test suites has a option named Persist session , you can try to check this opetion
Any new solution for this problem @Iyqandy ?
@nassausky you can just remove
afterEach(async () => (cleanup()));
,it works in my project。And I find the settings of test suites has a option named Persist session , you can try to check this opetion
I tested & the runner is not respecting the 'persist session' *or at least not in the way requested I suspect it is respecting it between tests. The problem is when the runner cleans up, it clears all sessions period. Also tried setting 'run in parallel' as the code in question appears to check for both settings There must be another cleanup task after parallel processes complete Also, it doesn't help to run the webdriver in a separate process and specify a server for the runner It sends commands to end the session upon test completion no matter what, which will then cause the webdriver to clean up the windows
can anyone help me https://github.com/SeleniumHQ/selenium-ide/issues/1669
Hi, I have the same question, is there any fix that works to persist session between tests in a test suite in cli runner?
@pr0grammm - Do you mean in selenium-side-runner? I believe there is a boolean on suites for persistSession that should do this. Please try that, and let me know here if it differs from your expectations.
@pr0grammm - Do you mean in selenium-side-runner? I believe there is a boolean on suites for persistSession that should do this. Please try that, and let me know here if it differs from your expectations.
Hi yes I meant side runner. I tried enabling the persist session option and while it works as expected when I manually run the test suite from selenium IDE, it doesn't work when I use the side runner with the side file directly.
To elaborate, my first test case is login and subsequent n test cases all need login, I don't want to login n times. And when I run this suite through IDE manually with persist enabled, login happens once and same browser is used for subsequent tests and I don't need to login again. However when I use the side file with side runner, a new browser starts up for each test in the suite and login session is not maintained.
Also I have tried the solutions suggested in the thread such as enabling chrome options etc and it hasn't worked.
TIA.
@pr0grammm - This is a perfect explanation. Can you do me a favor and make a new issue with this? So many of these year old issues are v3 specific, and so I lose context after the first or second page. If I have that issue on hand, I'll try to go after it this week. My goals for this week are the following:
- Stabilize parallelization in the IDE + side-runner. (It's pretty good in the side-runner, but the IDE trips over its shoe laces as windows start fighting over focus)
- Get a play next step button working
- Start using tags other than alpha / latest for specific release candidate versions.
So, if I get those to a nicer-ish spot, I'd be happy having this on the list.
Thank you for looking into this. Here is the issue https://github.com/SeleniumHQ/selenium-ide/issues/1774