Hrushi Posted August 28, 2019 Posted August 28, 2019 Hi, I am downloading the file from IE browser through selenium. I am able to download a file if my focus is on browser. But unable to download if focus is not on browser. Could any one please help me? My script : Send("!s") ; Wait for 9 seconds Sleep(9000) ; Press Keyboard ENTER button. Send("{ENTER}") Called using below instruction: Runtime.getRuntime().exec("C:\\FilePath\\DownloadFile.exe")
Developers Jos Posted August 28, 2019 Developers Posted August 28, 2019 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
alienclone Posted August 29, 2019 Posted August 29, 2019 if you manually press keys on the keyboard does it send those commands to your currently opened window? or does it send the commands to some other window in the background? If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version
alienclone Posted August 29, 2019 Posted August 29, 2019 check the InetGet functions instead https://www.autoitscript.com/autoit3/docs/functions/InetGet.htm If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version
Hrushi Posted August 29, 2019 Author Posted August 29, 2019 @alienclone if i manually press keys on the keyboard , it will sent the command for currently open window, not on browser.
alienclone Posted August 29, 2019 Posted August 29, 2019 54 minutes ago, Hrushi said: @alienclone if i manually press keys on the keyboard , it will sent the command for currently open window, not on browser. yes, i was being a smartass, your script is "Send"ing key presses, key presses will always go to the active window, that script will never work on a window that doesnt have focus. if you cant use the InetGet functions i pointed to in my other post, you can use Winactivate to make your browser window active first, then send keys. If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version
Hrushi Posted September 6, 2019 Author Posted September 6, 2019 @alienclone Could you please provide example of InetGet function for download file using autoit without focus on browse? And i want to download file on headless browser also. So i think 'Winactivate' is not a good solution for that.
alienclone Posted September 6, 2019 Posted September 6, 2019 are there not 2 examples already in the link i gave you? If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version
Hrushi Posted September 18, 2019 Author Posted September 18, 2019 I want to use it in Selenium script using java. Could you please help for it? Requirement is "In my application , i want to click on Download button to download the file.I don't have any URL except Application URL.
Hrushi Posted November 26, 2019 Author Posted November 26, 2019 (edited) @alienclone , @orbs, @jdelaney Please suggest us on above. Edited November 26, 2019 by Hrushi
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