headless script crashes after a few runs

  • Last Update :
  • Techknowledgy :

This change was made in

Selenium 3.0 .0.b2 *
   Updated Marionette port argument to match other drivers.

UPDATE: Try

from selenium
import webdriver
from selenium.webdriver.firefox.firefox_binary
import FirefoxBinary

binary = FirefoxBinary('path/to/binary')
driver = webdriver.Firefox(firefox_binary = binary)

Suggestion : 2

Headless Chrome running in a Docker container (ruby:2.5.0, Debian 9.3 in this case) constantly crashes.,ChromeDriver returns an unexpected by Selenium status 100 which causes gem selenium/webdriver to thrown an exception., Example Ruby script (using Capybara) which causes headless Chrome to crash , Example Ruby script (using Capybara) which causes headless Chrome to crash

docker build - t chrometest.
docker run - ti--security - opt seccomp: unconfined chrometest bash
angelika @8ad017df7b83: ~/src$ bundle exec ruby run.rb
angelika @36d2f1a67ecb: ~/src$ google-chrome --version
Google Chrome 63.0 .3239 .132

angelika @36d2f1a67ecb: ~/src$ chromedriver --version
ChromeDriver 2.35 .528139(47 ead77cb35ad2a9a83248b292151462a66cd881)

Suggestion : 3

The java process at the top is a minecraft server; the machine has hung regardless of this running. ,In reviewing today's syslog, here is what I noticed...

Swap

KiB Swap: 2097148 total, 371812 free, 1725336 used.

If grep -i swap /etc/fstab shows this...

/swapfile    none    swap    sw      0   0

Note: Incorrect use of the dd command can cause data loss. Suggest copy/paste.

sudo swapoff - a # turn off swap
sudo rm - i / swapfile # remove old / swapfile

sudo dd
if = /dev/zero of = /swapfile bs=1M count=4096

sudo chmod 600 / swapfile # set proper file protections
sudo mkswap / swapfile # init / swapfile
sudo swapon / swapfile # turn on swap
free - h # confirm 16 G RAM and 4 G swap
reboot # reboot and verify operation

Edit sudo -H gedit /etc/default/grub and change the following line to include this extra parameter. Then do sudo update-grub to write the changes to disk. Reboot. Monitor hangs, and watch /var/log/syslog or dmesg for continued error messages.

GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash libata.force=noncq"

grep -i postfix /var/log/syslog* to see the hard postfix errors...

May 7 12: 28: 21 marvin ifup[787]: postconf: fatal: open / etc / postfix / main.cf: No such file or directory

Suggestion : 4

I faced same issue few time back , I was anycodings_java able to create and use headless chrome anycodings_java driver instance using following code:,By using this code and setting the anycodings_java window-size, I was able to solve my anycodings_java problems related to Empty Navigators.,Question about Vue basic logic: communicating between parents and children and vice versa,Using python, Can an item in a list be stored as a string and an int?

I faced same issue few time back , I was anycodings_java able to create and use headless chrome anycodings_java driver instance using following code:

System.setProperty("webdriver.chrome.driver", webDriverExec)
ChromeOptions chromeOptions = new ChromeOptions()
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("window-size=1200,1100")
driver = new ChromeDriver(chromeOptions)

Suggestion : 5

However, if you're running this script locally you'll have to do a bit more work to collect the backgrounded PID and then kill it after cypress run.,Typically you will need to boot a local server prior to running Cypress. When you boot your web server, it runs as a long running process that will never exit. Because of this, you'll need it to run in the background - else your CI provider will never move onto the next command.,If you are running long runs on Docker, you need to set the ipc to host mode. This issue describes exactly what to do.,Most CI providers will automatically kill background processes so you don't have to worry about cleaning up your server process once Cypress finishes.

npm install cypress--save - dev
cypress run
npm start & cypress run // Do not do this
npm start & wait - on http: //localhost:8080
npm install--save - dev start - server - and - test
{
   ...
   "scripts": {
      "start": "my-server -p 3030",
      "cy:run": "cypress run",
      "test": "start-server-and-test start http://localhost:3030 cy:run"
   }
}