Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Xpath In WebDriver

Titus Fortner edited this pageDec 28, 2021 ·2 revisions

How XPath Works in WebDriver

At a high level, WebDriver uses a browser's native XPath capabilities wherever possible. On those browsers that don't have native XPath support, we have provided our own implementation. This can lead to some unexpected behaviour unless you are aware of the differences in the various xpath engines.

DriverTag and Attribute NamesAttribute ValuesNative XPath Support
HtmlUnitDriverLower-casedAs they appear in the HTMLYes
InternetExplorerDriverLower-casedAs they appear in the HTMLNo
FirefoxDriverCase insensitiveAs they appear in the HTMLYes

This is a little abstract, so for the following piece of HTML:

<input type="text" name="example" /><INPUT type="text" name="other" />

The following will happen:

XPath expressionNumber of Matches In
HtmlUnitDriverFirefoxDriverInternetExplorerDriver
//input1 ("example")22
//INPUT020

Matching Implicit Attributes

Sometimes HTML do not need attributes to be explicitly declared because they will default to known values. For example, the "input" tag does not require the "type" attribute because it defaults to "text". The rule of thumb when using xpath in WebDriver is that youshould not expect to be able to match against these implicit attributes.

Notice for Users

This wiki is not where you want to be!Visit the Wiki Home for more useful links

For Developers and Contributors

Getting Involved
Triaging Issues
Releasing Selenium

Binding Specific Information

Ruby Development
Python Bindings
Ruby Bindings
WebDriverJs

Being Processed

This content is being evaluated for where it belongs

Architectural Overview
Automation Atoms
HtmlUnitDriver
Lift Style API
LoadableComponent
Logging
PageFactory
RemoteWebDriver
Xpath In WebDriver

Archived

Moved toOfficial Documentation

Bot Style Tests
Buck
Continuous Integration
Crazy Fun Build
Design Patterns
Desired Capabilities
Developer Tips
Domain Driven Design
Firefox Driver
Firefox Driver Internals
Focus Stealing On Linux
Frequently Asked Questions
Google Summer Of Code
Grid Platforms
History
Internet Explorer Driver
InternetExplorerDriver Internals
Next Steps
PageObjects
RemoteWebDriverServer
Roadmap
Scaling WebDriver
SeIDE Release Notes
Selenium Emulation
Selenium Grid 4
Selenium Help
Shipping Selenium 3
The Team
TLC Meetings
Untrusted SSL Certificates
WebDriver For Mobile Browsers
Writing New Drivers

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp