Jump to content

Issue with open dialog


RaviJ
 Share

Recommended Posts

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

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

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

post-60877-12880894447776_thumb.jpg

Link to comment
Share on other sites

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: Open

Class: SunAwtDialog

Position: 217, 143

Size: 590, 431

Style: 0x96CC0000

ExStyle: 0x00000100

Handle: 0x002F07C0

>>>> Control <<<<

Class:

Instance:

ClassnameNN:

Name:

Advanced (Class):

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

Handle:

>>>> Mouse <<<<

Position: 372, 345

Cursor ID: 0

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Edited by RaviJ
Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...