Welcome to the community!
The error occurs because you have not used a Wildcard. A Wildcard as a name suggest can take any value or any range of value. So in your case you know that the number following WID is dynamic so
<html app=‘chrome.exe’ htmlwindowname=‘WID*’> can fix the issue (range of values).
Your selector will also be valid if you used:
<html app=‘chrome.exe’ htmlwindowname=‘?ID*’>
<html app=‘chrome.exe’ htmlwindowname=‘W?D*’>
- Asterisk (
*) – replaces zero or more characters
- Question mark (
?) – replaces a single character
You can read about use of wildcards here: Selectors with Wildcards (uipath.com)