You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of some client work, I was trying to locate an element by tag using the PageElement class within another Target instance using something akin to the below:
Rather than returning the first div within SomeOtherTarget, the first div closest to document root was being returned.
Had a look through the codebase and tracked down the issue to line 16 of the PageElement class private static final String BY_TAG = "xpath://{0}";
There is a missing . character before the //. Meaning that rather than locating the element from the current node, the element is being located from document root.
What did you expect to happen?
Expecting the first element with provided tag to be returned from within the element in which I am trying to located it in.
Serenity BDD version
4.1.20
JDK version
17
Execution environment
OS: Windows Browser: Chrome
How to reproduce the bug.
Try locating any element within another element by tag only using the withTag method of the PageElement class, where 1 or more elements with that tag exists outside of the node in which you are trying to locate the element in.
How can we make it happen?
Work on this myself and propose a PR (with Serenity BDD team guidance)
The text was updated successfully, but these errors were encountered:
What happened?
As part of some client work, I was trying to locate an element by tag using the PageElement class within another Target instance using something akin to the below:
PageElement.withTag("div").inside(SomeOtherTarget.withName("someName"));
Rather than returning the first div within SomeOtherTarget, the first div closest to document root was being returned.
Had a look through the codebase and tracked down the issue to line 16 of the PageElement class
private static final String BY_TAG = "xpath://{0}";
There is a missing . character before the //. Meaning that rather than locating the element from the current node, the element is being located from document root.
What did you expect to happen?
Expecting the first element with provided tag to be returned from within the element in which I am trying to located it in.
Serenity BDD version
4.1.20
JDK version
17
Execution environment
OS: Windows
Browser: Chrome
How to reproduce the bug.
Try locating any element within another element by tag only using the withTag method of the PageElement class, where 1 or more elements with that tag exists outside of the node in which you are trying to locate the element in.
How can we make it happen?
Work on this myself and propose a PR (with Serenity BDD team guidance)
The text was updated successfully, but these errors were encountered: