Automate any software - windows

A quick question. Is there any method to control or automate any Windows application, using the command line. I've tried AutoIt. Any other methods? I'm targetting to control WinCE Test Kit (CETK) to perform the test without having to go to the GUI,or click the menu, connect etc, manually.
Thanks in advance!

We use Rational Robot for this but keep in mind it's not cheap. It's also probably been renamed 27 times since we started using it so you may want to just search for Rational testing products in general.
It's fully script-able, allowing you to monitor the screen and send key presses and whatnot.

Look at SCAR, it is great for all sorts of automation and screen reading: http://freddy1990.com/index.php?page=product&name=scar

I've always used a hybrid approach. First purchase SOTI Pocket Controller Pro then just use the normal AutoIt automation tools. It's a little different because you can't actually capture popup windows like you may be used to, but it can automate clicks, and then loop and wait for things using the GetPixel methods to check it the screen is what you expect.
Being able to connect to multiple CE devices at the same time visually is also a nice touch.

Related

How to script keyboard clicks in a browser on a mac

The title says it all. I'm trying to script keyboard clicks in the browser (preferably Chrome). It's simple, from the current page I want to tab through 5 elements, then click enter, then repeat.
Right now I'm using a trial of the mac App "Fake" but it seems overly complicated for what I'm trying to do. I'm new to Macs and having trouble figuring out the simplest way to accomplish this. Any suggestions?
I'd take a look at Sikuli. It has a lot of things in its favor:
Comes with a nice starter IDE (or, you can write scripts in your own editor)
You can write Sikuli scripts in Jython, which is nice if you already know (or want to learn) Python
There's a Java API too, should you want to use pure Java
Sikuli's ability to do fuzzy matching of screenshots can be surprisingly robust
Scripts can be run from the command line once you grow out of the IDE (or want to plug the scripts into a continuous integration system)

keyboard hook in windows C++ or what?

I wish to build my own application which can send keyboard commands(messages) to the Windows OS.
For example when I press the combination ctrl+shift+n, I wish to launch the notepad.exe . How can I do that? Do you have some advice for me about the concept used.
I've read that is possible when are used keyboard hooks? That's the only way? Do you know a free and open-source application which does this as simple is possible?
Your particular example can be done without any programming at all, by right clicking on Notepad, selecting Properties, and setting the "hot key" (various Windows versions might call it by a different name) to Ctrl+Shift+N.
If you still would like to write a program to do this, have a look at the RegisterHotKey Win32 API function.
AutoHotkey is a free, open-source utility for Windows.
You can automate many tasks with the above utility, check it out.
Things to bear in mind:
A system-wide keyboard hook requires the writing of a DLL. There's example keyboard hook code on my website here.
Hooks cannot be installed from a low to a high integrity level application in Vista and Windows 7/8/10. So there's no guarantee your hook will work, depending upon what the foreground application is when the key gets hit.
As Greg pointed out, a lot of the time, RegisterHotKey is a much simpler solution for this problem.

Which Windows (C++) screen capture libraries fit my requirements?

I'm ready to outsource the screen capture functionality of our application, because it's not our core business and I've spent too much time trying to get our code to do all the things I need. Time for a specialist, I think. My requirements, in decreasing order of importance, are below. Does anyone have experience with any commercial or free libraries that meet most or all of these requirements?
Has to work in Windows XP and higher. (But not Win95/98/Me.)
Visual C++ 2005 compatible, where screenshot can be triggered from my code. Preferably a static library, but a DLL or COM object is OK. I'd prefer not to shell out to a standalone EXE because there are some users that will try to tamper with our application and I think having an obvious separate screenshot EXE makes that too easy.
Must be able to take full screenshots of multiple monitor systems. (Preferably the way the "Print Screen" key does in Windows, by making a bitmap of the displays stitched together, but if I have to take the pictures separately and combine them myself that's acceptable.)
Must be able to capture screen correctly when Remote Desktop Client (or any RDP client or VM) is in full screen mode. (Of course, it should also work when RDP is in windowed mode, but that shouldn't be a problem as long as it doesn't operate by simulating a key press that might get transmitted to the remote OS instead of being handled locally.)
Must be able to capture screen correctly when Windows Media Player (or any other media player) is in full screen mode.
Must be able to capture screen correctly when game (e.g. World of Warcraft) is in full screen mode.
Would be nice to be able to capture a few seconds of user activity as a video.
I don't know of a library that would do what you want.
If I had to code your requirements, I would probably use the source code of the TightVNC server as my starting point. I think it has the technology to do everything on your list EXCEPT....
I'm not sure that technically there's ANYTHING that can do a screen capture of somebody's Remote Desktop session. Think about it: There can be multiple remote desktop sessions (the csrss.exe process) occuring using the same physical remote desktop server. If you were sitting in front of the machine looking at the video monitor, you wouldn't see anything happening at all. So what woould you expect to capture. VNC is only going to capture what's happening with the "real" video (the non-remote csrss.exe).
I dont know if this really helps, but the best imaging libraries available are available from
www.accusoft.com and
www.leadtools.com
Both support creatting screenshots, though i don't know, if hey will properly capture movie player output that displays through graphics acceleration or the recording of movies from screen.
If I were you I would investigate WindowsClippings, a pretty mature and extensible application written in C++ that does precisely what you need. It has an API you can extend to your requirements and is pretty cheap at 18$
Some people in our office are using Magick++ (an ImageMagick library) to make screenshots. I don't know all the specs, but you could take a look at it and see if it matches your requirements.

Debugging a Full-Screen Application

Given that I only have one monitor, what's the best way to debug a program which uses the entire screen (such as a DirectX application)? Tools such as the step-by-step debugger seem useless in this context. Also, printing to the console isn't as effective, since you can only look at the console once the application has terminated.
Remote debugging is no option?
Else you can possibly borrow a second monitor (with video card).
And if all else fails you can go back to beep signals.
(Or find yourself an old matrix printer and write each line to the printer ;-) )
To just see some runtime information I would overlay debug text within fullscreen. If it were me, I would target the app to be able to run windowed as well- although the onscreen debug is good for play testing (if this is a game).
printf debugging is slow, painful and fool proof.
fill your code full of tracing lines like
fprint(logfile,"%s:%d\n",__FILE__,__LINE__);
or waterer you need for your language and run it. after your done, you can walk through what it did. Make sure you have lots of time and harddrive space first though. It has some advantage like that you can "run" things backwards and diff one run with the next.
I'll go with what BCS said and add that DebugView by SysInternals allows you to connect to it remotely from another machine.
You can test 99% of the code in windowed mode, then for the parts that need to be done in fullscreen you can have it jump to fullscreen, run some test, and jump back soon after (either programmatically or with alt-tab).
Basically I want to stress that most code will not be dependent on the fullscreenness and could be tested in a small window.
You might want to consider reading Joseph Newcombers essay on Graphical Developers Interfaces at http://www.flounder.com/gdi.htm
You may not be coding in MFC but you should be able to get some useful ideas. He's got lots of other interesting articles as well.

A Good, Free screen sharing program for pair programming?

I am looking for a good, free (preferred) screen sharing program that works well for pair programming and code review sessions for Windows (Vista x64, Server 2008). It should allow either person take control of the screen and be fairly responsive for text editing over decent broadband connections. Additional features like the ability to draw/mark/annotate the other persons screen would be nice.
Edit: This will be used by developers in remote locations.
TeamViewer from http://www.teamviewer.com/ works very well. We use it for pair programming between London and Ukraine.
Notes:
We use Skype for voice.
TeamViewer uses extremely low bandwidth - 4kbyte/sec on average for programming in Visual Studio 2008 # 1024x768 resolution.
Can swap roles from hotseat to viewer with a button.
The remote view of the screen can be resized to fit in a smaller area with no loss in usability.
Windows Shared View works for me. It allows you to only share certain windows and even shows where your "attendees" mouse is. It would be best to use that in connection with some sort of voip connection so that you don't have to type questions/responses back and forth.
I have checked some hours now for a good one.
Best and the simplest thing i have found.
http://www.screenleap.com/
Free, no strings found so far.
No need to waste time installing or registering anything.
Works perfect with "share are only" if you have multimontor setup.
Most other software shares full screen default, and you cannot choose which monitor you share.
You need to be aware that it does not encrypt data. Check FAQ.
But if you have to run voice over Skype/Mymble/Whatever separate anyway..
What harm can a hacker do by simply getting 50% of the conference ?
Pff.. Oh you wished for screen sharing.. this one does not have it.
So try: http://www.mingleview.com/
It has that multimonitor "bug" and you need to install a simple pluginlike thing.
But "take control" is there and it's very simple also.
Most other software has bundled unneccesary functions like calendaring, document system, filesharing which i already have solutions for.
It's like developing games on excel macros..
unneccesary.. developers please learn that already !
I haven't actually tried it yet, but it looks promising. Check out DimDim. They have a free web service and a VMWare image on Sourceforge.
If you're using eclipse, you might wanna try ECF. There's a video presentation available here.
Try Mikogo at www.mikogo.com
very easy to setup. no problems with Firewalls etc etc
And my final suggestion, but this is not one I've tried. Go to Crossloop
On OSX, I've used vim and a multi-user GNU screen session - this gives much better responsiveness than VNC, screen-sharing, etc. I guess you could use these with Cygwin?
I like to use Screen Hero, which allows both users to use the mouse on the shared screen: http://screenhero.com/
or Zoom: http://zoom.us/
For a poor-man's solution, you can use the free edition of RealVNC. On the server, un-check all of these boxes:
(source: realvnc.com)
Would a VNC client not do the trick, combined with a one of those screen overlay apps people use for presentations (screenpen rings a bell)?
Another option is to use VNC, but use reverse connections. Have a look at this I use this in conjunction with No-IP to get a fixed address.
Do you need this to be remote?
You could just have two monitors set to mirror and 2 USB keyboards/mice
If it is remote then VNC is the way to go, I would use UltraVNC if you are looking for a free version, it has more features (chat, file transfer) than the free version of VNC - it also has a video driver hook that means it suffers less from any weird screen issues than regualr VNC.
If firewalls are a problem you can simply set up a VPN (which is probably a good idea anyway - although ultra can do encryption).
How about any of the services like Joel's https://www.copilot.com/?
Have you looked at the collaboration module that comes with netbeans? Its very useful for pair programming!
For multi-platform simplicity, I would suggest
https://join.me/ for screen share (you can even view a remote
screen using iOS!)
getting a phone headset, and using the phone for audio.

Resources