Jump to content

Run("")... ClickOnce Application Reference


JonAnton
 Share

Recommended Posts

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

Link to comment
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!

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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