Closed ferpasri closed 8 months ago
The Widget.toString(Tag<?>... tags) implementation for Windows, WebDriver, and Android is not just printing the current widget Tags description but also the tree descendents Tags description.
Widget.toString(Tag<?>... tags)
https://github.com/TESTARtool/TESTAR_dev/blob/f9c7019ec2af8a41afdd21300ad1bba0c3d76877/webdriver/src/org/testar/monkey/alayer/webdriver/WdWidget.java#L248-L250
https://github.com/TESTARtool/TESTAR_dev/blob/f9c7019ec2af8a41afdd21300ad1bba0c3d76877/core/src/org/testar/monkey/Util.java#L397-L412
Solution Create a new function in the Util class
public static String widgetDesc(Widget widget, Tag<?>... tags) { Assert.notNull(widget, tags); StringBuilder sb = new StringBuilder(); for (Tag<?> t : tags) { sb.append(widget.get(t, null)).append(", "); } return sb.toString(); }
And use it by default in the Widget.toString(Tag<?>... tags) function.
@Override public String toString(Tag<?>... tags){ return Util.widgetDesc(this, tags); }
The
Widget.toString(Tag<?>... tags)
implementation for Windows, WebDriver, and Android is not just printing the current widget Tags description but also the tree descendents Tags description.https://github.com/TESTARtool/TESTAR_dev/blob/f9c7019ec2af8a41afdd21300ad1bba0c3d76877/webdriver/src/org/testar/monkey/alayer/webdriver/WdWidget.java#L248-L250
https://github.com/TESTARtool/TESTAR_dev/blob/f9c7019ec2af8a41afdd21300ad1bba0c3d76877/core/src/org/testar/monkey/Util.java#L397-L412
Solution Create a new function in the Util class
And use it by default in the
Widget.toString(Tag<?>... tags)
function.