Ejemplo n.º 1
0
        /// <summary>
        /// Returns the child widget identified by the specified <para>path</para>.
        /// </summary>
        /// <param name="parent">The parent widget.</param>
        /// <param name="path">The path string.</param>
        /// <param name="timeoutInSeconds">The number of seconds to wait for the widget (default is 5).</param>
        /// <returns>The child <see cref="IWidget"/> that matches the <para>path</para>.</returns>
        public IWidget FindChildWidget(IWidget parent, string path, int timeoutInSeconds = 5)
        {
            var key = parent.QxHash + "/" + path;

            return(Cache(key, () =>
            {
                var widgetBy = By.Qxh(By.Namespace(path));
                var widget = parent.WaitForWidget(widgetBy, timeoutInSeconds);
                return widget;
            }));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the widget identified by the specified <para>path</para>.
        /// </summary>
        /// <param name="path">The path string.</param>
        /// <param name="timeoutInSeconds">The number of seconds to wait for the widget (default is 5).</param>
        /// <returns>The <see cref="IWidget"/> that matches the <para>path</para>.</returns>
        public IWidget FindWidget(string path, int timeoutInSeconds = 5)
        {
            var key = "$/" + path;

            return(Cache(key, () =>
            {
                var widgetBy = By.Qxh(By.Namespace(path));
                var widget = FindWidget(widgetBy, timeoutInSeconds);
                return widget;
            }));
        }