Movatterモバイル変換


[0]ホーム

URL:


Selenium WebDriver JavaScript API
Modules
selenium-webdriver/chrome
selenium-webdriver/chromium
selenium-webdriver/edge
selenium-webdriver/firefox
selenium-webdriver/ie
selenium-webdriver/safari
Classes
Actions
Alert
AlertPromise
ArgumentValue
BaseLogEntry
BaseParameters
BeforeRequestSent
BoxClipRectangle
Browser
BrowsingContext
BrowsingContextInfo
BrowsingContextInspector
BrowsingContextPartitionDescriptor
Build
Builder
By
BytesValue
Capabilities
CaptureScreenshotParameters
ChannelValue
ClientWindowInfo
ClipRectangle
Command
Command
Condition
ConsoleLogEntry
ContinueRequestParameters
ContinueResponseParameters
Cookie
CookieFilter
CreateContextParameters
Credential
DetachedShadowRootError
Device
DriverService
Builder
ElementClickInterceptedError
ElementClipRectangle
ElementNotInteractableError
ElementNotSelectableError
Entry
Environment
EvaluateResultException
EvaluateResultSuccess
ExceptionDetails
Executor
FetchError
FetchTimingInfo
FileDetector
FileDetector
GenericLogEntry
Header
HttpClient
HttpResponse
Index
Initiator
Input
InsecureCertificateError
InvalidArgumentError
InvalidCharacterError
InvalidCookieDomainError
InvalidCoordinatesError
InvalidElementStateError
InvalidSelectorError
JavascriptError
JavascriptLogEntry
Keyboard
Level
LocalValue
Locator
LogManager
Logger
Message
MoveTargetOutOfBoundsError
NavigateResult
NavigationInfo
Network
NetworkInspector
NoSuchAlertError
NoSuchCookieError
NoSuchElementError
NoSuchFrameError
NoSuchSessionError
NoSuchShadowRootError
NoSuchWindowError
PartialCookie
PartitionDescriptor
PartitionKey
Pointer
Preferences
PrintResult
ProvideResponseParameters
RealmInfo
ReferenceValue
RegExpValue
RelativeBy
RemoteValue
Request
RequestData
Response
ResponseData
ResponseStarted
Result
ScriptManager
ScriptTimeoutError
Select
SeleniumServer
SerializationOptions
Server
Session
SessionNotCreatedError
ShadowRoot
ShadowRootPromise
Source
StaleElementReferenceError
Storage
StorageKeyPartitionDescriptor
TimeoutError
UnableToCaptureScreenError
UnableToSetCookieError
UnexpectedAlertOpenError
UnknownCommandError
UnknownMethodError
UnsupportedOperationError
UrlPattern
VirtualAuthenticatorOptions
WebDriver
WebDriverError
WebElement
WebElementCondition
WebElementPromise
Wheel
WindowRealmInfo
Zip
thenableWebDriverProxy
Driver
Options
ServiceBuilder
Driver
Extensions
Options
ServiceBuilder
Driver
Options
ServiceBuilder
AddonFormatError
Channel
Driver
Options
ServiceBuilder
Driver
Options
ServiceBuilder
Driver
Options
ServiceBuilder
Interfaces
Action
Client
Config
Executor
ISelect
IWebDriver
ManualConfig
Options
Cookie
PacConfig
Options
ServiceOptions
SuiteOptions
TargetBrowser
ThenableWebDriver
Timeouts
Global
Atom
Browser
Button
ByHash
Capability
CommandLineFlag
CommandSpec
CommandTransformer
Config
ErrorCode
EvaluateResultType
INTERNAL_COMPUTE_OFFSET_SCRIPT
InterceptPhase
Key
ManualConfig
Name
NonPrimitiveType
Origin
Origin
PacConfig
PageLoadStrategy
Platform
PrimitiveType
Protocol
RealmType
RemoteReferenceType
RemoteType
RequestOptions
ResultOwnership
SameSite
SpecialNumberType
StdIoOptions
THENABLE_DRIVERS
Transport
Type
Type
Type
Type
USER_AGENT
UserPromptHandler
W3C_COMMAND_MAP
ableToSwitchToFrame
addConsoleHandler
alertIsPresent
arraysEqual
binaryPaths
buildPath
buildRequest
builtTargets
check
checkCodePoint
checkLegacyResponse
checkOptions
checkedCall
checkedNodeCall
color
consoleHandler
copy
copyDir
createDriver
delayed
direct
elementIsDisabled
elementIsEnabled
elementIsNotSelected
elementIsNotVisible
elementIsSelected
elementIsVisible
elementLocated
elementTextContains
elementTextIs
elementTextMatches
elementsLocated
encodeError
ensureFileDetectorsAreEnabled
escapeCss
exec
executeCommand
exists
extractId
filter
filterNonW3CCaps
findFreePort
findInPath
formatSpawnArgs
fromWireValue
fullyResolveKeys
fullyResolved
getAddress
getAvailableBrowsers
getBinary
getBinaryPaths
getBrowsersToTestFromEnv
getBrowsingContextInstance
getHostName
getIPAddress
getJavaPath
getLevel
getLogInspectorInstance
getLogger
getLoopbackAddress
getRequestOptions
getStatus
getTestHook
headersToString
ignore
init
installConsoleHandler
isErrorResponse
isFree
isId
isIdle
isObject
isPromise
isRetryableNetworkError
isSelenium3x
legacyTimeout
load
locate
locateWith
manual
map
mkdir
mkdirp
of
pac
pad
parseHttpResponse
path
projectRoot
read
removeConsoleHandler
requireAtom
resolveCommandLineFlags
resolveWaitMessage
rmDir
sendIndex
sendRequest
serialize
setFileDetector
shouldRetryRequest
socks
splitHostAndPort
stalenessOf
start
startSeleniumServer
stat
stop
suite
suite
system
thenFinally
throwDecodedError
titleContains
titleIs
titleMatches
tmpDir
tmpFile
toExecuteAtomCommand
toMap
toWireValue
tryParse
unlink
unzip
url
urlContains
urlIs
urlMatches
waitForServer
waitForUrl
walkDir
whereIs
withTagName
write
On this page

By

Describes a mechanism for locating an element on the page.

Constructor

new By(using, value)

Parameters:
NameTypeDescription
usingstring

the name of the location strategy to use.

valuestring

the value to search for.

Members

using :string

Type:
  • string

value :string

Type:
  • string

Methods

toString()

(static)className(name) → (non-null) {By}

Locates elements that have a specific class name.

Parameters:
NameTypeDescription
namestring

The class name to search for.

Returns:

The new locator.

Type: 
By

(static)css(selector) → (non-null) {By}

Locates elements using a CSS selector.

Parameters:
NameTypeDescription
selectorstring

The CSS selector to use.

Returns:

The new locator.

Type: 
By

(static)id(id) → (non-null) {By}

Locates elements by the ID attribute. This locator uses the CSS selector*[id="$ID"],notdocument.getElementById.

Parameters:
NameTypeDescription
idstring

The ID to search for.

Returns:

The new locator.

Type: 
By

(static)js(scriptnon-null, …var_args)

Locates elements by evaluating ascript that defines the body of a JavaScript function. The return value of this function must be an element or an array-like list of elements. When this locator returns a list of elements, but only one is expected, the first element in this list will be used as the single element value.

Parameters:
NameTypeAttributesDescription
scriptstring |function

The script to execute.

var_args*<repeatable>

The arguments to pass to the script.

Returns:

(static)linkText(text) → (non-null) {By}

Locates link elements whose visible text matches the given string.

Parameters:
NameTypeDescription
textstring

The link text to search for.

Returns:

The new locator.

Type: 
By

(static)name(name) → (non-null) {By}

Locates elements whosename attribute has the given value.

Parameters:
NameTypeDescription
namestring

The name attribute to search for.

Returns:

The new locator.

Type: 
By

(static)partialLinkText(text) → (non-null) {By}

Locates link elements whose visible text contains the given substring.

Parameters:
NameTypeDescription
textstring

The substring to check for in a link's visible text.

Returns:

The new locator.

Type: 
By

(static)tagName(name) → (non-null) {By}

Locates elements with a given tag name.

Parameters:
NameTypeDescription
namestring

The tag name to search for.

Returns:

The new locator.

Type: 
By

(static)xpath(xpath) → (non-null) {By}

Locates elements matching a XPath selector. Care should be taken when using an XPath selector with a webdriver.WebElement as WebDriver will respect the context in the specified in the selector. For example, given the selector//div, WebDriver will search from the document root regardless of whether the locator was used with a WebElement.

Parameters:
NameTypeDescription
xpathstring

The XPath selector to use.

Returns:

The new locator.

Type: 
By
Type anything to view search result
Selenium WebDriver JavaScript API
GitHub
npm
Modules
selenium-webdriver/chrome
selenium-webdriver/chromium
selenium-webdriver/edge
selenium-webdriver/firefox
selenium-webdriver/ie
selenium-webdriver/safari
Classes
Actions
Alert
AlertPromise
ArgumentValue
BaseLogEntry
BaseParameters
BeforeRequestSent
BoxClipRectangle
Browser
BrowsingContext
BrowsingContextInfo
BrowsingContextInspector
BrowsingContextPartitionDescriptor
Build
Builder
By
BytesValue
Capabilities
CaptureScreenshotParameters
ChannelValue
ClientWindowInfo
ClipRectangle
Command
Command
Condition
ConsoleLogEntry
ContinueRequestParameters
ContinueResponseParameters
Cookie
CookieFilter
CreateContextParameters
Credential
DetachedShadowRootError
Device
DriverService
Builder
ElementClickInterceptedError
ElementClipRectangle
ElementNotInteractableError
ElementNotSelectableError
Entry
Environment
EvaluateResultException
EvaluateResultSuccess
ExceptionDetails
Executor
FetchError
FetchTimingInfo
FileDetector
FileDetector
GenericLogEntry
Header
HttpClient
HttpResponse
Index
Initiator
Input
InsecureCertificateError
InvalidArgumentError
InvalidCharacterError
InvalidCookieDomainError
InvalidCoordinatesError
InvalidElementStateError
InvalidSelectorError
JavascriptError
JavascriptLogEntry
Keyboard
Level
LocalValue
Locator
LogManager
Logger
Message
MoveTargetOutOfBoundsError
NavigateResult
NavigationInfo
Network
NetworkInspector
NoSuchAlertError
NoSuchCookieError
NoSuchElementError
NoSuchFrameError
NoSuchSessionError
NoSuchShadowRootError
NoSuchWindowError
PartialCookie
PartitionDescriptor
PartitionKey
Pointer
Preferences
PrintResult
ProvideResponseParameters
RealmInfo
ReferenceValue
RegExpValue
RelativeBy
RemoteValue
Request
RequestData
Response
ResponseData
ResponseStarted
Result
ScriptManager
ScriptTimeoutError
Select
SeleniumServer
SerializationOptions
Server
Session
SessionNotCreatedError
ShadowRoot
ShadowRootPromise
Source
StaleElementReferenceError
Storage
StorageKeyPartitionDescriptor
TimeoutError
UnableToCaptureScreenError
UnableToSetCookieError
UnexpectedAlertOpenError
UnknownCommandError
UnknownMethodError
UnsupportedOperationError
UrlPattern
VirtualAuthenticatorOptions
WebDriver
WebDriverError
WebElement
WebElementCondition
WebElementPromise
Wheel
WindowRealmInfo
Zip
thenableWebDriverProxy
Driver
Options
ServiceBuilder
Driver
Extensions
Options
ServiceBuilder
Driver
Options
ServiceBuilder
AddonFormatError
Channel
Driver
Options
ServiceBuilder
Driver
Options
ServiceBuilder
Driver
Options
ServiceBuilder
Interfaces
Action
Client
Config
Executor
ISelect
IWebDriver
ManualConfig
Options
Cookie
PacConfig
Options
ServiceOptions
SuiteOptions
TargetBrowser
ThenableWebDriver
Timeouts
Global
Atom
Browser
Button
ByHash
Capability
CommandLineFlag
CommandSpec
CommandTransformer
Config
ErrorCode
EvaluateResultType
INTERNAL_COMPUTE_OFFSET_SCRIPT
InterceptPhase
Key
ManualConfig
Name
NonPrimitiveType
Origin
Origin
PacConfig
PageLoadStrategy
Platform
PrimitiveType
Protocol
RealmType
RemoteReferenceType
RemoteType
RequestOptions
ResultOwnership
SameSite
SpecialNumberType
StdIoOptions
THENABLE_DRIVERS
Transport
Type
Type
Type
Type
USER_AGENT
UserPromptHandler
W3C_COMMAND_MAP
ableToSwitchToFrame
addConsoleHandler
alertIsPresent
arraysEqual
binaryPaths
buildPath
buildRequest
builtTargets
check
checkCodePoint
checkLegacyResponse
checkOptions
checkedCall
checkedNodeCall
color
consoleHandler
copy
copyDir
createDriver
delayed
direct
elementIsDisabled
elementIsEnabled
elementIsNotSelected
elementIsNotVisible
elementIsSelected
elementIsVisible
elementLocated
elementTextContains
elementTextIs
elementTextMatches
elementsLocated
encodeError
ensureFileDetectorsAreEnabled
escapeCss
exec
executeCommand
exists
extractId
filter
filterNonW3CCaps
findFreePort
findInPath
formatSpawnArgs
fromWireValue
fullyResolveKeys
fullyResolved
getAddress
getAvailableBrowsers
getBinary
getBinaryPaths
getBrowsersToTestFromEnv
getBrowsingContextInstance
getHostName
getIPAddress
getJavaPath
getLevel
getLogInspectorInstance
getLogger
getLoopbackAddress
getRequestOptions
getStatus
getTestHook
headersToString
ignore
init
installConsoleHandler
isErrorResponse
isFree
isId
isIdle
isObject
isPromise
isRetryableNetworkError
isSelenium3x
legacyTimeout
load
locate
locateWith
manual
map
mkdir
mkdirp
of
pac
pad
parseHttpResponse
path
projectRoot
read
removeConsoleHandler
requireAtom
resolveCommandLineFlags
resolveWaitMessage
rmDir
sendIndex
sendRequest
serialize
setFileDetector
shouldRetryRequest
socks
splitHostAndPort
stalenessOf
start
startSeleniumServer
stat
stop
suite
suite
system
thenFinally
throwDecodedError
titleContains
titleIs
titleMatches
tmpDir
tmpFile
toExecuteAtomCommand
toMap
toWireValue
tryParse
unlink
unzip
url
urlContains
urlIs
urlMatches
waitForServer
waitForUrl
walkDir
whereIs
withTagName
write

[8]ページ先頭

©2009-2025 Movatter.jp