0

I am trying to create a method the returns False when a specific label is not found. However, the method continues to return True and my test is failing.

    public bool DeliveredDisplayed()
            {
                Boolean labelDisplayed = session.FindElementByName("Delivered").Displayed;
                return labelDisplayed;
            }

    Assert.IsFalse(OrderHistory.DeliveredDisplayed(), "The order is still delivered");
  • Could you run the next code to check how many elements with the "Delivered" name when your label is visible: labels = session.FindElementsByName("Delivered"); Could post a screenshot of Inspector.exe with label control when lebel should not be found? – G. Victor Jul 25 '22 at 20:20

1 Answers1

0

Are You sure, this particular "FindElementByName" method did not have possibility to find another element with such a Name? We are using "Displayed" property and it is working fine. Maybe better is to use "AutomationId" or in case where You need to check for one particular item where on page there are bunch of others with name "Displayed", XPaths?

  • Yes I confirmed there is not another property with the name "Displayed". The property is in a data grid so there is no automationID. I believe this is why I am having the issue, but have not figured out how to resolve it yet. – andrew bartle Jul 08 '22 at 15:54