Modify

Opened 18 years ago

Closed 18 years ago

#179 closed Bug (Duplicate)

The use of "[CLASS:classnane; TEXT:controltext]" method to identify controls has been broken in the latest betas

Reported by: Bowmore Owned by:
Milestone: Component: AutoIt
Version: Other Severity:
Keywords: AutoIt beta 3.2.11.3 Cc:

Description

Win XP Home/Pro SP2
AutoIt beta 3.2.11.3

The use of "[CLASS:classnane; TEXT:controltext]" method to identify controls has been broken in the latest beta 3.2.11.3, I haven't checked 11.1 and 11.2, I is working correctly in 3.2.10.0

My investigations so far point to the sailient point being that if one of the controls in the CLASS: has a null text value "" then it seems to be selected in preference to the TEXT: value specified

Script to reproduce observed behaviour using Word 2002 or 2003.
Hopefully someone will have access to Word and be able to confirm my observations.

To used it you need to have a number of toolbars visible and docked including the 'Web' and 'Visual Basic' toolbars. Run with 3.2.10.0 and 3.2.11.3 and you'll see the difference. The 'Visual Basic' toolbar is found in 3.2.10.0 but not in 3.2.11.3

;Requires Word 2002 or 2003 with most toolbars visible and docked 'WEB' and 'Visual Basic' must be visible. may work with
#Include <WinAPI.au3>
#Region ### Set Options
Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 2)
Opt("MustDeclareVars", 1)
#EndRegion ### Set Options

WinWait("[REGEXPTITLE:^.* - Microsoft Word$]","")
If Not WinActive("[REGEXPTITLE:^.* - Microsoft Word$]","") Then WinActivate("[REGEXPTITLE:^.* - Microsoft Word$]","")
WinWaitActive("[REGEXPTITLE:^.* - Microsoft Word$]","")

; remove the text from the 'Web' toolbar 
; so that there is a least one toolbar with "" text.
ControlSetText ("[REGEXPTITLE:^.* - Microsoft Word$]","","[CLASS:MsoCommandBar; TEXT:Web]", "" )

Global $hWnd = ControlGetHandle("[REGEXPTITLE:^.* - Microsoft Word$]","","[CLASS:MsoCommandBar; TEXT:Visual Basic]")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hWnd = ' & $hWnd & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

Global $Result = _WinAPI_GetWindowText($hWnd)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Result = ' & $Result & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

Attachments (0)

Change History (2)

comment:1 by TicketCleanup, 18 years ago

Version: Other

Automatic ticket cleanup.

comment:2 by Valik, 18 years ago

Resolution: Duplicate
Status: newclosed

I know it doesn't sound like it, but this is actually a duplicate of #173. The bug is, the advanced title matching is only reading up to the first ; character. It should be fixed in 3.2.11.4. Closing this as Duplicate, re-open if you experience the same behavior with 3.2.11.4 when it's released.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.