saldous Posted February 25, 2007 Share Posted February 25, 2007 (edited) Hi, I have a script that opens a webpage where there is a logon box. My script can complete the email address and password fields on the web page but when I have the script submit the form the webpage comes back to the login page, I think the website doesn't want to allow this to happen.So to get around it I'm wanting to have my script complete the fields, but instead of submitting the form I want the mouse to go to the login button and click it. Can this be done? The problem is users will have different screen resolutions so I don't think I can give the mouse coordinates, it needs to locate the login button first and then click it, but I don't know how to do this. Any ideas? Thanks. (PS. I also tried using the Send("{ENTER}") but that had the same problem. Edited February 25, 2007 by saldous Link to comment Share on other sites More sharing options...
_Kurt Posted February 25, 2007 Share Posted February 25, 2007 Well, if screen resolution is your problem: If @DesktopHeight = XXXX AND @DesktopWidth = XXXX Then MouseClick(...) However, I don't think that using the MouseClick command is good, perhaps try another method of obtaining your preferred results. Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
saldous Posted February 25, 2007 Author Share Posted February 25, 2007 I can't think of another way :-( I'm having a problem with the WinGetPos, I was trying to use this to locate some text on the web page, then from those co-ordinates do the mouse click, but the WinGetPos always returns the same co-ordinates, and they are not locating the text in the web page. Link to comment Share on other sites More sharing options...
_Kurt Posted February 25, 2007 Share Posted February 25, 2007 WinGetText? IE functions? Not sure. Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
saldous Posted February 26, 2007 Author Share Posted February 26, 2007 I don't think WinGetText is right, it won't give me the co-ordinates of where that text is on the page. Thanks for trying to help though, I'll keep thinking! Link to comment Share on other sites More sharing options...
Jasio Posted February 26, 2007 Share Posted February 26, 2007 Screenshot of the webpage or something? Link to comment Share on other sites More sharing options...
saldous Posted February 26, 2007 Author Share Posted February 26, 2007 (edited) Screenshot attached. I want to be able to click the "Log On" Button. My problem seems to be related to what the help file says about the IEFormSubmit function: For many HTML forms it is not sufficient to use _IEFormSubmit() because there is often custom Javascript tied to an onclick event for its Submit button. In these cases you'll need to simulate a click of the submit button instead of using _IEFormSubmit(). See the example for the "click" action of _IEAction(). Edited February 26, 2007 by saldous Link to comment Share on other sites More sharing options...
Jasio Posted February 26, 2007 Share Posted February 26, 2007 I'd just use a pixel search to simulate a click on it$login = PixelSearch(0, 0, 1000, 1000, 0x6 digit hex color, 0, 10If Not @error thenmouseclick('left', $login[0], $login[1], 1, 0)EndIf Link to comment Share on other sites More sharing options...
saldous Posted February 26, 2007 Author Share Posted February 26, 2007 Now that is one perfect solution, it works a treat. Thank you Jasio. 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