Jump to content

Issue in controlclick - (Moved)


 Share

Recommended Posts

Hi all,

controlclick was not able to click the button on a window, though that window and button are existing.

The same script contains some more button clicks which are working fyne ,but once this particular window comes the issue is occuring and continuing for other windows as well.

Please help us in resolving this issue.

current scenario:

steps 1 to 10 in the script are working fyne ,only the issue is coming from 11th step on wards,

in step11 i was checking for the required window existence and it was existing ,then i was checking for button existence and it was existing and returning the correct button info ("cancel " in my case)

 then sending  "ControlClick"  expecting it should  click on the cancel button(Button7) and close the window,but it was not happening , window screen is still existing.

so taught problem in button7 ,then tried to click on remaining  buttons in that window,but the controlclick was not able to click on those buttons also.

Even tried to change the function control click in below ways and tried but still the problem exists.

ControlClick("Seagull Driver Wizard", "", "[CLASS:Button; INSTANCE:7]")
Send("{Space}")

or

ControlSend("Seagull Driver Wizard", "", "[CLASS:Button; INSTANCE:7]","{Space}")

or

ControlClick("Seagull Driver Wizard", "", "[CLASS:Button; INSTANCE:7]")

 

below is the script:

===============================================================================================================

1.Run("Setup.exe")
2.WinWaitActive("Windows Printer Drivers", "")
3.ControlClick("Windows Printer Drivers", "", "Button1")                                                                                            
4.ControlClick("Windows Printer Drivers", "LICENSE AND LIMITED WARRANTY", "[CLASS:Button; INSTANCE:4]")                                            
5.WinWaitActive("Windows Printer Drivers", "The software will be unpacked to the directory listed below.")                                        
6.ControlClick("Windows Printer Drivers", "The software will be unpacked to the directory listed below.", "[CLASS:Button; INSTANCE:5]")            
7.WinWaitActive("Windows Printer Drivers", "After the drivers are unpacked")
8.ControlClick("Windows Printer Drivers", "After the drivers are unpacked", "[CLASS:Button; INSTANCE:8]")                                            
9.WinWaitActive("Seagull Driver Wizard", "This wizard helps you install and remove printer drivers.")                                                
10.Sleep(1000)

11.If WinExists("Seagull Driver Wizard") Then
      MsgBox($MB_SYSTEMMODAL, "", "Window exists")
Else
      MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Window does not exist")
EndIf
$text = ControlGetText("Seagull Driver Wizard", "", "Button7")
MsgBox(0, "", $text)

ControlClick("Seagull Driver Wizard", "", "[CLASS:Button; INSTANCE:7]")

===============================================================================================================

 


Button7 full information:

 

>>>> Window <<<<
Title:    Seagull Driver Wizard
Class:    #32770
Position:    709, 326
Size:    503, 389
Style:    0x94C800CC
ExStyle:    0x00010101
Handle:    0x0000000000AB14EA

>>>> Control <<<<
Class:    Button
Instance:    7
ClassnameNN:    Button7
Name:    
Advanced (Class):    [CLASS:Button; INSTANCE:7]
ID:    2
Text:    Cancel
Position:    412, 328
Size:    75, 23
ControlClick Coords:    50, 15
Style:    0x50010000
ExStyle:    0x00000004
Handle:    0x0000000000291B90

>>>> Mouse <<<<
Position:    1174, 694
Cursor ID:    0
Color:    0xB8B879

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Welcome to the Seagull Driver Wizard
This wizard helps you install and remove printer drivers.
What would you like to do?
Install printer drivers
Upgrade printer drivers
Remove printer drivers
Please save all work and close all applications before proceeding.  This process may require Windows to be restarted.
< &Back
&Next >
Cancel


>>>> Hidden Text <<<<
Finish
Help
 

 

 

 

    

 

 

 

Link to comment
Share on other sites

Try with that:

Add this at the top of your script

Opt("WinTitleMatchMode",2)

And then change this :

If WinExists("Seagull Driver Wizard") Then

by this :

If WinExists("Seagull") Then

And try again.

 

Also is the window in step 9 and 11 is the same ?

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Try

ControlFocus("Seagull Driver Wizard", "", "Button7")
ControlClick("Seagull Driver Wizard", "", "Button7")

Or

WinWait("Seagull Driver Wizard")
WinActivate("Seagull Driver Wizard")
WinWaitActive("Seagull Driver Wizard")

ControlFocus("Seagull Driver Wizard", "", "Button7")
ControlClick("Seagull Driver Wizard", "", "Button7")

 

Edited by Zedna
Link to comment
Share on other sites

Try with that:

Add this at the top of your script

Opt("WinTitleMatchMode",2)

And then change this :

If WinExists("Seagull Driver Wizard") Then

by this :

If WinExists("Seagull") Then

And try again.

 

Also is the window in step 9 and 11 is the same ?

 

 

Hi caramen,

 

Tried ur suggestion ,but still the same issue exists.

yes,step 9 and 11 are same,step11 is for cross verifying whether that window exist or not.

Regards,

sravan

Link to comment
Share on other sites

one thing i forgot to tell u is ,after step8   one pop-up message  will be displayed querying "do u want to allow following program to make changes to the computer" ,there am selecting "yes " to proceed further ,then step9 will be executed .

so will be there be any issues with the displayed message ?

 

Link to comment
Share on other sites

Ok then you have to add this

#RequireAdmin

at the beginning of your script. 

 

It will prompt you one time at start then it will be able to click after.

 

To explain you the reason...: When you start a programme with admin rights you need admin rights to automate it. 

Or it wont even be able to detect the window and move it etc...

 

(In this case for debug. Please use your initial script with this.) 

 

Btw why not consider what said @Danp2 He is the most experienced in this thread atm.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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...