I’m hoping someone can help with my peculiar problem :).
Our UI automation (desktop app) scripts use java jp2launcher app. Each element selector contains “jp2launcher.exe” tags. My org recently updated the app that we automated which now comes bundled with “java.exe” instead. This means we need to update all our code (over 5,000 instances/references to update). I decided to use a variable (to avoid this issue in the future). I opened all our files in notepad++ and did a find replace like:
<wnd app='jp2launcher.exe' cls='SunAwtFrame' />
is replaced with:
<wnd app='{{exefileName}}' cls='SunAwtFrame' />
where exefileName = ‘java.exe’
Problem now is that when I do this bulk changes in notepad++, the script fails cos the robot can’t find the element. If I make the changes individually directly in the properties panel in the code, it works. I’m suspecting that there might be some metadata or something similar that still references old value somewhere in the xml files.
It’s a lot of effort to do it one by one (about 1k instances in each file, and we have about 100 files).
Any ideas on how to do this bulk update? I know that I can just replace with hardcoded value but I wanted a more lasting solution in case this situation happens again.
Oh wow, thanks for this! I didn’t know there was a difference in the syntax used in selector editors compared to expression editors. This could very well be the root cause of my problem.
With me doing a bulk update via notepad++ (which will essentially update all references both in selectors and expressions), which syntax would be best that would work for both?
A way using string concatenation is easy by simple replacing.
like replace jp2launcher.exe with "+exefileName+"
However, we cannot use Selector Editor if the above expression is used and it may cause decreasing in maintainability.
A way using String.Format which is like created by Expression editor is not easy to achieve it. It may be necessary (complex) regex replace or some programming.
As another way, Using simple replacing without variable might be compromise, too.