tags:

views:

229

answers:

4

We use Watir with AutoIT for testing our web apps with IE on Windows. The AutoIT is used where Watir falls short in handling native Windows dialogs (like Windows File dialog for upload).

Because of AutoIT, we are not able to run our tests using task scheduler as AutoIT operations from Watir code need an Interactive Desktop session.

We have tried a few tricks (RDP from a RDP, etc.) but w/ no success and are not able to do true automation.

Any ideas? Open to replacing AutoIT if it can help us achieve true end2end testing automation.

A: 

I'd replace Watir. ;)

I'm not quite sure about Watir but I believe it's nothing but a wrapper for InternetExplorer.Application COM object, which you can easily use straight from AutoIt with all its functionaly, through ObjCreate("InternetExplorer.Application"), or through user defined functions listed in IE Management section.

I do believe you could script all your testing scenarios only in AutoIt. Why do you need an interactive desktop session?

be here now
I guess you could do some reading on Watir on how/why it's used for web testing :-) There are certain actions where AutoIT script hangs when running as a scheduled task and the same script runs fine when we are logged on to the machine.
Raj
+1  A: 

You need to use a scheduler that is running with user permissions. I've previously used CruiseControl.Net to do this.

If your process doesn't have user permissions, it won't have access to desktop windows, which is what you need whether you are using Watir, AutoIT or some other tool. This is a permissions issue, not a tool issue.

Bret Pettichord
User permission is not an issue because the service account we use has full admin access to the box.
Raj
And, we have isolate it to the point where it's the AutoIT script that requires interactive desktop session
Raj
The account may have full admin access, but if it is running as a service it won't have access to the desktop. In other words it is a problem with the permissions on the process not the user.
Bret Pettichord
A: 

I'd replace Watir with iMacros. It is a commercial solution but it can handle download dialogs etc. And unlike Autoit it can manage multiple instances at the same time.

SamMeiers
Thanks Sam, it does look interesting. If we were to plan the move, it would be quite painful to migrate all Ruby Watir scripts (and we have quite a few) to this tool. Honestly, I have considered moving to Selenium but the effort would be too much for us.
Raj
+2  A: 

We had similar issues when we started running our tests from our TeamCity agents that were running as a service. This is because you are trying to run an interactive process from a service which is not interactive. We switched to have our TeamCity agents run as normal processes and the problem went away.

You may want to look into a build management server to handle running this instead of just using Task Scheduler, but either way you want to avoid running the test process as a service.

JEH
Thx - will give it a shot w/ a CI tool and see if it helps
Raj
I completely agree. I was trying to say the same thing in my reply.
Bret Pettichord

related questions