commonjunks Posted November 19, 2007 Share Posted November 19, 2007 Hi,I am trying to click Save button once IE popup window to download a fileHere following code working flawless when using in au3 fileWinWaitActive("File Download")ControlClick("File Download", "", "&Save")But when i use same code in c#, it is not working as it suppose toAutoItX3Class AUI = new AutoItX3Class();AUI.WinWaitActive("File Download", "", 0);AUI.ControlClick("File Download", "", "&Save", "left", 1, 0, 0)Any help? Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 19, 2007 Share Posted November 19, 2007 I assume the x,y of 0,0 is the problem. On Windows XP, you notice that the buttons have rounded corners. Maybe if you move your click in a bit so it actually touches the button, it might work. Link to comment Share on other sites More sharing options...
zfisherdrums Posted November 19, 2007 Share Posted November 19, 2007 (edited) Hello 'commonjunks'; Try this: AUI.ControlClick("File Download", "", "&Save", "left", 1, -1, -1) Zach... Edit: What Mr. Robertson said! Edited November 19, 2007 by zfisherdrums Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
commonjunks Posted November 19, 2007 Author Share Posted November 19, 2007 @zfisherdrums, your trick did work . @Richard Robertson Thank you. Did i mention, I LOVE YOU GUYS (Not a girly love, but other love). Is there any documentation i refer if i get similar situation? Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 19, 2007 Share Posted November 19, 2007 Pretty much the AutoIt help files. Also, my comment about the rounded corners was a purely visual aspect. Link to comment Share on other sites More sharing options...
zfisherdrums Posted November 19, 2007 Share Posted November 19, 2007 Well, there is the AutoItX Help File and the MSDN documentation, although I'm not sure where I read that the use of '-1' implies default parameters. Outside of that, you have us here in the forum. Good luck with whatever you're working on! Zach... Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
commonjunks Posted November 29, 2007 Author Share Posted November 29, 2007 Ok, it works once and when today i test it again it get fail .I have no idea whyAutoItX3Class AUI = new AutoItX3Class();following code is working when Save As screen appearAUI.WinWaitActive("Save As", "",0);AUI.ControlClick("Save As", "", "&Save", "left", 1, 0, 0);but none of the following work for File Download screenAUI.WinWaitActive("File Download", "",0);AUI.ControlClick("File Download", "", "&Save", "left", 1, 0, 0);orAUI.WinWaitActive("File Download", "",0);AUI.ControlClick("File Download", "", "&Save", "left", 1, -1, -1);as you can see both button seems samefor your information when either line execute AUI.ControlClick("File Download", "", "&Save", "left", 1, -1, -1) or AUI.ControlClick("File Download", "", "&Save", "left", 1, 0, 0) focus go to save button but it don't click it.At end i make some thing which is working but not very cleanAUI.WinActivate("File Download", "");AUI.WinMove("File Download", "", 0, 0, 404, 273);AUI.MouseMove(257, 158, 1);AUI.MouseDown("left");AUI.Sleep(250);AUI.MouseUp("left");AUI.Sleep(250);AUI.WinActivate("Save As", "");AUI.ControlClick("Save As", "", "&Save", "left", 1, 0, 0);Hope someone can help Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 30, 2007 Share Posted November 30, 2007 You used 0, 0 again for your control click. Use -1, -1. Link to comment Share on other sites More sharing options...
commonjunks Posted December 3, 2007 Author Share Posted December 3, 2007 You used 0, 0 again for your control click. Use -1, -1.Hi Richard,Thanks for reply, i tried both1-AUI.ControlClick("File Download", "", "&Save", "left", 1, -1, -1) 2-AUI.ControlClick("File Download", "", "&Save", "left", 1, 0, 0)None of these two work. Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 3, 2007 Share Posted December 3, 2007 (edited) Try 5, 5 then. That should hit the button. Edited December 3, 2007 by Richard Robertson 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