Sign in to follow this  
Followers 0
JonAnton

Run("")... ClickOnce Application Reference

8 posts in this topic

I created a script to do Automated Regression testing on one of our UI's. It is deployed into ClickOnce.

I got it to work by finding where ClickOnce puts the .exe file on my PC. And it ran like a dream. However as soon as a new version was released my script broke.

It seems that when you run the UI from my PC it calls it from a location under my Documents and Settings/..... location. If there is a new version the Application Reference triggers ClickOnce to write the new version to a new directory in that location and that breaks my script.

I tried recording the clicking of the application reference, but that doesn't seem to do anything. The script appears to pause at that point in the code.

I really like AutoIT and I can see that I will be able to do a lot more with it if I can just get past this problem.

I hope I explained it well enough for someone to understand what I am talking about.

Thanks for any help.

Jon

Share this post


Link to post
Share on other sites



Hi.

Welcome to the forum.

I'd like to suggest, to use procmon.exe to catch, what exactly is failing.

Often the filter "Result" - "is not" - "Success" - "include" is a good start.

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi, JonAnton, welcome to the forum. Is the directory that the executable is being saved in incremental (/.../...Prog1, /.../...Prog2, etc.) or is creating a GUID-type directory (/.../...{003BFBBD-6C67-419E-A24D-0DCAFC3A5249})?

If it is the former, I would suggest searching the parent folder first, then find the most current folder, and use that as your path. Otherwise, if you don't have any set pattern to go on, you can always do a FileOpenDialog first, and select the file you want to run the test script against. I do this on a couple of my testing scripts. Something like:

$parentDIR = @MyDocumentsDir
FileOpenDialog("My Test Script", $parentDIR, "Applications (*.exe)")

Edit: Fixed my horrid grammar

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Thanks JLogan,

It is the latter..... We might have a half dozen version changes in a month sometimes. The UI I am starting with is the most actively used UI in our package. Ideally, we only update once a month, but there are little patches released in between sometimes.

I will play with the FileOpenDialog command. From your description it will search for the newest directory in the target directory I set up? One thing... for this UI it appears it saves the previous 3 released versions too, but there are dozens of other UI directories in this same directory. Will this search for directories containing the corresponding .exe file and then choose the newest? If so, this seems like it might work. I will play with it today.

Thanks.

Share this post


Link to post
Share on other sites

Go ahead and give it a try, and let us know if you run into any roadblocks. If you do, try posting the exact path of the directories for different versions of the same executable, so we can see the pattern. That will make it easier to assist. If it is a hex key, as you mention, we may have to go with a StringRegExp to locate the most recent one.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Say, I am still a little confused.... Below is the path to folders and the four latest folders with the bottom one being the latest. Each of those four contains the .exe file I need to run. This folder also contains dozens of other sets of folders for the other UI's our application uses.

C:\Documents and Settings\JEAnton\Local Settings\Apps\2.0\H6KW0Q10.MY7\ZKJZDN09.585\orde..tion_10c62d0224737893_0004.000c_cfcd71d516e80c4a

orde..tion_10c62d0224737893_0004.000c_cfcd71d516e80c4a

orde..tion_10c62d0224737893_0004.000c_dd9e18d2ca2bc0ab

orde..tion_10c62d0224737893_0004.000c_e0ad890df3aaae0a

orde..tion_10c62d0224737893_0004.000c_ec81f11eb05c8dab

I appreciate your time.

Thank You,

Jon

Share this post


Link to post
Share on other sites

So the first two bits of the directory (10c62d0224737893 & 0004.000c) seem to be static. Can you confirm that these are unique to this particular app? If so, I would think you could loop through all directories matching the first two with something like StringInString to find the most recently created directory.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

That folder is unique to this UI. Is it possible for you to give me an example of how the code might look for this? You'd be my hero.

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