Sign in to follow this  
Followers 0
TheMinister

Script Failing -> Here

13 posts in this topic

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.

Share this post


Link to post
Share on other sites



Search before posting. I've found


Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I'm not using any UDFs, it's plain and simple autoit code.

Share this post


Link to post
Share on other sites

#6 ·  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]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks. I've tried running it with the MouseClick function.

Unfortunately, this doens't work when the application is @SW_HIDE

Any other ideas?

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