Setting up selenium, chromedriver, and wdio mixed with vagrant or docker -


i started out trying learn how write automated tests small project nothing working right out of box. after couple hours of searching & experimenting found right configuration project & figured sharing might folks in future.

here's small summary of errors encountered on debugging journey:

  • using jasmine & wdio, send_keys crashing
    • it firefox/geckodriver bug, or that
  • wdio appeared hang after switching firefox chrome
    • chrome needed run in --no-sandbox mode, essentially

i figured problem stemming having wdio execute tests on local machine while selenium hammering on browser in vagrant vm. applicable people using separate environments (vagrant->local, vagrant->vagrant, docker->local, etc) wdio & selenium/chromedriver. here gist of configuration file ended with.

i started fanatique/vagrant-selenium-vm , modified use chrome instead of firefox because send_keys broken firefox/geckodriver @ time of writing. after swapping out packages, i'd start tests wdio appear hang. turning on verbose logging showed trying start failing no explanation why.

[00:06:39]  command post     "/wd/hub/session" [00:06:39]  data        {"desiredcapabilities":{"javascriptenabled":true,"locationcontextenabled":true,"handlesalerts":true,"rotatable":true,"browsername":"chrome","loggingprefs":{"browser":"all","driver":"all"},"requestorigins":{"url":"http://webdriver.io","version":"4.6.2","name":"webdriverio"}}} 

it took removing & nohup java ... command in fanatique/vagrant-selenium-vm's setup.sh see logs selenium in real time, able see "only local connections allowed" message chromedriver. led me a post said add --whitelisted-ips="" arg chromedriver - still getting local connections error message. chrome ended needing --no-sandbox flag - allowed wdio connect chromedriver in selenium , tests ran there.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -