Lettuce test with django and selenium no run on windows - django

I have a lettuce test suite using selenium and everything works just fine on linux.
After I installed django and everything that's needed on windows to test the suite on IE8,9 too, and I tried to run the test, it only opens my browser and says that the test passed with 0 features, 0 steps etc. The same test suite on linux runs just fine.
What do I need to make them work on windows 7 too ???
I use python for my test.

Maybe it's not the best solution for you problem, I'm not even sure that it's valid for IE, but you could try to launch IE remotely so you will not need to launch whole application on windows (i.e. if you were using gunicorn as wsgi server, you couldn't launch on windows at all).
Python-selenium has functionality to use remote browsers, I'm just not sure about IE.

Related

Intern - Create local tunnel to run functional tests

So i'm starting use Intern for functional tests, so far so good I did it all, unit and functional tests.
I followed their intern-tutorial
Whenever you need to run a full test against all platforms, use the test runner. When you are in the process of writing your tests and want to check them for correctness more quickly, you can either use just the Node.js client (for unit tests only) or create an alternate configuration file that only tests against a single local platform, like your local copy of Chrome or Firefox (for all tests, including functional tests).
I searched on their documentation, but I didn't find anything exactly about local "tunnels".
I'm using Intern with Gulp, my localhost is localhost:3000 and I want to test on my Chrome 54 on Mac.
Thank you
I guess NullTunnel is what you're looking for?
I found the answer. I had to change the tunnel to Local Selenium.
Download the latest version of ChromeDriver
Set tunnel to 'NullTunnel'
Run chromedriver --port=4444 --url-base=wd/hub
Set your environments capabilities to [ { browserName: 'chrome' } ]
Run the test runner
Obs:
Don't forget to copy the chromedriver file to your project root.
I had to run on my project root .\chromedriver --port=4444 --url-base=wd/hub
The test runner has to be run in a new command line/terminal/shell
Hope to help someone that had the same issue.

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

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!

Selenium, automated frontend testing on different OS

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.

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.