MrPPP Posted October 17, 2010 Share Posted October 17, 2010 (edited) Hello Everybody, I'm having a problem using controlclick when I try to do this on a certain button. This button is embedded in a JAVA applet in a website. The problem is that controlclick only works when I'm hovering the mouse over the control. So I need to simulate a mouse over event at the same time as using controlclick. I found on the forum (http://www.autoitscript.com/forum/index.php?showtopic=120053&view=findpost&p=834466) that I can do this using _IEgetobjectbyid and fireEvent("onmouseover") like this: ; trigger dynamic INPUT TYPE=FILE element creation with onmouseover $oElement = _IEGetObjById($oIE, "Upload_btn") $oElement.fireEvent("onmouseover") (thanks to Dale). And this would probably work if I was able to use _IEgetobjectbyid... The thing is that _IEgetobjectbyid does not "see" my button. Neither does the "Debugbar". I think this is caused by the fact that the button is not defined using HTML or Javascript but JAVA. I can get a ID for the button using the autoit window viewer. This gives me: [CLASS:Button; INSTANCE:1]. I can also get a handle using ControlGetHandle but neither of these two seem to work when I use them in combination with .fireEvent("onmouseover") because autoit gives me a warning that my variable is not an object. (warning is: : ==> Variable must be of type "Object".: ) Can somebody help figuring this out? Can I get the "object name" in some way? Or can I simulate a mouseover event in a different way (not using the cursor of the "real" mouse). Greetings, MrPP Edited October 17, 2010 by MrPP Link to comment Share on other sites More sharing options...
MrPPP Posted October 17, 2010 Author Share Posted October 17, 2010 (edited) I not sure whether this is useful but here is the HTML of the page I'm trying to automate: <html> <head> <title>EdenWall Applet</title> <style type="text/css" media="all"> @import url("portal.css"); </style> </head> <body> <img src="edenwall_portal.jpg"> <br> <h3>Java authentication</h3> <APPLET CODE="nusession.NuApplet" archive="ewapplet.jar" WIDTH=300 HEIGHT=200> <PARAM NAME=TEXT VALUE="You need Java to be able to authenticate to the gateway."> <PARAM NAME=url VALUE="" > <P>You need Java to be able to authenticate to the gateway.</p> </APPLET> </body> J Edited October 17, 2010 by MrPP Link to comment Share on other sites More sharing options...
MrPPP Posted October 17, 2010 Author Share Posted October 17, 2010 This is the code that I have for now. Inserting the inlogname and password works fine. Also wit ControlClick I can see that the button is being clicked but I has only an effect on the button if I also put the mouse above it. (that's what the "sleep ( 1000 )" is for, to give me time to put the mouse on the button (I know I can do this with code but that's not important now). #include <IE.au3> $oIE = _IECreate ( "http://138.102.128.29/applet.php?edenwall_url=#", 0, 1, 1, 1) $loaded = 0 While $loaded = 0 $loaded = ControlCommand ( "EdenWall Applet - Windows Internet Explorer", "", "[CLASS:Edit; INSTANCE:6]", "IsEnabled" ) WEnd Sleep ( 100 ) ControlFocus ( "EdenWall Applet - Windows Internet Explorer", "", "[CLASS:Edit; INSTANCE:6]") ControlSend ( "EdenWall Applet - Windows Internet Explorer", "", "[CLASS:Edit; INSTANCE:6]", "xxx", "1" ) ControlFocus ( "EdenWall Applet - Windows Internet Explorer", "", "[CLASS:Edit; INSTANCE:7]") ControlSend ( "EdenWall Applet - Windows Internet Explorer", "", "[CLASS:Edit; INSTANCE:7]", "xxx", "1" ) Sleep ( 1000 ) ControlClick ( "EdenWall Applet - Windows Internet Explorer", "", "[CLASS:Button; INSTANCE:1]", "primary", "1", "5", "5") Exit 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