Run DOH robots tests in java program in background - doh

I would like to embed dojo/robot tests is java application.
Java application would use java-webengine for load web pages and for embed dojo script to these pages. Java-webengine gives possibility run java script.
I understand, that DOH use system mouse and keyboards events. User of my application does not see web browser page (browser running in background by webengine).
I have a couple of questions:
1. What happen with mouse pointer during DOH test execution?
2. It is possible to run DOH tests in my application internally(in the background)?
3. What happens if user will type on the keyboard or move mouse during test execution? (For instance user may switch for other application, e.g. Microsoft Word.)
Thanks!

A few things --
Dojo tests can be run from the command-line using node.js or Rhino.
I have created a DOH test suite that is backed with a Java web server and that works well, BUT...
To clarify, not all of the DOH robots use system mouse & keyboard events, only 1 particular robot (robotx) simulates actual user input. When using robotx, the mouse & keys behave as directed by the tests. If you mouse off the browser, the tests will be aborted (an alert comes up notifying you of this). Therefore, robotx cannot be run in the background because it is actually interacting with the browser.
You may have some luck using the other robots coupled with node.js or Rhino. The key concept is that you should be looking for some "headless" browser testing scenario, which is generally what Rhino handles (I believe Node can do this as well) while avoiding use of robotx.
Basically, as long as you are not using robotx (the one that actually takes control of UI) you should be able to start the tests & minimize the browser or use a headless browser engine.

Related

Issues in spying a windows application utilizing BluePrism

I am facing the below issue while working on BluePrism, the issue relates to spying elements from a windows application called "Cashier", the application is written in VB, I provided the .exe file for it and the application launched properly, however, I can't properly spy the individual rows in the table shown in the attached picture. I can only spy the box as a whole, and no information is retrieved.
possible the application spawns the elements in a new process? perhaps check the task manager once and make sure another process hasn't spawned to show the results in?

Disable or Bypass Firefox Safe Mode

I have a proprietary application for automated testing that I built here at work that uses Selenium WebDriver classes to test our applications. It uses Firefox, but sometimes, when a new browser is launched, Firefox will open in Safe Mode and display the Safe Mode dialog. This seems to happen completely randomly, i.e. I will set up twenty tests to run and at any point this might happen. There only one block code that can be executed from test to test to launch a new browser, so it isn't in the testing application. Is there a way to override, or bypass, the safe mode dialog when this happens?
I need to run regressions overnight a lot of the time and it's frustrating when I see that my tests have been hung because of this

Use XCode to develop console client/server application

I have a console-based server and client application which talk to each other over a TCP socket on localhost (although eventually will be used on separate machines).
I see that if I manually launch the server target and then the client, XCode seems happy enough to run them both in separate debugger contexts, they connect and work just fine.
Ideally I'd like to set it up (via a scheme or pre-run step or something) such that I can one-click 'run' (or cmd-R) and both these contexts pop up and run happily.
So far my experiments with the post-run script (for the server) passing "$(BUILT_PRODUCTS_DIR)/cclient" to /bin/sh seems not to work, and this is less than ideal anyway because it wouldn't run in a debugger context anyway.
Is there a way i can easily set this up?
Thanks,
DaveM
EDIT: Added a screenshot of what I can achieve with several clicks, but would like to get to with one click/key-combo...
You can set up scripts and other actions in breakpoints.
Click on the left side of editor to create a breakpoint, and CMD+OPT+click on the breakpoint icon to edit its options.
Also, you can choose the 'Automatically continue after evaluation' option, for convenience.
For details, see Session 412 Debugging in Xcode from WWDC 2012 videos. This session just happened to demo debugging skills with Xcode in a client-server setting.

Selenium grid 2 over cygwin

Ok, this is a tricky one. I'm trying to set up a Selenium Grid 2 with some Windows 7 VMs to run Webdriver tests. To automatize the whole process I use some ant script that connects to the VMs through ssh to start/stop/reconfigure the nodes.
Everything works great, the nodes can register with the hub host and execute the test. Only problem is that I don't see any browser window during the test run. I can see the process and I see the test log being executed, but there is no graphical interface.
On the other hand, if I start the node manually through Windows, everything is normal.
I suppose the problem is that processes executed under cygwin cannot start Windows displays, but in that case, shouldn't throw an error? The other option I'm thinking is that Webdriver is using HTMLunit as a fallback, but then... why do I see the firefox process as long as the test lasts and consuming CPU and memory?
Through ssh, you only exchange with Windows stdin, stdout and stderr streams. The ssh connection is tunneling those streams and nothing else. You don't see Windows Desktop interface, but the Desktop object exists on the Windows machine, the programs (here the browsers) are connected to it, and all GUI interactions are live in there.
If the GUI doesn't require any user interaction, everything is fine that way. The dialog boxes are created, the program runs, once it finishes, the dialog boxes are destroyed by the application and the application closes. Nothing is blocking in terms of GUI our application.
If you program requires an user action in the created yet invisible dialog boxes, your program will be there waiting for your interaction to move forward. You will see the process in the task manager, doing nothing but waiting. As you don't have access to the Windows Desktop where the dialog boxes are created and virtually 'displayed', the program seems to hang.
A typical case 2 is if you remote run a program waiting for a user to do something, say notepad. You can launch notepad, it will be spawned and then it will wait for you to type some text or close it.
With your Selenium tests, you are in case 1: all the browsers' interactions needed to make the GUI working are actually done by Selenium server that does the navigation clicks and the program exit for you. Their GUI actually are living by browsing through your test web servers, you just don't see it.
Some further readings from Microsoft website on Desktops and Desktop Creation.
If you want to see the tests and have valid screenshots, you need to have a user logged in and those tests need to run as that user. Everything must run through that single desktop session, so you cannot use RDP to remotely connect to the machine. Your best bet is to use VNC, since that will connect to an already established session.

Complex ajax web application, need a way to load test (possibly using Firefox)

Is there a Firefox plugin or system for testing complex ajax web applications. It would be nice if I could script or macro some web clicks and then automatically test those clicks with more users.
Take a look at Selenium.
This will likely cover the kinds of testing you'd like to do.
The Selenium IDE plugs right into Firefox.

Resources