Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix byText() and withText() xpaths #24

Closed
asolntsev opened this issue Jun 20, 2013 · 1 comment
Closed

Fix byText() and withText() xpaths #24

asolntsev opened this issue Jun 20, 2013 · 1 comment

Comments

@asolntsev
Copy link
Member

By.xpath(".//*[contains(normalize-space(text()), "" + elementText + "")]")

По спецификации: http://www.w3.org/TR/xpath/#node-tests. text() - в действительности это не текст элемента, а функция, которая возвращает все текстовые ноды данного элемента. Т.е. в случае

div_text
имеется две текстовых ноды: //div/text()[1] == ' ', //div/text()[2] == ' div_text '; а //div[contains(text(),'div_text')] ==//div[contains(text()[1],' div_text ')] == NoSuchElement

@asolntsev
Copy link
Member Author

Done is Selenide 2.3

asolntsev added a commit that referenced this issue May 23, 2023
…ide-6.13.1

Bump versions.selenide from 6.13.0 to 6.13.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant