Jump to content
sravan

Issue in controlclick - (Moved)

Recommended Posts

sravan

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
 

 

 

 

    

 

 

 

Share this post


Link to post
Share on other sites
caramen
Posted (edited)

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

IUIAutomation From Junkew WebDriver From Danp2  >>HIt The Thanks Button.<<

 

Share this post


Link to post
Share on other sites
Zedna

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

Share this post


Link to post
Share on other sites
sravan

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

Share this post


Link to post
Share on other sites
sravan

Hi Zedna,

Even i tried ur suggestion alos,but still that also not working.

Regards,

sravan.

Share this post


Link to post
Share on other sites
sravan

Hi Danp2,

As per my use case i have to automate the windows GUI part,can't use command line.

Regards,

sravan.

 

Share this post


Link to post
Share on other sites
sravan

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 ?

 

Share this post


Link to post
Share on other sites
sravan

ya i clicked on "yes" button manually waiting for  "seagull driver wizard" window in the script (step9), but in that window control clicks are not working (thats wat my issue).

 

Share this post


Link to post
Share on other sites
caramen

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

IUIAutomation From Junkew WebDriver From Danp2  >>HIt The Thanks Button.<<

 

Share this post


Link to post
Share on other sites
sravan

Thanks a lot caramen,it resolved my issue finally,thank u very much....

Thanks to all for all ur time and the info u provided.

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

×