Karl_Foster Posted June 18, 2017 Share Posted June 18, 2017 I am not sure if this is the right place to post this so please forgive me if it is not. I have been battling with trying to get file upload going but have not been successful. Using information found on this forum, I have gotten as far as manipulating the "Choose File to Upload" pop up window. I find, though, that once I close the pop up window, with the Open button, the command to click the upload button doesn't always work. In fact, it only works occasionally. When I use the Cancel button in the pop up, I can click the upload button every time (but, of course, there is nothing to upload). Other commands in my script seem to work after the pop up is closed (however it is closed) though. Can someone explain and help me fix this? Code to manipulate the "Choose File to Upload" pop up window (I copied this from the forum and modified it): Local $sCommand = _ 'Local ' & _ '$Dummy1 = WinActivate("Choose File to Upload", ""), ' & _ '$Dummy1a = WinWaitActive("Choose File to Upload", ""), ' & _ '$Dummy2 = Sleep(1000), ' & _ '$Dummy3 = ControlSetText("Choose File to Upload", "", "[CLASS:Edit; INSTANCE:1]","c:\filename.ext"), ' & _ '$Dummy4 = ControlClick("Choose File to Upload", "", "[CLASS:Button; INSTANCE:1]") ' & _ '' $sCommand = '"' & StringReplace($sCommand, '"', '""') & '"' Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $sCommand) Command to Click upload button: $oRetCode = _IEAction ($oUpload, "click") This returns a value of 1 each time, but the button is not activated if the "Choose File to Upload" pop up window was closed by clicking the Open button. Let me know if additional information is required and I will supply it. Thanks in advance. Link to comment Share on other sites More sharing options...
CruelMemories Posted June 19, 2017 Share Posted June 19, 2017 Is this your site, random site? Give me the site and I might come up with something here Link to comment Share on other sites More sharing options...
Karl_Foster Posted June 19, 2017 Author Share Posted June 19, 2017 Thanks for responding. The site I am doing this against is not accessible directly from the Internet (requires VPN) and requires credentials to navigate to the upload page. What kind of information would you require? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now