I am using variable in object repository to specify browser windows, but it did not work well. Robot can only find the first window like “Engagement : xxxx”
Here is the selector:
string.Format(“”, EngFileNameEscape)
Hi @MakMai,
The problem is likely the selector expression String.Format(“”, EngFileNameEscape). Because the format string is empty, it does not build the expected title. In the Object Repository, use the dynamic variable directly:
<html app='msedge.exe'
title='Engagement : {{EngFileNameEscape}}' />
Make sure
EngFileNameEscapeis a String variable and is assigned before the Object Repository activity runs. Keep Match exact title enabled only if the title matches exactly; otherwise use:title='Engagement : {{EngFileNameEscape}}*'
If multiple windows still match, add a unique URL or element attribute because UiPath will attach to the first matching window. If you build the value outside the Object Repository, use String.Format(“Engagement : {0}”, EngFileNameEscape).
Hi @MakMai ,
Please try using dynamic selector.
Thanks
Hi @MakMai,
When you create a variable in the Object Repository, you need to create the same variable in your workflow and set the required scope when using that element. UiPath will then build the required expression automatically.
Here issue is with your expression: String.Format("", EngFileNameEscape).
Use the following expression instead:
String.Format("Engagement : {0}", EngFileNameEscape)
This will resolve your issue.
Thanks!
