Selenium, automated frontend testing on different OS - unit-testing

My complete working environment is Linux based (Ubuntu for desktop and server). I use Hudson and Selenium to execute tests on my EE6/ZK web application with any browser available for Ubuntu.
But how would I test my application with IE (Windows) without setting up a Selenium server in Windows. Thought I could run Windows in a VMWare or Virtualbox, but still it needs a "local" selenium and how would I trigger it ? Install hudson as well and pretty much replicate the complete CI in Windows ? How is MAC ?
Any tips or experience with cross-browser-platform-OS automated testing ?
Sven

You will need to use Selenium Grid. There is a Selenium plug-ins for Hudson available, and this article has a guide how to setup Continuous Integration with Hudson and Selenium Grid. And yes, you will have to install Windows in a virtual machine.

Related

Can One Run Selenium Tests on Debian Virtual Machine?

I'm trying to wrap my head around this and figure out if it's possible. I've been doing Django development on a Mac running OS X 10.10. My production machine is a Debian server running on AWS. Recently, I decide to move my development to a Debian virtual machine built with Vagrant that runs on my Mac because I'm tired of having to maintain two different runtime environments. The problem is that I have a number of Selenium functional tests that I've been running on my Mac that I'd like to keep using. Is it possible to install Firefox and Selenium on the Debian VM and run my tests on that box and see them running in the browser as I do now on my Mac? Also, would it be possible to run them on my AWS production server? It seems to me that these tests won't run once I start running things outside of my current OS X environment.
Thanks.
Works great for me, for years. Same, much better when running the same OS. I use Ubuntu on VMWare Fusion, running selenium on Chrome with Chrome driver (doesn't work with Chromium, works great with Chrome).
Just make sure you have the correct driver https://sites.google.com/a/chromium.org/chromedriver/downloads

Can i check emulator is running and one specific application is insatlled in emulator or not?

I am new at mobile automation testing and now i want to create a one type of framework for android application testing that in before method it will check for if emualtor is ruuning or not? if not then launch the emulator and second specific application is installed or not(example: facebook) if facebook is installed then launch that application.
I am using appium for testing. Can any one suggest me what shuold i have to do?
Thank you in advanced.
First of all appium cannot automate pre-installed apps from play stores. You should have a ".apk" file to install it.
Secondly, appium cannot automate bringing up of emulator, however a way to do it is through the use of script of adb commands.Check through the adb command if any device is active
adb devices
If it is not then you can start your emulator using the emulator commands of adb.
For complete adb commands reference.
http://developer.android.com/tools/help/adb.html.
Lastly you can use different modes of appium like "--full-reset" for re-installing the app even if it is pre-installed or simple "appium" will start the ".apk" which was once installed by it.
Check all the modes here - "github.com/appium/appium/blob/master/docs/server-args.md"
For other basic queries, visit - https://github.com/appium/training

Im testing with selenium on ubuntu. Test in invisible workspace

Im testing my code with selenium RC. And every time when i run tests, selenium starts a browser in my active workspase, and i don't like this way. how can i set a selenium workspase to run selenium browsers in another workspace?
For repetitive testing, you should consider using xvfb for having a headless selenium. We've branched it to hudson for CIT
There's a maven plugin available, for example

Selenium RC: Running browser on another X11 desktop

I'd like not to be disturbed by the browser that is launched by Selenium RC. Is there any way how to force it to run the browser on another X11 desktop? Running Selenuim server on another desktop does not solve the problem.
Vít Šesták 'v6ak'
Yes, on Linux you can start for example Xvfb (X in a virtual framebuffer) to provide an X environment and launch the selenium controlled browser in that.
We are doing that for years on headless server boxes and that work just fine (well from time to time you have to shoot a hanging browser, but that is the same on a desktop).
First install Xvfb:
sudo apt-get install xvfb
Then start selenium server in background via xvfb:
xvfb-run java -jar ~/Downloads/selenium-server-standalone-2.45.0.jar
Finally run your tests as usual (phpunit, or whatever you are using).
You should be able to do this by setting the DISPLAY environment variable to a different display than the one your desktop is using. This must be set when starting up the Selenium server. Selenium will then use this value when starting up the browsers.
I solved this using workspaces/viewports not X using devilspie.
This addon lets you put a custom title on firefox, I installed it on my selenium profile:
https://addons.mozilla.org/en-US/firefox/addon/57/
I replaced Mozilla Firefox in the titlebar with FFSELENIUM
Then use devilspie to pin those windows to firefox:
http://ubuntu-tutorials.com/2007/07/25/how-to-set-default-workspace-size-and-window-effects-in-gnome/ http://foosel.org/linux/devilspie
Then create a file .devilspie/selenium.ds with the contents:
(if
(and
(contains (window_name) "FFSELENIUM")
)
(begin
(set_viewport 3)
)
)
Woot firefox windows in the third viewport!

How to automate installer testing

I'm wondering if anyone has any best practices for automating the testing of installers on various machines with potentially different hardware / software profiles and by specifying various options to the installer. The idea would be that I could write "unit test like" code to set up a machine, run the installer, then test that certain things are true. Tests might look similar to:
Test:
Boot Machine without IIS
Run Installer
Assert Installer Had Errors
Test:
Boot Machine with IIS
Run Installer
Assert Installer Ran
Test_Fixture:
SetUp:
Boot Machine with IIS
Test:
Run Installer without IIS install
Assert Website Not Installed
Test:
Run Installer with IIS install
Assert Website Installed
I know I could create lots of VMs, but waiting for a VM to boot for each functional test sounds like way more work than I want. What I really want is a way to virtualize the installer environment. Any suggestions?
We have created a set of VMs and find it is very easy to manage. We run the tests for 13 different Windows installers over night. The VMs we have created our very bare bones, so it is possible to run a number of tests in parallel.
If you have the installer runnable from the command line, it's easy to have a script to call it automatically.
Then you can use a web app testing tool to see it the install was successful, like this one http://seleniumhq.org/ For this you will need an unique way to test a new install - like a page with the current version.