RaviJ Posted October 26, 2010 Share Posted October 26, 2010 Hi, I am using following script for handling open dialog AutoItSetOption("WinTitleMatchMode","2") $title = WinGetTitle("Mozilla") ; retrives whole window title WinActivate($title); MouseClick("left", 380, 485, 2) WinWait("Open") $title = WinGetTitle("Open") ; retrives whole window title WinActivate($title) WinWaitActive($title) Sleep(2000) $fullpath = "C:\Documents and Settings\ravi.jain\Desktop\AutIt\scripts" ControlSetText($title, "", "Edit1", $fullpath) All is working fine but in the last line : ControlSetText is not working and i am not able to type a file name in to edit field. Please let me know the solution. Thanks, Ravi Link to comment Share on other sites More sharing options...
JohnOne Posted October 26, 2010 Share Posted October 26, 2010 It could be that the control needs focus first try ControlFocus() It could be that the control ID is incorrect It just might not like that ControlSetText, try ControlSend() (maybe also with ControlFocus()) It will be difficult for anyone to try it and help you since we dont know the mozilla windo you are opening. Also some windows just dont like accepting data this way. Add some info about the window you want to work with. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
RaviJ Posted October 26, 2010 Author Share Posted October 26, 2010 Thanks JohnOne for the reply. Actually i am using autoIt with selenium. So I do first activate firefox browser(where selenium is executing.) My app used java applet for uploading data. Now using autiIt script first i click on button and activate open dialog. * I used your solution ControlFocus() but not getting any luck I don't know how to identify control id for particular control. How can i get the control id. I also attached a screen shot of my dialog. Thanks, Ravi Link to comment Share on other sites More sharing options...
RaviJ Posted October 26, 2010 Author Share Posted October 26, 2010 (edited) I don't know how to identify control id for particular control. How can i get the control id.I tried to get controls using Au3Info but not getting any info except Title and class. The output of summary tab is :>>>> Window <<<<Title: OpenClass: SunAwtDialogPosition: 217, 143Size: 590, 431Style: 0x96CC0000ExStyle: 0x00000100Handle: 0x002F07C0>>>> Control <<<<Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<<Position: 372, 345Cursor ID: 0Color: 0xFFFFFF>>>> StatusBar <<<<>>>> ToolsBar <<<<>>>> Visible Text <<<< Edited October 26, 2010 by RaviJ Link to comment Share on other sites More sharing options...
JohnOne Posted October 26, 2010 Share Posted October 26, 2010 I've noticed around the forums that autoit has a little difficulty dealing with java windows, but I could be wrong. You might end up having to use a series of Send({TAB}) , or other keys to navigate to your controls, and use a generic Send($var) to enter your desired text. Someone may come along with a better solution for you. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
RaviJ Posted October 26, 2010 Author Share Posted October 26, 2010 Thanks again JohnOne Using Send($var) : Now I can type value in to edit field and then i use Send("{ENTER}"). Thanks, Ravi 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