Tuesday, June 10, 2014

Tidying up, but trouble with Sikuli

Spent some time cleaning up test files, editing and re-running prior unit tests, and generally making the Tests folder nice. Picked off a couple more minor bugs.

Then started the main effort, a Sikuli script to really test all the mainwindow features accessed by the File menu. I've already been using these in casual tests in coding but I want to see them all exercised in formal fashion. I thought Sikuli could do this, after my previous success in using it with the edit view window. Wow, that was April. How time flies.

So it turns out Sikuli isn't so helpful when testing menus in the Mac OS menu bar. The problem is the interactive capture of target app menus. Running in the Sikuli IDE you want to say "click on this" and it gives you a view of the whole screen minus the Sikuli windows, and you are supposed to be able to drag over it to select where to click. Unfortunately, the left-hand end of the menu bar still has the Sikuli application's rather lengthy name and no File menu. So, where to tell it to click?

Well, it works to drag over a rectangle about where the File menu will be when the target app is in front, so executing that script does cause the target's File menu to open. But now I want to tell Sikuli, "find( - image of open file menu here - )". But when I go back to the Sikuli IDE and activate the "find" dialog and it tells me to select a piece of the screen—the File menu has disappeared.

This wasn't a problem when capturing the pop-up menu in the edit view window. A pop-up context menu stays open until dismissed. But the File menu from the Mac OS Menu Bar does not stay open when you switch away from the app that owns it. So I'm not seeing how to get Sikuli to verify the contents of my File menu or click on items in it. Put a question in and we'll see.

No comments: