l15jetson

MouseMove () issue using IE10

14 posts in this topic

#1 ·  Posted (edited)

I have a program to run mousemove that works fine on a machine running IE8 but some machines that have IE10 do not preform properly. I use the mousemove to scan over fields looking for a specific file then click on that file. As stated it works fine in 8 but it moves over the file in 10 and does not stop and left click the file name. Here is a portion of the script, earlier in the script it opens IE to a specific (internal company) page then runs this. Thanks!!

 
$mousex = 12
$mousey = 80
$error = 0
Do
$mousey = 80
Do
  MouseMove ( $mousex, $mousey, 0 )
  sleep (300)
  $text = WinGetText ( "Home-Windows Internet Explorer" )
       If StringInStr ( $text, "file name" ) > 0 Then
  MouseClick ( "left" , $mousex, $mousey )
  $error = 1
  $savemousey = $mousey
  $savemousex = $mousex
  $mousey = 240
  $mousex = 372
  Else
  $mousey = $mousey + 10
  EndIf
Until $mousey = 240


$mousex = $mousex + 30
Until $mousex = 402


If $error = 0 Then
MsgBox ( 0, "Error", "Message" )
exit
EndIf

Thanks MikahS!

I hope this is what you meant by using the blue A. When I copy the code over from the autoit SciTE it does not bring over the colors like your example post. If I am still posting it wrong I will not copy paste but manually type the code and change the colors and font. Thanks again!!

 

 

Edited by l15jetson

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi |15jetson!

Welcome to the AutoIt forum. :)

For clarity and the ability for us to easily look over your code may I suggest using code tags as such: [ autoit ] ; code goes here [ /autoit ] (remove the spaces). Or use the blue A in the toolbar.

Global Enum $test = 1000 ; just an example

 

You can easily edit posts you've made using the edit button on the bottom right of your post. :)

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

Let me try this again.

I have a program written to automate a work process, created a long time ago (back with IE6). I have since modified many of the scripts to accommodate newer versions of IE. I am having trouble with the "MouseMove" working properly on machines running IE10 but the program works fine on older versions. The script will open an internal web page, scan the page using mouse move looking for a specific file. It is written to scan the page to make it universal and not just go to specific coordinates in case it is in a different location on someone else's machine. But when running on IE10 it skips over the filename like it is not seen. The portion of the code is listed above and here again. Again I normally do not post to forums but I am having difficulty finding any information on how "MouseMove" works to scan the sheet not go to specific coordinates.

;LOOP TO FIND CORRECT BUTTONS TO CLICK ON ANY COMPUTER
;LOOP TO FIND LOG FILES LINK

$mousex = 12
$mousey = 80
$error = 0
Do
    $mousey = 80
    Do
        MouseMove ( $mousex, $mousey, 0 )
        sleep (300)
        $text = WinGetText ( "Project Home Page - Windows Internet Explorer" )
            If StringInStr ( $text, "ocx_logfiles.asp" ) > 0 Then
        MouseClick ( "left" , $mousex, $mousey )
        $error = 1
        $savemousey = $mousey
        $savemousex = $mousex
        $mousey = 240
        $mousex = 372
        Else
        $mousey = $mousey + 10
        EndIf
    Until $mousey = 240

    $mousex = $mousex + 30
Until $mousex = 402

If $error = 0 Then
MsgBox ( 0, "Error", "Copy Config Files link was not found on polling page. Try again or copy manually." )
exit
EndIf

Share this post


Link to post
Share on other sites

Can you explain why you aren't using the _IE functions?

Share this post


Link to post
Share on other sites

This program was first created by someone no longer with this company. But for every version of IE it seems the _IE functions are different. I have programming knowledge but do not know what the specific _IE functions are to use for every version of IE. This program was first created using IE6, then when IE7 and IE8 came about the program would not even open a browser because it called out a different path. I fixed that and now with IE10 the mouse over seems to be different. The path it is looking for is the same but it will not stop. If you have a place I can reference IE functions to input into the program I can create different iterations to work for different browsers but making one generic would be less time consuming and easier to manage. The file it needs to open is located under a drop down menu that appears only when the mouse hovers over the primary link. Again if you can send a link to specific IE function names or code I can try that. Thanks!!

Share this post


Link to post
Share on other sites

The _IE functions are all described in the AutoIT help file, and FWIW they work correctly with multiple versions of IE.

Share this post


Link to post
Share on other sites

Thanks I will look into that.

Share this post


Link to post
Share on other sites

i would suggest getting IEDOM inspector 2.4.2  (2 weeks free trial) to find the node for that menu item. then with autoit _IE related functions you can click,read or other stuff wihtout moving mouse over the drop down menu

Share this post


Link to post
Share on other sites

Why not just use the Internet Explorer Developer Toolbar?


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

that is good too, but dom inspecrot gives away node path easier, and dev toolbar sometimes is hard to get to dropdown meny items.

Share this post


Link to post
Share on other sites

Thanks everyone. After trying the IE functions I see why the original developer did not use because no function method sees the item in the drop down menu. It is not called by name so I will use the methods mentioned to see it I can fine the correct node for the menu items needed.

Share this post


Link to post
Share on other sites

give it try IEDOM inspector 2.4.2.... i had only 1 site where this was useless on dropdown items on http pages....   and i have conquered many. it goes for unnamed items too (maybe you will get something like document.getelement("some-id").childnodes.item(x).childnodes.item(x).  etc.... if u can capture this with IEDOM, you can drive

Share this post


Link to post
Share on other sites

Thanks all I think I have found a better way with all the suggestions. After doing some experiments and checking I found that if I use "_IELinkClickByIndex" I can get it to open the web page and go directly to the link/links needed. All the information has been very helpful and I should be able to save some company time by updating the scripts created 8 years ago. The _IE functions was a very good tool, I also added a "winsetstate" to maximize the window. Very help full!!!

Share this post


Link to post
Share on other sites

Glad you found a solution to your needs. :)


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now