Skip to content

Inconsistent exception thrown by WaitForComponentProperty for non-existent property #1855

@andreion1ca

Description

@andreion1ca

Summary

When calling WaitForComponentProperty with a non-existent property name, the exception thrown is inconsistent between language bindings:

  • .NET and Java: Throws PropertyNotFoundException as expected.
  • Python: Throws WaitTimeOutException instead of PropertyNotFoundException.

Example code:

.NET:

try
{
    altElement.WaitForComponentProperty(componentName, unexistingPropertyName, propertyValue, assemblyName);
    Assert.Fail();
}
catch (PropertyNotFoundException exception)
{
    Assert.That(exception.Message, Is.EqualTo($"Property {unexistingPropertyName} not found"));
}

Python:

with pytest.raises(exceptions.WaitTimeOutException) as exception:
    alt_element.wait_for_component_property(
        component_name, unexisting_property_name, property_value, assembly_name, timeout=2)

assert "Property " + unexisting_property_name + " not found" in str(exception.value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions