Question
TCS
US
Last activity: 6 Nov 2018 20:02 EST
Unable to Interrogate the controls in the treeview
Unable to interrogate the controls individually( + symbol) instead It is interrogated as a Tree view control.How to Interrogate by clicking + symbol to go to embedded child control.Please find the attachment for reference.Could someone help.
Thanks!!
***Updated by moderator: Lochan to add SR details***
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
The TreeView can navigate by using the below JavaScript,
window.open(url, "RightFrame");
The Url can be found by parsing the HTML of the page. If the control's outerHtml is the <tvns:treeview .... > etc, like you wrote above, then you can use a C# script to quickly find the item and return the url. You would pass the text of item you want to navigate too and pass in the outerHTML as the input.
string item = "";
string pattern = "BOFrame[^\"]*\" [^>]*>\\s*<div\\s*[^>]*>[^<]*</div>";
Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
MatchCollection matches = rgx.Matches(input);
foreach (Match match in matches) {
if (match.Value.Contains(text)) {
item = match.Value;
break;
}
}
if (item.Equals("")) {
return "not found";
}
else {
return "\\" + item.Substring(0, item.IndexOf("\""));
}
Pegasystems Inc.
US
There are methods to expand nodes - ExpandNode, ExpandAll, ExpandNodeByText, ExpandNodeByRegex. Have you tried these?
TCS
US
Hi Vegam,
Not able to view the ExpandNode or related methods for the treeview. When interrogated,it shows only innerHtml as
"<tvns:treenode Expanded="False" ......................>
<tvns:treenode>.................</tvns:treenode>
<tvns:treenode>......................</tvns:treenode>
</tvns:treenode>"
How to navigate to the internal string "<tvns:treenode>" and create control at runtime? Please suggest.Thanks!!
Pegasystems Inc.
US
If the control is interrogated as a TreeView, then the control will have these methods available (ExpandNode, etc). Are you saying that you don't see these methods in the "Test Control Methods" dialogue box or you don't see them somewhere else?
TCS
US
Not available in Test Control Methods nor Object Explorer.All treeview inner nodes are shown as string in innerHtml.
Pegasystems Inc.
US
An SR was created by the customer for this Post. SR-B76375.
TCS
US
Yes Vegam.We created SR and team is looking into it.
Accepted Solution
Pegasystems Inc.
US
The TreeView can navigate by using the below JavaScript,
window.open(url, "RightFrame");
The Url can be found by parsing the HTML of the page. If the control's outerHtml is the <tvns:treeview .... > etc, like you wrote above, then you can use a C# script to quickly find the item and return the url. You would pass the text of item you want to navigate too and pass in the outerHTML as the input.
string item = "";
string pattern = "BOFrame[^\"]*\" [^>]*>\\s*<div\\s*[^>]*>[^<]*</div>";
Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
MatchCollection matches = rgx.Matches(input);
foreach (Match match in matches) {
if (match.Value.Contains(text)) {
item = match.Value;
break;
}
}
if (item.Equals("")) {
return "not found";
}
else {
return "\\" + item.Substring(0, item.IndexOf("\""));
}