May 16, 2013

May 9, 2013

Test Plan Automation Through SQL Verification

Filed under: General, Testing — Marcus Tettmar @ 1:05 pm

Our good friend Antonius Momac just emailed me to tell me about this video he has put together on automating test plans with SQL verification:

Macro Scheduler users will probably recognise that Antonius is using Macro Scheduler to drive these tests [ keep an eye out for the Macro Scheduler icons and custom dialogs 🙂 ]

May 7, 2013

April 17, 2013

Paste Into Object Without Using Keystrokes

Filed under: Automation, Scripting — Marcus Tettmar @ 11:03 am

Someone asked today how it might be possible to paste what is in the clipboard into an object using Macro Scheduler without having to use keystrokes.

It can be done by sending the WM_PASTE message using the SendMessage API function.

Here’s an example:

//Sending WM_PASTE to an object causes a clipboard paste, like sending CTRL-V

//constants - here we define the WM_PASTE constant
Let>WM_PASTE=770

//we need the handle of the object we want to send WM_PASTE to - 
// - as an example let's find the handle of Notepad's edit window
// - for this example make sure Notepad is running with empty document
// - so that the window title us "Untitled - Notepad".  Modify if needed

GetWindowHandle>Untitled - Notepad,hWndParent
FindObject>hWndParent,Edit,,1,hWnd,X1,Y1,X2,Y2,result

//now send WM_PASTE to it using SendMessage API
LibFunc>User32,SendMessageA,result,hWnd,WM_PASTE,0,0

The only benefit I can see with this is that it doesn’t require keyboard focus. In theory neither should ObjectSendKeys and a CTRL-V require keyboard focus. The latter is simpler so I’d tend towards using that. And there may be some applications that work at a higher level and actually expect to see CTRL-V or similar.

Never-the-less it’s a nice example of sending a Windows message and it may be useful for some. So here it is.

March 27, 2013

Getting Data From Excel Without Office Installed

Filed under: Automation, Scripting — Marcus Tettmar @ 11:00 am

In this post from 2008 I demonstrated how to get data from Excel worksheets using Macro Scheduler’s database functions.

This works fine if Office is already installed on the PC.   But what if you want to get data from an Excel sheet and the PC you are running on doesn’t have Office installed?

Well you need the Office Data Connectivity Components which you can download from microsoft.com here:

http://www.microsoft.com/en-us/download/details.aspx?id=23734

This will install the OLEDB/ODBC drivers which DBConnect can then use to make a connection to a workbook.  You can then use DBQuery to retrieve data from a sheet as shown previously.

March 26, 2013

Announcing Script of The Month Contest

Filed under: Announcements — Marcus Tettmar @ 11:30 am

Each month we will choose our favourite script or video posted to the forums and send the developer an MJT Net Gearhead mug. *

Your entry may be something submitted in the usual course of events – i.e. as an example or in response to a user’s question, or just because you want to win a nice mug! 🙂

We’ll accept either some script code or a video demonstrating an automation routine running on your systems.

Any script code you submit needs to be something that will run anywhere and not dependent on applications that only you have access to!  If that isn’t possible, post a video instead.

Your script could be an example of some neat bit of code, something useful for others or just a bit of fun.  Ideally it will demonstrate something that others can learn from.

As mentioned, we’ll also accept a video or screencast if you have a cool script you want to share which only runs on your systems.  So, for example, if you have a routine running at work which automates a desktop or web app that can’t be shared, then take a screencast of the macro in action, submit it to youtube or vimeo or similar and post a link on the forum.

So, get your thinking caps on, and send in some cool code or a macro movie.

* Ideally, each month, we will choose a script/video posted the previous month, but we reserve the right to pick a post submitted at any other time (especially if there have been no recent entries).  We get to pick our favourite – whatever that may be 🙂

March 20, 2013

New Video Tutorials on Image Recognition, Arrays, Loops & Subroutines

Filed under: Announcements — Marcus Tettmar @ 9:12 am

Our good friend Antonius Momac has put together this great video tutorial series.

In this series Antonius walks us through how to use Image Recognition to find and click on a bunch of check boxes. As well as how to use Image Recognition, these videos show you how to loop through an array and how to create subroutines to make your code more efficient and reusable.

We have more video tutorials here. If you have an idea for a new video tutorial, please let us know.

March 14, 2013

Automating Ubuntu Desktop

Filed under: General — Marcus Tettmar @ 3:03 pm

Here’s a quick video showing how easy it is to use Macro Scheduler‘s image recognition to control a Linux Desktop (Ubuntu in this case):

March 12, 2013