Hi whuang
sys.Browser("*").Page("*").Find("contentText", "CorelDRAW Graphics Suite 2019 Education Edition", 10)
This is likely bringing back the last of the two panels, since you have two panels that appear to have the same name. In my experience, TC returns them in order from deepest in the tree to highest. I wouldn't count on this though.
I would suggest name mapping the top Panel("CorelDRAW Graphics Suite 2019 Education Edition") Now it's easier to find the next panel with the same name uniquely and, well, name mappings are faster, neater and easier to manage your KWTs and scripts if layouts change
Although I'm not sure why you need to move from the link to the parallel node, I would probably look at the following pseudo code (assuming you have mapped the panel) I leave the translation of the code from jscript to the viewer...
var topPanel = Aliases...CorelDrawPanel //just for clarity of code. you could use the entire alias. Allocating to a var just shortens it
var findproperties = ["ObjectType","ObjectIdentifier"] //Guessing at identifiers - you will have to check
var findvalues = ["Link","0"]
var linkItem = topPanel.FindChild(findproperties,findvalues...);
if(linkItem.Exists){
Log.Message("Link Found");
}
else{
Log.Message("Link Not found");
}
//If you have no particular need for the link, you could rather map the bottom panel the same way
var secondPanel = Aliasses..SecondPanel
//If you haven't mapped it, find the panel with a standard find:
var secondPanel = topPanel.FindChild(["contentText","ObjectType"],["coreldraw..."],["Panel"],....);
//either way, you have the bottom tier panel by that name
I'm guessing the Select("LanguageSelection_1"); has contentText "spanish" and Select("LanguaghSelection_2") has contentText "English" etc, so search for the correct one
var selectProps = ["contentText","ObjectIdentifier"];
var selectVals = ["Spanish"],["LanguaghSelection_*"] //Note the wildcard in the objectidentifier so you will search all languages
var spanishSelect = secondPanel.FindChild(selectProps,selectVals,...)
if(spanishSelect.Exists){
Log.Message("Spanish is a language);
}
else{
Log.Message("Spanish isn't a language");
}
//Now on to the click:
//If you can click the select directly:
spanishSelect.Click();
//The more likely scenario, the onClick is linked to the panel, in which case:
spanishSelect.Parent.Click();