Level 3 Advanced Training UiDemo Walkthrough - open application - spaces in path problem


#1

Hi,

I’m going through the UiDemo (1st part) of the advanced training.

My code is failing when it tries to open the UiDemo app (using open application activity).

First I put a message box check the path

image

this is coming from in_Config(“UiDemoPath”).ToString

The problem occurs when it tries to Open Application UiDemo.exe

image

I thought perhaps that there may be a problem with the spaces in the path (in the ‘\Level 3 Advanced Training\’ part)

so I tried

C:\Users\hasee\Desktop\UIPathExamples\UiDemo.exe

and that worked fine.

So my question is how do I use a path that includes spaces when using the open application activity (I know I could change my path but I’m sure there will be situations where that is not an option and a path that includes spaces will be required).


#2

Try replacing spaces with %20


#3

Hi @RupeshGonte,

Thanks for the input but since attempting your suggestion I’ve found that the problem is in fact not with the spaces in the way I originally thought.

Originally I was pulling the UiDemo path from orchestrator via in_Config(“UiDemoPath”).ToString (this in_config dictionary is populated by InitAllSettings workflow in the REFramework.

To test my theory about the spaces I put the no spaces path directly into the open application activity, Filename property (“C:\Users\hasee\Desktop\UIPathExamples\UiDemo.exe”) and it worked (at this point I thought therefore the problem must be with the spaces in the file path).

However I just put the filepath with spaces directly into the Filename property and that also worked (rather than using the in_Config(“UiDemoPath”).ToString.

But when I put the in_Config(“UiDemoPath”).ToString into the Filename property of the open application activity I get the error message and this doesn’t matter whether I use the path with or without spaces so the spaces may be a red herring.

image

I’ve put a message box so I can see the value of in_Config(“UiDemoPath”).ToString and it seems fine (example without spaces to avoid extra confusion) but this does not work and I get the error message shown earlier ‘workflow exeception’

image

image

This is the InitAllApplications workflow that I am trying to get to work

InitAllApplications.xaml (7.6 KB)


#4

Hey @charliefik,

Can you try using ‘start process’ activity instead of open application and see it that makes a difference?


#5

You bloody genius! That did work. But why did that work and open application not work (especially as it was what was in the walkthrough document).

I did post a comment saying that there should be a model answer for this piece of work as I’m not sure I would ever have known that open application is not the way forward (it would be great to understand why) and start process is.

Either way thanks for the help and please explain why that worked.


#6

Haha , Not quite a genius yet! Surely will be someday :joy:

To be honest even i have a problem understanding the difference between the two.
I faced this situation sometime ago and just tried a few different things and this just worked!

You could have a new thread ,maybe somebody with more experience can help with the answer to that question!
It’s only been 2 months for me, still a lot to learn :wink:


#7

Hey @charliefik,

I am facing some problem with this UiDemo REFramework.
Can you tell what error can it be during initialization?

Thanks & Regards,
Harshit Goyal

Main.xaml (49.0 KB)
InitAllSettings.xaml (18.1 KB)
Config.xlsx (19.2 KB)


#8

Hi @harsh497

Can I suggest that you put your post into a new item rather than adding it onto the end of this one as I expect it will get more attention than just addressing me on the problem.

Your main xaml is just standard. The problems you seem to be having are with dictionary keys (probably in the config dictionary) I had problems with the credentials so it may be there when it was filling the config dictionary it didn’t like the credential values for some reason, and closing applications which isn’t in the initallsettings xaml.

Try putting breakpoints into the code and stepping through using the debug functionality, but mostly post the problem separately so you get the best fixers on the job. They may know the answer straight away or may know what area to investigate (with me it took ages stepping through the code to find where a problem was and then quite often asking for help).

Good luck


#9

Thank you so much for your advice.


#10

how can we do that please?