Sign in to follow this  
Followers 0
supadodger

ControlSEnd Or ControlClick To Browse Button Freezing My Script...

9 posts in this topic

i tried controlclick on the browse button, it will open the choose file window but the script pauses at that point...

so next i tried clicking on the page and using controlsend to click the browse button but it also pauses once the choose file window opens...

i imagine this is related to ie8 security but i'm not sure...

Opt("TrayIconDebug", 1)
#include <IE.au3>
Global $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward
Global $GUI_Button_Home, $GUI_Button_Stop, $msg
$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("MegaUpper Uploader Test", 800, 768, 1, 1)
$GUIActiveX = GUICtrlCreateObj($oIE, 1, 1, 800, 768)
GUISetState(@SW_SHOW) ;Show GUI;
$oIE.navigate("http://www.megaupper.com")
_IELoadWait($oIE)
Sleep(500)
ControlClick("MegaUpper Uploader Test", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "left", 1, 186, 372)
ControlSend("MegaUpper Uploader Test", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", '{tab}{tab}{tab}{space}')
WinWait ("Choose File to Upload","",30)
ControlClick("Choose File to Upload", "", "", "left", 1, 752, 433)

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

What browse button? "ControlClick("Choose File to Upload", "", "", "left", 1, 752, 433)"?

It looks like your script ends there.

it freezes right after the controlsend chooses the browse button... i am running exactly that and tray debug says its still on line 13...

Posted Image

Edited by supadodger

Share this post


Link to post
Share on other sites

What does windows info tool tell you about the window that pops up?

it is freezing on the line before the popup...

its not even getting to that part of the script...

>>>> Window <<<<
Title:  Choose File to Upload
Class:  #32770
Position:   0, 25
Size:   800, 480
Style:  0x96CC02C4
ExStyle:    0x00010101
Handle: 0x00140630

>>>> Control <<<<
Class:  
Instance:   
ClassnameNN:    
Name:   
Advanced (Class):   
ID: 
Text:   
Position:   
Size:   
ControlClick Coords:    
Style:  
ExStyle:    
Handle: 

>>>> Mouse <<<<
Position:   312, 51
Cursor ID:  2
Color:  0x090F14

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Namespace Tree Control
Tree View
ShellView
File &name:
Files of &type:
All Files (*.*)
&Open

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

i tried controlclick on the browse button, it will open the choose file window but the script pauses at that point...

so next i tried clicking on the page and using controlsend to click the browse button but it also pauses once the choose file window opens...

i imagine this is related to ie8 security but i'm not sure...

Opt("TrayIconDebug", 1)
#include <IE.au3>
Global $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward
Global $GUI_Button_Home, $GUI_Button_Stop, $msg
$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("MegaUpper Uploader Test", 800, 768, 1, 1)
$GUIActiveX = GUICtrlCreateObj($oIE, 1, 1, 800, 768)
GUISetState(@SW_SHOW) ;Show GUI;
$oIE.navigate("http://www.megaupper.com")
_IELoadWait($oIE)
Sleep(500)
ControlClick("MegaUpper Uploader Test", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "left", 1, 186, 372)
ControlSend("MegaUpper Uploader Test", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", '{tab}{tab}{tab}{space}')
WinWait ("Choose File to Upload","",30)
ControlClick("Choose File to Upload", "", "", "left", 1, 752, 433)

I think it might be because you have the wrong window title. You have:

CControlSend("MegaUpper Uploader Test", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", '{tab}{tab}{tab}{space}')

But in the picture from the auto it InfoWindow the title of the screen is:

>>>> Window <<<<
Title:  Choose File to Upload

I am assuming that it isn't seeing the title window "MegaUpper Uploader Test" so it is waiting for it to exist. Try:

#include <IE.au3>
Global $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward
Global $GUI_Button_Home, $GUI_Button_Stop, $msg
$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("MegaUpper Uploader Test", 800, 768, 1, 1)
$GUIActiveX = GUICtrlCreateObj($oIE, 1, 1, 800, 768)
GUISetState(@SW_SHOW) ;Show GUI;
$oIE.navigate("http://www.megaupper.com")
_IELoadWait($oIE)
Sleep(500)
ControlClick("MegaUpper Uploader Test", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "left", 1, 186, 372)
ControlSend("Choose File to Upload", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", '{tab}{tab}{tab}{space}')
WinWait ("Choose File to Upload","",30)
ControlClick("Choose File to Upload", "", "", "left", 1, 752, 433

Hope this helps...

Edited by dakishman

I love AutoIT! It doesn't talk back, it doesn't complain that ur on the computer, it loves to be ran over and over and over... but IT STILL DOESN'T DO THE DISHES... Gatta keep da pimp hand strong...

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

you are going too far... its freezing on line 13 when it tabs through the webpage...

that controlsend is made for the window i had it on...

the MegaUpper Uploader Test is the window i have created...

its freezing before it gets to the part of the script where its supposed to interact with the upload window...

you could try running it?

Edited by supadodger

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

It looks to me like you are sending 3 tabs and a space to that button you just clicked on line 13, maybe remove the class and instance and just send those commands to the window?

*edit* here is another thing...

You have some x and y value defined. You already told where to click with the class/instance. Your x/y values are probably putting the click off the button. You should remove them because default is center of the button.

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

It looks to me like you are sending 3 tabs and a space to that button you just clicked on line 13, maybe remove the class and instance and just send those commands to the window?

*edit* here is another thing...

You have some x and y value defined. You already told where to click with the class/instance. Your x/y values are probably putting the click off the button. You should remove them because default is center of the button.

it does not click a button on line 12 it clicks into the webpage then tabs into the button... i did that because the click was freezing at the same spot...

it doesnt work as click or keyboard commands...

the problem isnt that its not clicking... IT IS CLICKING... The script is freezing after the click...

the following code does the same thing and freezes after the click :

Opt("TrayIconDebug", 1)
#include <IE.au3>
Global $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward
Global $GUI_Button_Home, $GUI_Button_Stop, $msg
$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("MegaUpper Uploader Test", 800, 768, 1, 1)
$GUIActiveX = GUICtrlCreateObj($oIE, 1, 1, 800, 768)
GUISetState(@SW_SHOW) ;Show GUI;
$oIE.navigate("http://www.megaupper.com")
_IELoadWait($oIE)
Sleep(500)
ControlClick("MegaUpper Uploader Test", "", "", "left", 1,  745, 439)
WinWait ("Choose File to Upload","",30)
ControlClick("Choose File to Upload", "", "", "left", 1, 752, 433)
Edited by supadodger

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
Sign in to follow this  
Followers 0