Sign in to follow this  
Followers 0
autoguy100

Need Help , I Dont See Control Id, Classnamenn, Text

10 posts in this topic

#1 ·  Posted (edited)

Hi All,

I am currently developing script for our product install, the package is developed using install shield, I don't see shortcuts and I don't see Controls Under Mouse like Size:

Control ID:

ClassNameNN:

Text:

so I am not able to select the Radio button, enter username, password, port number and other details. please help how to proceed with this.

Attached image of Install shield and AutoIT window Info.

Edited by autoguy100

Share this post


Link to post
Share on other sites



Send( {Tab} ) to move btwn the fields use spacebar to select radio buttuns and send data to fill in the other fields. Look up send() in the helpfile for more detail but that is a really simple way to fill out a form liek this.


_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Share this post


Link to post
Share on other sites

wheres your mouse? lol u have to go over it to get the control ID if im not mistaken

Share this post


Link to post
Share on other sites

wheres your mouse? lol u have to go over it to get the control ID if im not mistaken

Pointing mouse does not show control id, classname, that's why i attached the AutoIT window IT.

Share this post


Link to post
Share on other sites

thats what im saying it looks like uve only gotten your mouse somewhere over the window not over any of the controls....

Share this post


Link to post
Share on other sites

thats what im saying it looks like uve only gotten your mouse somewhere over the window not over any of the controls....

My friend try to understand, I tried pointing mouse in the controls, the installshield is JAVA based so it is unable to indetify the control id, but i was able to proceed with SEND("{TAB}").

Share this post


Link to post
Share on other sites

o ok im just saying with ur picture it just shows you hovering over the GUI and no specific controls

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I've had similar problems with .NET applications using WinForm. What's worse is that the

control IDs are dynamically generated, so you can't use the IDs even if you get them in the Window Info application. I find the WindowInfo program does not show contols plenty of times, like in IE, etc.

I've been forced to use WinList (), then print the entire array to a file and sort through it. I've found that if I can identify the window manually in that list, and identify the ordinal position in the array returned by WinList, then I can simply run WinList in my script and reference the array offset, grab the ID, and away I go. It's a real hack, but it's the best I can do.

Here's a snippet of code. The dumping of the list starts with my applicaiton window (no need to do this for all of the system windows). This refers to a bunch of utlity functions I wrote to dump things to log files, you can replace that with console outs, or your own dump-to-log file functions.

Hope that helps.

; FUNCTION:  GetWindowList
;   Get and Dump the current list of Windows
;
; DESCRIPTION:  
;   Enumerates the Windows in the system, finds a specific title
;
; PARAMETERS:
;   $lsWindowName
;       Name of the top level window to use as the "base" for the
;       Control # offset
;   $lbDump
;       1 = Dump the window names to the report
;
; RETURNS:
;   Array of windows titles and handles
;
; SIDE EFFECT:  
;   Sets $gnReturnValue = the ordinal position in the array that matches
;   the title in the input parameter
;
; ----------------------------------------------------------------------------
Func GetWindowList ( $lsWindowName, $lbDump )
    dim $laControlList
    dim $lbFoundWindow = 0;
        
    if $lbDump and $gbDebug Then
        SectionbeginPrint()
        ReportWrite( "DUMP ALL CONTROL INFORMATION")
    EndIf
    
    $laControlList = WinList()
;
; Enumerate all system windows, dump them into an array.  The handle can be used for all subsequent operations
; assuming the order of the controls don't change.
;
    For $i = 1 to $laControlList[0][0]
;
; Only return the first occurance
;
        if $laControlList[$i][0] = $lsWindowName and $lbFoundWindow = 0 Then
            $lbFoundWindow = 1
            $gnReturnValue = $i
        EndIf
                
        if $lbFoundWindow and $lbDump and $gbDebug Then
            $lsControlText = ControlGetText( $gsWinName, "", $laControlList[$i][1])
            $laControlPos = ControlGetPos ($gsWinName, "", $laControlList[$i][1])
;
; Don't dump source code, if SciTe is open
;
            if $laControlList[$i][0] <> "source" then
                ReportWrite ("Control Num=" &$i & " Title=" & $laControlList[$i][0] & " Handle=" & $laControlList[$i][1] & " X=" & $laControlPos[0]_
                & " Y=" & $laControlPos[1] & " Width = " & $laControlPos[2] & " Height =" & $laControlPos[3] & " Text=" & $lsControlText)           
            endif
        EndIf
    Next
    
    if $lbDump and $gbDebug Then
        SectionendPrint()
    EndIf
    
    return $laControlList
EndFun
Edited by CharlieK

Share this post


Link to post
Share on other sites

Automating Java Application?

Can't use AutoIt?

Use Java's bulit-in Robot class.

Meant for testing of Java-built applications.

[i have not actually tried using this class, but i do know that they have equivalents for AutoIt's MouseMove and also have a very useful ScreenCapture() function. I'll check out the API and post here when I'm done.]

#)

Share this post


Link to post
Share on other sites

#10 ·  Posted

Not used to Java API home page: but I finally found it:

Nope, sorry, not what you were looking for =.="

java.awt

Class Robot

java.lang.Object

java.awt.Robot

--------------------------------------------------------------------------------

public class Robotextends ObjectThis class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The primary purpose of Robot is to facilitate automated testing of Java platform implementations.

Using the class to generate input events differs from posting events to the AWT event queue or AWT components in that the events are generated in the platform's native input queue. For example, Robot.mouseMove will actually move the mouse cursor instead of just generating mouse move events.

Note that some platforms require special privileges or extensions to access low-level input control. If the current platform configuration does not allow input control, an AWTException will be thrown when trying to construct Robot objects. For example, X-Window systems will throw the exception if the XTEST 2.2 standard extension is not supported (or not enabled) by the X server.

Applications that use Robot for purposes other than self-testing should handle these error conditions gracefully.

Since:

1.3

--------------------------------------------------------------------------------

Constructor Summary

Robot()

Constructs a Robot object in the coordinate system of the primary screen.

Robot(GraphicsDevice screen)

Creates a Robot for the given screen device.

Method Summary

BufferedImage createScreenCapture(Rectangle screenRect)

Creates an image containing pixels read from the screen.

void delay(int ms)

Sleeps for the specified time.

int getAutoDelay()

Returns the number of milliseconds this Robot sleeps after generating an event.

Color getPixelColor(int x, int y)

Returns the color of a pixel at the given screen coordinates.

boolean isAutoWaitForIdle()

Returns whether this Robot automatically invokes waitForIdle after generating an event.

void keyPress(int keycode)

Presses a given key.

void keyRelease(int keycode)

Releases a given key.

void mouseMove(int x, int y)

Moves mouse pointer to given screen coordinates.

void mousePress(int buttons)

Presses one or more mouse buttons.

void mouseRelease(int buttons)

Releases one or more mouse buttons.

void mouseWheel(int wheelAmt)

Rotates the scroll wheel on wheel-equipped mice.

void setAutoDelay(int ms)

Sets the number of milliseconds this Robot sleeps after generating an event.

void setAutoWaitForIdle(boolean isOn)

Sets whether this Robot automatically invokes waitForIdle after generating an event.

String toString()

Returns a string representation of this Robot.

void waitForIdle()

Waits until all events currently on the event queue have been processed.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

#)

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