Paras

Download in IE

1 post in this topic

Hi,

I am trying to download from IE11 using autoIT. It works fine on my local system but does not work when I try to run my scripts on a remote machine (I am using Selenium GRID). Below is the code:

private const string SaveAs = "Save As";
private const string KeyboardTab = "{TAB}";
private const string KeyboardF6 = "{F6}";

public string IEFileSaveAs(string filePath)
        {
            _windHandle = autoIt.WinGetHandle("[Class:IEFrame]", "");
            _winTitle = "[HANDLE:" + _windHandle + "]";

            autoIt.WinActivate(_winTitle, "");
            autoIt.Send(KeyboardF6);
            autoIt.Sleep(2000);
            autoIt.Send(KeyboardTab);
            autoIt.Sleep(1000);
            autoIt.Send("{DOWN}");
            autoIt.Sleep(1000);
            autoIt.Send("a");

            Thread.Sleep(3000);

            autoIt.WinWaitActive(SaveAs, "", 10);
            autoIt.WinActivate(SaveAs, "");

            autoIt.ControlFocus(SaveAs, "", "[CLASS:Edit;INSTANCE:1]");
            autoIt.Send(filePath);

            Thread.Sleep(2000);

            autoIt.ControlClick(SaveAs, "", "[TEXT:&Save]", "LEFT");

            autoIt.WinActivate(_winTitle, "");
            autoIt.Send(KeyboardF6);
            autoIt.Sleep(2000);
            autoIt.Send(KeyboardTab);
            autoIt.Sleep(1000);
            autoIt.Send(KeyboardTab);
            autoIt.Sleep(1000);
            autoIt.Send("{ENTER}");

            return filePath;

        }

Could please someone help me?

Thanks,

Paras

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now