Nightwatch logo of an owl 測試框架
指南
API
關於
部落格
Search 測試框架
GitHub 測試框架
Discord 測試框架
3.7.0
上一個版本 2.6.19
版本 1.7
版本 0.9
所有版本
指南
API
關於
部落格
Github
Discord
發行說明
(目前版本 3.7.0)
Api 頁面
browser
概觀
axeInject
axeRun
back
captureBrowserConsoleLogs
captureBrowserExceptions
debug
enablePerformanceMetrics
end
forward
frame
frameParent
getCurrentUrl
getLog
getLogTypes
getPerformanceMetrics
getTitle
init
isLogAvailable
navigateTo
pause
perform
quit
refresh
registerBasicAuth
saveScreenshot
saveSnapshot
screenshot
session
sessions
setDeviceDimensions
setGeolocation
status
submit
takeHeapSnapshot
timeouts
timeoutsAsyncScript
timeoutsImplicitWait
url
urlHash
useCss
useXpath
waitForElementNotPresent
waitForElementNotVisible
waitForElementPresent
waitForElementVisible
waitUntil
.alerts
accept
dismiss
getText
setText
.appium
getContext
getContexts
getCurrentActivity
getCurrentPackage
getGeolocation
getOrientation
hideKeyboard
isKeyboardShown
longPressKeyCode
pressKeyCode
setContext
setGeolocation
setOrientation
startActivity
.assert
概觀
attributeContains
attributeEquals
attributeMatches
cssProperty
domPropertyContains
domPropertyEquals
domPropertyMatches
elementsCount
elementPresent
hasClass
hasAttribute
hasDescendants
enabled
selected
textContains
textEquals
textMatches
titleContains
titleEquals
titleMatches
urlContains
urlEquals
urlMatches
valueContains
valueEquals
visible
.chrome
概觀
.cookies
delete
deleteAll
get
getAll
set
.document
injectScript
source
executeScript
executeAsyncScript
.element
概觀
尋找元素
find
findAll
findByAltText
findAllByAltText
findByPlaceholderText
findAllByPlaceholderText
findByRole
findAllByRole
findByLabelText
findByText
findAllByText
getFirstElementChild
getLastElementChild
getNextElementSibling
getPreviousElementSibling
getShadowRoot
元素互動
check
clear
click
dragAndDrop
sendKeys
setAttribute
setPassword
setProperty
setValue
submit
update
upload
submitForm
uncheck
updateValue
uploadFile
元素狀態
clearValue
elementActive
getAccessibleName
getAriaRole
getAttribute
getCssProperty
getProperty
getRect
getElementSize
getTagName
getText
getValue
getId
hasDescendants
isEnabled
isSelected
isVisible
isPresent
使用者動作
waitUntil
clickAndHold
doubleClick
rightClick
moveTo
Selenium Actions API
螢幕截圖
takeScreenshot
.expect
概觀
語言鏈
equal() / contain() / match()
startWith() / endWith()
.not
before() / after()
.cookie()
.element()
.a() / .an()
.active
.attribute(name)
.css(property)
.enabled
.present
.property(name)
.selected
.text
.value
.visible
.elements()
.count
.title()
.url()
.firefox
概觀
.network
captureRequests
mockResponse
setConditions
.window
close
fullscreen
getAllHandles
getHandle
getPosition
getRect
getSize
maximize
minimize
open
setPosition
setRect
setSize
switchTo
頁面對象
概觀
實例
指令
使用者動作
概觀
可用的動作
動作刻度
工作範例
程式化 API
使用程式化 API
.forward()
建議編輯
在瀏覽器歷史記錄中向前導覽,如果可能(相當於按下瀏覽器的「前進」按鈕)。
用法
參數
名稱
類型
描述
callback
可選
function
可選的回調函數,在命令完成時調用。
W3C WebDriver 規範
/#back