Jump to content
Sign in to follow this  
vm2007

ControlSend not sending text

Recommended Posts

vm2007

Hi All,

Help required!!!!

I was using an autoit script without issues for handling login window on Chrome. But since Chrome updated to 2.29 the login window has changed and my script has stopped working. I made changes to the script but function ControlSend is now not sending the text.

The script is as follows:

sleep(10000)
WinWait("[CLASS:Chrome_WidgetWin_1]","","20")
ControlSend("[CLASS:Chrome_WidgetWin_1; Title:abc | Post - Google Chrome]", "", "[CLASS:Chrome_WidgetWin_0; INSTANCE:1]", "username{TAB}")
ControlSend("[CLASS:Chrome_WidgetWin_1; Title:abc | Post - Google Chrome]", "", "[CLASS:Chrome_WidgetWin_0; INSTANCE:1]", "password{Enter}")
 
In the above script the TAB and Enter work but the text is not typed. 
 
The earlier window (old version of Chrome) used to have different instance number for the 2 text box but the new one refers to both as Instance:1. Not sure whether this is the problem or not.
 
 
Details using SPY
 
 
>>>> Window <<<<
Title: abc | Post - Google Chrome
Class: Chrome_WidgetWin_1
Position: -9, -9
Size: 1938, 1050
Style: 0x17CF0000
ExStyle: 0x00000100
Handle: 0x0000000000120982
 
>>>> Control <<<<
Class: Chrome_WidgetWin_0
Instance: 1
ClassnameNN: Chrome_WidgetWin_01
Name:
Advanced (Class): [CLASS:Chrome_WidgetWin_0; INSTANCE:1]
ID:
Text: abc 
Position: 0, 70
Size: 1920, 971
ControlClick Coords: 866, 184
Style: 0x56300000
ExStyle: 0x00000000
Handle: 0x0000000000260894
 
>>>> Mouse <<<<
Position: 866, 245
Cursor ID: 2
Color: 0xC2C2C2
 
>>>> StatusBar <<<<
 
>>>> ToolsBar <<<<
 
>>>> Visible Text <<<<
Authentication Required
abc
 
 
>>>> Hidden Text <<<<
Edited by vm2007

Share this post


Link to post
Share on other sites
FireFox

Hi,

Please use autoit tags to post your code :)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
EKY32

Well, it MIGHT be a security update by Google. :thumbsup:

Why don't you use _IE functions instead?


[font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]

Share this post


Link to post
Share on other sites
FireFox

Instead of "[CLASS:Chrome_WidgetWin_1]", try :

AutoItSetOption("WinTitleMatchMode", 2)
 
WinWait(" - Google Chrome", "", 20)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
vm2007

Instead of "[CLASS:Chrome_WidgetWin_1]", try :

AutoItSetOption("WinTitleMatchMode", 2)
 
WinWait(" - Google Chrome", "", 20)

Br, FireFox.

Thnx for your suggestion...i tried it but it did not work...still the same problem...The tab and Enter operations are happening but text provided is not being entered.

Share this post


Link to post
Share on other sites
vm2007

Well, it MIGHT be a security update by Google. :thumbsup:

Why don't you use _IE functions instead?

 

Actually i am pretty new to AutoIT.... can you please shed some light as to how i will achieve what i have mentioned using IE functions??

 

Another thing that i want to point out is that text gets entered when i use 'Send' instead of ControlSend but i have read that we should avoid using 'Send' if window is not active. 

Share this post


Link to post
Share on other sites
kylomas

vm2007,

Never used controlsend before but it seems like the control class should be comming from here (from Spy)

Advanced (Class): [CLASS:Chrome_WidgetWin_0; INSTANCE:1]

 

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
Bearpocalypse

Have you tried ControlSetText for sending text? I have having issues with ControlSend for text until I used ControlSetText.

Share this post


Link to post
Share on other sites
vm2007

Have you tried ControlSetText for sending text? I have having issues with ControlSend for text until I used ControlSetText.

 

No i haven't tried it....can you please show me an example of how to use it....thnx

Share this post


Link to post
Share on other sites
Bearpocalypse

No i haven't tried it....can you please show me an example of how to use it....thnx

Here is what I am using to enter my solution data into my Heat ticket that I have saved from a listbox. I've added some comments to explain what I did. Hope this helps!

$Solution = GUICtrlRead($Desc, MouseGetPos(0) & ", " & MouseGetPos(1)) ;Used to select the item in my listbox
    ClipPut($Solution) ;copies the data
    ControlSetText("Call Logging - Work Group", "", "[CLASS:Edit; INSTANCE:3]", $Solution)

;here we have the command ControlSetText.
;I want to select the title of the window I have open which is Call Logging - Work Group.
;Then the text which is just ""
;Next is the class and instance
;Then finally the data from $Solution which is pulled from my listbox.

;All of this information is found with the AutoIt Window Info tool.

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  

×