Jump to content

Recommended Posts

Posted

Hey,

I'm attempting to automatically 'Register' a program called Yenka(http://www.yenka.com/), version 3.4.0.

Script:-

Run("C:\Program Files (x86)\Yenka\Software\Yenka.exe")

WinWait("Subjects","choose",10)

ControlSend("Subjects", "", "", "{TAB 8}")

ControlSend("Subjects", "", "", "{SPACE}")

WinWait("Licences","Licences",10) ;<- Script Fails Here

ControlClick("Licences","Licences","[CLASS:QWidget; INSTANCE:13]")

WinWait("Online Activation","",10)

I have found that this program uses Qt, and QWidgets and at the 'Licences' window there isn't a 'usable' title or handle. Can anyone shed some light on this?

Thanks.

Posted

I have searched the forum, tried Ranorex and still can't get it to work.

The window which is giving the grief does not appear to have a handle and can't be referenced via title or text. Hence the post for help.

Posted (edited)

First off I'd try:

Run("C:\Program Files (x86)\Yenka\Software\Yenka.exe")
WinWait("Subjects","choose",10)
ControlSend("Subjects", "", "", "{TAB 8}")
ControlSend("Subjects", "", "", "{SPACE}")
WinWait("Licences","Licences",10) ;<- Script Fails Here
WinActivate("Licences","Licences")
ControlClick("Licences","Licences","[CLASS:QWidget; INSTANCE:13]")
WinWait("Online Activation","",10)

Just because the window exists doesn't mean it has focus - WinActivate() will sort this. Sometimes tho, I have seen a few odd things with WinWait() in the past whereby it just seems to fail. I have had some success with Do/Until, so if the above doesn't work, maybe try this.

Run("C:\Program Files (x86)\Yenka\Software\Yenka.exe")
WinWait("Subjects","choose",10)
ControlSend("Subjects", "", "", "{TAB 8}")
ControlSend("Subjects", "", "", "{SPACE}")
Do
  WinWait("Licences","Licences",10) ;<- Script Fails Here
  WinActivate("Licences","Licences")
Until WinExists("Licences","Licences")
ControlClick("Licences","Licences","[CLASS:QWidget; INSTANCE:13]")
WinWait("Online Activation","",10)

Also, try removing the 10sec timeout from the offending line

Edited by shornw

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Posted

Hey thanks. The window in question has focus already, the problem is there are no controls to interface with.

I need to click the 'Activate' button/link, but I can't find the ID.

It's one of those things you'd need to see.

Posted

Try MouseClick ( "button" [, x, y [, clicks [, speed ]]] ) copied from help file :graduated:

[font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting.

 

[font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color]

[font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font]

Posted

Try activating it manually and monitor where it stores the lic file or search around the harddisk. Could be in registry, userprofile folder and maybe in .ini format or other file type.

Posted

I've tried mouse click, but unfortunately some computers have different screen resolutions and fail.

Ive tried to manually activate the software by importing their registry key, but it fails. There must be a check in the software.

Posted

I've tried mouse click, but unfortunately some computers have different screen resolutions and fail.

You can get the position of any window and then use mouseclick to adjust for any difference in screen resolutions. Look at WinGetPos in help file

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
×
×
  • Create New...