Is there anything similar to browser.parmas in webdriverio as a in protractor - automation

Iam migrating my e2e run from protractor to webdriverio . in protractor there is a way to set browser.params , and get access to it in the code as well, is there anything similar to it in webdriverio. i use it to set which steps to skip during execution , which browser is currently running, which domain and environment is currently running.

Related

Cucumber selenium failing in jenkins pipeline only

I am working on an integration test, using Selenium/Java/Cucumber. When I run the test on localhost, or remotely on a VM, it passes fine. But when it runs as part of a Jenkins pipeline it hangs with the error "Timed out receiving message from renderer". I have googled this and there are several possible causes, including version conflicts. But I can't seem to figure out how to check these versions in the jenkins pipeline. Any pointers on what to look into would be helpful. I believe the tests are running headless on the pipeline, because there is no Chromedriver pluigin installed in our Jenkins. The test is pretty straightforward - it involves clicking on an element within an iframe (this is where it hangs) and checking for some output. I have even tested it running manually on the VM created by the very same pipeline and it always works without an issue.

Running karma-jasmin tests on selenium grid

We've got our tests for angularjs code using Jasmin and currently running with Karma. The tests are now using phantomjs.
Is there a way to run these tests using selenium grid?
It seems there is 'https://github.com/karma-runner/karma-webdriver-launcher' which can do the trick; however, this is not an option for us. Is there another way to run our tests using the selenium grid?

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

I started out trying to learn how to write automated tests for a small project but nothing was working right out of the box. After a couple hours of searching & experimenting I found the right configuration for my project & figured sharing it might help folks in the future.
Here's a small summary of the errors I encountered on this debugging journey:
Using Jasmine & WDIO, send_keys was crashing
It was a Firefox/geckodriver bug, or something like that
WDIO appeared to hang after switching from Firefox to Chrome
Chrome needed to be run in --no-sandbox mode, essentially
I figured my problem was probably stemming from having WDIO execute my tests on my local machine while Selenium was hammering on the browser in a Vagrant VM. So this will mainly be applicable for people using separate environments (vagrant->local, vagrant->vagrant, docker->local, etc) for WDIO & Selenium/Chromedriver. Here is a gist of the configuration file I ended up with.
I started with fanatique/vagrant-selenium-vm and modified it to use Chrome instead of Firefox because send_keys was broken with Firefox/geckodriver at the time of writing. After swapping out the packages, I'd start the tests with wdio but it would appear to hang. Turning on verbose logging showed it trying to start but failing with 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 the & from the nohup java ... command in fanatique/vagrant-selenium-vm's setup.sh to see the logs from Selenium in real time, then I was able to see a "only local connections are allowed" message from chromedriver. That led me to a SO post that said to add --whitelisted-ips="" as an arg to chromedriver - but I was still getting the local connections error message. Chrome itself ended up needing a --no-sandbox flag - that allowed WDIO to connect to the chromedriver in Selenium and my tests ran from there.

How can we execute single test on multiple browser using browserstack and Geb Framework

I am using Geb framework to execute the testcases on browserstack.Currently I am able to execute my test on single browser(Say Firefox) on browserstack.I need to run the same test on multiple browser
You can use the 'Gradle geb-browserstack Plugin' to run your tests on multiple browsers on BrowserStack. More details available here.
Using this plugin, the capabilities are passed as follows:
browserName_platform_browser-version
For example, to run tests on Firefox 32 on MAC, the capabilities are:
firefox_mac_32
If you have any BrowserStack related queries, you can always get in touch with them at support#browserstack.com
EDIT:
I have created a sample project here, that can help you get started with running Geb Tests in parallel on multiple browsers on BrowserStack.

Using PhantomJS for Selenium's htmlsuite

Trying to port selenese commands from the Selenium IDE to a cron-usable task, and have gotten as far as getting these to run with Webdriver's HTMLSuite command using a local installation of Firefox. However, we need these to run without opening a visual browser - as we're already using PhantomJS elsewhere in the application this seemed like the logical option rather than going down the XVFB route.
Is this possible? I've tried a variety of commands but keep getting errors of phantomjs not being an accepted browser.