Forum Discussion
HKosova
8 years agoSmartBear Alumni (Retired)
UPD: AlexKaras beat me to it. :)
If there are no other objects with IDs ending in "MenuInner", you can use wildcard search:
var mainMenu = page.FindChild("idStr", "*MenuInner", 10);
Since v. 11.2, Find methods also support regular expressions:
var mainMenu = page.FindChild("idStr", "regexp:^(main)|(nav)MenuInner$", 10);
A couple of notes:
- Use FindChild and not Find. Find starts searching from the parent object itself (in your example - page), FindChild skips the parent object.
- The fourth parameter of Find/FindChild is a boolean (Refresh=true/false) and not a number. Review the parameters to make sure they are correct.
Related Content
- 10 years ago
Recent Discussions
- 10 hours ago
- 7 days ago
- 10 days ago