How selenium standalone server up in Selenium automatically and why not with Protractor? - selenium

In selenium, we do not need to run 'webdriver-manager start' command to start the server. but it will start automatically. And in protractor we have to run 'webdriver-manager start' command to start the server if we use 'seleniumAddress:''' in our conf file.
Can some please help to understand this situation.
Thanks in Advance?

If you want to run your test using sauce labs or browser stack, the required browser will be on some remote machine.In such scenario, you want to mention the seleniumAddress with the url where the selenium server is up and running.

Related

How to run selenium on RHEL sever through SSH?

I have developed a fully working Selenium suite using Java webdriver and firefox and is working perfectly fine. Now our requirement is to run the same test suite in Red Hat server (RHEL ) so that it should run as cron job everyday. The only way we access our server is through Putty ( SSH ). Anyone can guide me how to run my selenium test suite on RHEL sever ? I need a way to kick automation suite through SSH or HTTP request.
Any suggestions??
Thanks
Thanks,
Faiz
I achieved this using :
Install firefox on Linux
Install xorg-x11-xauth
Before executing the automation script just call - "export DISPLAY=:0.0"
This will cause display to be redirected to mail display. Execution will start on Firefox (one could see execution if display is connected ) and will output results back to SSH

Testing with Web Driver and Selenium through Codeception

I know I'll get crap for this but it's worth it if someone can help.
I can't find a guide, tutorial, or instructions anywhere for installing web driver on a windows machine. I've got a site running on a homestead vagrant box and need a way of running acceptance tests locally. I had tests setup using PhpBrowser but those don't simulate JavaScript. If anyone knows of a guide to do this or a better way to run acceptance tests it would help immensely. I've got Ajax calls so PhpBrowser and resources like it won't work.
Thanks!
Just download the selenium webserver the jar file and run it in a command shell with java -jar selenium-server-standalone-2.43.1.jar. The selenium server will now listen on the default port 4444. If you run your test it should work as expected. Keep in mind that selenium webserver opens firefox and uses it for testing. It's pretty useful for watching the test cases.
If you want a headless test (no visible browser) you need to download phantomjs. Unpack it and run the phantomjs.exe with --webdriver=4444 as an argument (so phantomjs.exe --webdriver=4444).
Download and Run the selenium-server-standalone-2.43.1.jar as stated in the comment. I had to add firefox_binary: C:\Program Files (x86)\Mozilla Firefox\firefox.exe under capabilities: in my acceptance.suite.yml file. I also added it to the path variable but I'm not sure if that made a difference. Had to add the firefox_binary to make it work.

selenium script has to run continuously in server with out using eclipse

is it possible to run selenium script in server without using eclipse or command prompt.for every fixed time intervals my selenium script has to run automatically in backend with out any browser opening
This can be split into two questions;
Can I schedule a Selenium test?
Yes, there are many options including using a CI tool such as Jenkins, Hudson, Team City,etc. Alternatively you could write a shell script to run the command line, and schedule this to run every x hours.
Can I run Selenium without opening a browser?
Yes. As mentioned before you could go headless, but depending on complexity of your application and test, you may find headless is not suitable. However, you can use RemoteWebdriver to launch a browser on a different machine but the test would still be run on your back end, it would just be the browse launched remotely. See https://code.google.com/p/selenium/wiki/Grid2 and https://code.google.com/p/selenium/wiki/RemoteWebDriverServer

How To Run UI Test Classes Using Selenium Webdriver in Jenkins?

I have test classes written in java for UI testing using Maven using Selenium Web-Driver. I want to run them using mvn test command in Jenkins.
It is not able to launch the browser for the testing.
The error stack shown is something like this:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
Error: no display specified
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:106)
Any help on this will be appreciated.
Firefox needs a X display to run, e.g. Xvfb
You will need to
install xvfb on your server. Doing this depends on your server operating system (and package management)
start xvfb before the build. You can do this using the xfvb plugin, or by running Xvfb as a daemon. I personally like to use the plugin.

Selenium server cannot be started inside Bamboo

I am trying to configure a Selenium testing through Bamboo. I am able to run Selenium scripts directly from command line, however it always fails if I run it through Bamboo remote agent. The error is:
: Could not start Selenium session: Failed to start new browser session: Error while launching browser
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:107)
I took some advice from the web, and checked "Allow service to interact with desktop" for Bamboo remote agent service. However, it does not work.
Anyone have other suggestions?
You must run Bamboo in Console Mode for this to work. Also, the build machine desktop must be active - and not covered or minimized if you want mouse simulations to work. I know right!