Store selenium tests on a server but run them on local browsers, through a framework like fitnesse - selenium

I've been working on a webdriver framework for a while now, I guess it is
keyword driven now. We would like for there to be a central place for users to
store tests, preferably on a wiki, but then when they are run they would open up
the browser on users local machine.
I originally started working using Fitnesse, which works great for storing the
tests however when we hosted it on a server when a user tries to run a test it
opens the browser on the server which the user can't view. Does anyone know a
way that I could force Fitnesse to open the users local browser or display the
browser to the user? Or do you know another framework/way to store tests in a
central place but run them in local.
I've been looking at sending through the local users ip through a fixture to start up the initial framework, I was hoping that fitnesse would already know the ip.
Thanks,
James

You can either find a framework that does what you want, or the bare minimum would be to create a thin wrapper that copies the test dll's and executeable to a machine and executes psexec to execute the tests on the remote machine. You could probably write the entire thing in maybe 20 lines of code.

Related

Jenkins Execution Issue

A selenium script , when executing from Eclipse in a local machine , clicks an UPLOAD button in browser to upload some files from local machine to that application running in browser.
This uploading part is failing when the script is executing from Jenkins because Jenkins server is unable to access local machine.
Any idea how to overcome this issue..??
Accessing these files from the server is a bad idea (unless it's a Jenkins's slave) though can be achieved via your code or some CMD tool, with providing the address and credentials. Put some effort in this and you'll find how to do it...
The better solutions will be adding these files to the Jenkins server as well or committing these files to your repository and checkout them before the test.
A shared folder could also do the trick on a filer type server or similar.
Hope it helps. Anyway there's no substitute to your own research e.g. Google and StackOverflow.

Run protractor test remotely

I'm a QA Engineer where I work and I want to enable all the other
team members to run the tests without me- i.e - even when I'm not here- they can for example get to some url, enter the url of the environment they want to test and play the tests, without installing anything on their computers.
what would be the best practice?
thanks.
Sounds like Jenkins will do what you want.
In that situation I would:
Install Jenkins on a dedicated machine (onsite or in the cloud), or try out a commercial Jenkins cloud provider
Configure a Jenkins job that executes your tests (you can configure the tests to run on the same machine where Jenkins is installed, or if you would rather have Jenkins run the tests on a second machine, that's possible too)
Show your team members how to access Jenkins and launch the test job (or, you can also configure your test job to run automatically at a certain time of day, or even better, when changes are made in your version control system)

How to get data out of citrix

Here's what I want to be able to do:
Run a program on my local computer which logs in to a citrix server (using citrix receiver or doing so in a similar way), on the server in the citrix session open a web browser, load a website, and then bring the html of that site back out of the citrix session and onto my local computer. Bascially I want to get data out of a citrix remote session.
How can I do this programmatically?
I'm fine with whatever programming language/modality you are comfortable in answering the question using.
I've looked a little into the citrix apis but while I find some things about logging in and even sending keystrokes and mouse clicks I found nothing about obtaining data. I could just log in and then use a program like wireshark to get the information, but I'm guessing it's all encrypted (plus then I wouldn't be doing my task all programmatically). I know of at least one open source program which seems to be able to replace a citrix reciever/client (openthinclient.org) but before I got digging through all its source code to try to answer my question I thought I'd ask here in case someone had an easier answer.
If all you want is to automate the task, is having the program act as a citrix client necessary?
I assume you don't have install privileges inside your citrix session, so are unable to install one of the many automation tools available (such as http://docs.seleniumhq.org/)?
Given the above...
If you have/allow java on your local machine, have a look at http://www.sikuli.org/
The main difference between this and other automation tools I've come across is that Sikuli uses the image on screen to navigate the gui, rather than grabbing calls to the widgets (which wont work in a citrix session).
So, assuming you can take a screenshot of your citrix session, it could be useful to you.

running autoit/autohotkey scripts from server? or other automation alternatives?

I have some scripts (AutoIt) browsing YouTube for list of trending videos etc. It involves no mouse clicks (just keystrokes). The script takes a long time to finish and I can't use my PC during this time (it needs the window activated to work on it).
Is there anything I can do about this? Can these scripts run from a server or some stuff like that?
I've run into a similar problem: got to run automation with AutoIt on a Windows Server and the whole thing had got to be headless. Using Remote Desktop simply didin't work because then I'd had to keep a client opened and maximized all the time.
Short solution: install a VNC server in the Windows Server, open a client from another computer, log in and close the client. As the AutoIt script was being started by a Jenkins job, before closing the client the Jenkins applet had to be started via web interface.
By the way, I've had this idea from this post: How to run remote headless GUI automation.
As Johannes said, AutoIt probably wouldn't be suitable (and likewise AutoHotkey), but you could check out the many GUI and web testing frameworks that exist for other languages. With some of those, you can run a "headless" browser (a program that navigates the web just like a browser, but has no visible window); or you can run a standard browser on a virtual display like a Xvfb X11 server. This would be easiest if the server (or wherever it's going to run) is running a Unix-like OS, but it may be possible with Windows too.
Selenium Webdriver seems to be a very popular choice for scripting and testing actual browsers. It's natively Java but has bindings for languages like Ruby. It can also hook into something called HtmlUnit, which is also Java; that's one of the more popular headless browsers. Another (a relative newcomer) is phantom.js, which is in Javascript but (again) has bindings for other languages.
As far as I know this will not work unless the user account is logged on. You could try to see if you could convert it to an exe and run this as a service, but even then I don't think this will work. Let me know if you found out!
You can either:
Hide your window (SetWindowState #SW_HIDE) or something like that...
and use ControlClicks (if the they are original controls!)
or
Hide your window and use SendControl
or
use SendKeepActive
or
use OLEObjects like ie.au3 for automation.
Good Luck

selenium grid 2 ready, how do I send a "test" job to the remote server?

On my linux box somewhere in the United States, it's running Selenium Grid 2.
Currently 3 people will be regularly running parallel tests, but there's potential for more people to join and running more parallel tests....
now they are in other parts of the world, they need to submit an xml file which contains the test data, and the server needs to parse this and figure out the rules.
How can the client invoke a test to run on the remote server? via HTTP POSTing the xml file to the url in which the grid is running on?
Is it cheaper to just rent out a fast linux server and then buy more as number of parallel tests increase?
Or should I right off the bat, hook it up to Amazon ec2? If there are parallel tests on an ajax heavy web applications running 24/7, would it be cheaper to go with the single dedicated box or amazon? google app engine (no plugins for grid?)?
I am not sure I understood the xml submitting part in your question. However, I can tell you an example which will help to you understand how to submit the tests to grid.
Three people, PersonA, PersonB and PersonC are creating selenium tests in their local machine. They currently run the test using an ANT build (or something similar) against the selenium server jar which is in their local machine. In their code they would be having a line of code which tells which selenium instance should be used to run this test. This will be mostly like
new DefaultSelenium("localhost",port,browsername,URL)
Now these people want to move to selenium grid (1 or 2). Here is what they will have to do to use the grid
All they have to do is change the command
new DefaultSelenium("localhost",port,browsername,URL)
to
new DefaultSelenium("hubIPAddress",portInWhichHubWasStarted,browsername,URL)
Note:- browserName - Make sure there is a remote node registered in Hub for the same browserName.
Now all the commands will be sent to Selenium Hub and Hub would execute the commands using the remote nodes.
Hope this helps. Please post if you have any questions.