Skip to content

GetAttribute should return strings for native views #8

Closed
@hekra01

Description

@hekra01
  • With such qml:
Rectangle {
    id: button
    width: 20
}
  • And this test
wd.get("file:///home//user/qtwebdriver/b.qml")
elem = wd.find_element_by_xpath("//Rectangle")
v = elem.get_attribute("width")
  • observed server reply
[FINE]: QML executor for view(2a3f361496c2e10c8c32a97aec6768d0)
[FINE]: Command finished (/session/c453849c76f64f66d9d9f80ffe2cd82d/element/4c5dfaf8b1721bba90e3508342b1d4f4/attribute/width) with response {
   "sessionId": "c453849c76f64f66d9d9f80ffe2cd82d",
   "status": 0,
   "value": 20
}
  • expected server reply
[FINE]: QML executor for view(2a3f361496c2e10c8c32a97aec6768d0)
[FINE]: Command finished (/session/c453849c76f64f66d9d9f80ffe2cd82d/element/4c5dfaf8b1721bba90e3508342b1d4f4/attribute/width) with response {
   "sessionId": "c453849c76f64f66d9d9f80ffe2cd82d",
   "status": 0,
   "value": "20"
}

The value for the integer shoud be returned as a string, not an int as per W3C spec: https://w3c.github.io/webdriver/webdriver-spec.html#getelementattribute

However, note that from the spec values retrieved with executeScript will keep their type: https://w3c.github.io/webdriver/webdriver-spec.html#executescript

fixed in 0db4bd3

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions