microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
513 stars 286 forks source link

[BUG] Cannot find ".//ul[contains(@id, \"tablist\")]" on the Account form #1321

Open asaris-lv opened 1 year ago

asaris-lv commented 1 year ago

Bug Report

Issues should only be created for items related to covered functionality.

Not covered functionality, feature requests, and questions should use the Feature Request or Question templates.

EasyRepro Version

UCI or Classic Web

Online or On Premise

Browser

Describe the bug
C# code (Class WebClient in Microsoft.Dynamics365.UIAutomation.Api.UCI; Function "internal BrowserCommandResult SelectTab") cannot find element ".//ul[contains(@id, \"tablist\")]" on the Account form using following code line:

tabList = dialogContainer.WaitUntilAvailable(By.XPath(AppElements.Xpath[AppReference.Entity.TabList]));

dialogContainer is not null !!!

Special formatting / display
N/A

Code to reproduce
internal BrowserCommandResult SelectTab(string tabName, string subTabName = "", int thinkTime = Constants.DefaultThinkTime) { ThinkTime(thinkTime);

        return this.Execute($"Select Tab", driver =>
        {
            IWebElement tabList;
            if (driver.HasElement(By.XPath(AppElements.Xpath[AppReference.Dialogs.DialogContext])))
            {
                var dialogContainer = driver.FindElement(By.XPath(AppElements.Xpath[AppReference.Dialogs.DialogContext]));
                // ERROR: ".//ul[contains(@id, \"tablist\")]" is not found on the Account form
                tabList = dialogContainer.WaitUntilAvailable(By.XPath(AppElements.Xpath[AppReference.Entity.TabList]));
            }
            else
            {
                tabList = driver.WaitUntilAvailable(By.XPath(AppElements.Xpath[AppReference.Entity.TabList]));
            }

            ClickTab(tabList, AppElements.Xpath[AppReference.Entity.Tab], tabName);

            //Click Sub Tab if provided
            if (!String.IsNullOrEmpty(subTabName))
            {
                ClickTab(tabList, AppElements.Xpath[AppReference.Entity.SubTab], subTabName);
            }

            driver.WaitForTransaction();
            return true;
        });
    }

Expected behavior
Following element should be found: