Forum Discussion
Can you share an example of your attempt to use FindChild that is not working? I don't think the problem is necessarily in FindChild, but perhaps simply in finding the correct properties to work with.
Generally speaking.... start with a common parent object on both UI's... let's called it PanelX. So, you could do your code like this (I'm using a JavaScript syntax but, technically, this should work fine even in your C#Script since it is, under the covers, just JScript with support for C# Syntax).
var myObject = PanelX.FindChildEx(['ObjectType','idStr'],['Textbox','menuSearch'], 5, true, 10000) if (myObject.Exists) { Log.Message('Must be using the old UI'); } else { myObject = PanelX.FindChildEx(['ObjectType','idStr'],['Textbox','menu_search_input'], 5, true, 10000); if (myObject.Exists){ Log.Message('Must be using the new UI'); } else { Log.Warning('Could not find the object in either UI pattern'); } }
Basically... search for it at a depth of 5 (this is assuming that PanelX is at most 5 ancestors above the desired child object) using the old UI idStr and continue pinging it for 10 seconds until either the object is found or the time out is reached. If it is not found there, search using the new idStr and continue pinging for 10 seconds. If it's not found there, log a warning, otherwise, myObject is now the desired object.
Related Content
Recent Discussions
- 5 hours agoSvetaG