mirror of
https://github.com/appium/appium.git
synced 2026-11-21 10:33:44 +08:00
Compare commits
169
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c2820242f | ||
|
|
e967b607d7 | ||
|
|
60acd1d3d8 | ||
|
|
dddd2c3051 | ||
|
|
66ee0e46fb | ||
|
|
cc531cf436 | ||
|
|
5f2e7685bb | ||
|
|
b09e3c57cd | ||
|
|
6a680adbf5 | ||
|
|
db41945811 | ||
|
|
9ed545596d | ||
|
|
e0cf688b50 | ||
|
|
aea41abf53 | ||
|
|
43100de428 | ||
|
|
8b37725d8f | ||
|
|
f915b6c320 | ||
|
|
4c753a134d | ||
|
|
a6a69d36d3 | ||
|
|
fa75288c5e | ||
|
|
76acef9339 | ||
|
|
353e9b11e3 | ||
|
|
f0d549c46c | ||
|
|
8d85580b22 | ||
|
|
815fd3e3ca | ||
|
|
01de9bfb7d | ||
|
|
522f3975e1 | ||
|
|
c7a88ebf37 | ||
|
|
88ea09a90f | ||
|
|
fff33c6666 | ||
|
|
f10fdf776b | ||
|
|
355d8630fb | ||
|
|
a9542ae474 | ||
|
|
7ea5b75bfd | ||
|
|
b995004d1a | ||
|
|
99ace58ff8 | ||
|
|
85371dd4e5 | ||
|
|
23abcdef70 | ||
|
|
76481a7494 | ||
|
|
17173e4dda | ||
|
|
6f74c79a4e | ||
|
|
c63c31155e | ||
|
|
d49b48984a | ||
|
|
2bc0a2e15a | ||
|
|
5d30656828 | ||
|
|
034f50cdb7 | ||
|
|
3c20d79238 | ||
|
|
011a1b7fd4 | ||
|
|
d9b8e2d2b9 | ||
|
|
f1e215880b | ||
|
|
11a484bed7 | ||
|
|
c65aaa9953 | ||
|
|
241d2b29aa | ||
|
|
1a21c6f3e7 | ||
|
|
f06e2f81cb | ||
|
|
94a89dafc5 | ||
|
|
615a2a40c5 | ||
|
|
e8a09d2ad8 | ||
|
|
d88ec034cd | ||
|
|
8f57e0492c | ||
|
|
253180c168 | ||
|
|
a7f59de487 | ||
|
|
d649360618 | ||
|
|
42eaf8ecda | ||
|
|
613752a609 | ||
|
|
6db1e00041 | ||
|
|
14110e50b0 | ||
|
|
08c86049c1 | ||
|
|
5f5f711184 | ||
|
|
f2f0e2cc05 | ||
|
|
68d0fa4ab7 | ||
|
|
4a6c92680c | ||
|
|
61e18086dc | ||
|
|
6f68dc9093 | ||
|
|
0dc96de9a9 | ||
|
|
868b7b67d4 | ||
|
|
e560924400 | ||
|
|
5fbd98ec29 | ||
|
|
96d130ad93 | ||
|
|
f986375024 | ||
|
|
e9dc5d6374 | ||
|
|
62413002a8 | ||
|
|
77945ddaf1 | ||
|
|
061d995735 | ||
|
|
596ece7f11 | ||
|
|
73e587fe3d | ||
|
|
01d2b8f1e4 | ||
|
|
607a1ecf81 | ||
|
|
e621c6fe87 | ||
|
|
c27ced0d1d | ||
|
|
7a3190e5e5 | ||
|
|
1ca4bc311c | ||
|
|
a85a35e87d | ||
|
|
43bb05cba0 | ||
|
|
28e9501374 | ||
|
|
eed26a25fc | ||
|
|
ecabd78fa1 | ||
|
|
e33b47f96b | ||
|
|
bbf849380d | ||
|
|
ac93158af5 | ||
|
|
2bec48ebc0 | ||
|
|
9173346c3c | ||
|
|
9396d6d3b0 | ||
|
|
359ef4ba89 | ||
|
|
ac2c78c822 | ||
|
|
59ab921d8e | ||
|
|
c051454e87 | ||
|
|
3c48508904 | ||
|
|
9509d19e1b | ||
|
|
7723622d57 | ||
|
|
eb5ce47b17 | ||
|
|
7df378f401 | ||
|
|
4dd2e2d47d | ||
|
|
dacc42ba0a | ||
|
|
2502f538ff | ||
|
|
3f38f5cd74 | ||
|
|
6891dd4eae | ||
|
|
4e8e334cbc | ||
|
|
3423e36689 | ||
|
|
14a9d98641 | ||
|
|
f79fafb816 | ||
|
|
443b0bdd03 | ||
|
|
80fbf957c8 | ||
|
|
0443c84ec0 | ||
|
|
a47fdb8e05 | ||
|
|
e2c8f09bb9 | ||
|
|
dc16d6970f | ||
|
|
abfe1243a1 | ||
|
|
9bbf6b72bf | ||
|
|
0fa9c9bd80 | ||
|
|
9a70a44c83 | ||
|
|
65e14685a8 | ||
|
|
29eeb28f86 | ||
|
|
ac412b8723 | ||
|
|
68740320d2 | ||
|
|
9dc6cd0019 | ||
|
|
81c8b9da0a | ||
|
|
726348c2d5 | ||
|
|
6c911debd7 | ||
|
|
8ccb436701 | ||
|
|
f522b64456 | ||
|
|
3180558086 | ||
|
|
9d07f6bc5e | ||
|
|
b234e2b56b | ||
|
|
b635641f24 | ||
|
|
6d720b1112 | ||
|
|
6ab17feb71 | ||
|
|
afa4837530 | ||
|
|
1ada93cf76 | ||
|
|
b32e28d36d | ||
|
|
119e21f067 | ||
|
|
6ba6faf6f5 | ||
|
|
422362a259 | ||
|
|
62bfe1566a | ||
|
|
8a9350b8e9 | ||
|
|
bf51d27137 | ||
|
|
de00df0afa | ||
|
|
c3a48181c8 | ||
|
|
77dc09af36 | ||
|
|
59af10a17c | ||
|
|
6e989bd89a | ||
|
|
557e71f766 | ||
|
|
63d94d03c6 | ||
|
|
8a0022c147 | ||
|
|
72ee77d139 | ||
|
|
70a01da4b2 | ||
|
|
1b705bcd24 | ||
|
|
574bd6cbfb | ||
|
|
9c00b86ce7 | ||
|
|
0c4da64aea |
@@ -23,6 +23,8 @@ targets:
|
||||
path: ./packages/appium
|
||||
- type: npm
|
||||
path: ./packages/base-driver
|
||||
- type: npm
|
||||
path: ./packages/eslint-config-appium-ts
|
||||
- type: npm
|
||||
path: ./packages/fake-driver
|
||||
- type: npm
|
||||
|
||||
@@ -16,11 +16,6 @@ inputs:
|
||||
required: false
|
||||
default: 'true'
|
||||
|
||||
socket-firewall:
|
||||
description: Whether to install dependencies through Socket Firewall
|
||||
required: false
|
||||
default: 'true'
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
@@ -30,7 +25,6 @@ runs:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: npm
|
||||
- name: SocketDev Security Check
|
||||
if: ${{ inputs.socket-firewall == 'true' }}
|
||||
uses: SocketDev/action@v1.3.2
|
||||
with:
|
||||
mode: firewall-free
|
||||
@@ -39,12 +33,6 @@ runs:
|
||||
run: |
|
||||
# Replace npm with sfw npm in the install command
|
||||
install_cmd="${{ inputs.install-command }}"
|
||||
|
||||
if [ "${{ inputs.socket-firewall }}" != "true" ]; then
|
||||
$install_cmd
|
||||
exit $?
|
||||
fi
|
||||
|
||||
sfw_install_cmd="${install_cmd//npm /sfw npm }"
|
||||
|
||||
# Socket Firewall can fail to reach its own backend (a transient
|
||||
@@ -84,7 +72,6 @@ runs:
|
||||
exit 1
|
||||
fi
|
||||
- name: Build packages
|
||||
# `npm ci` already builds through the root `prepare` script
|
||||
if: ${{ inputs.run-build == 'true' && !startsWith(inputs.install-command, 'npm ci') }}
|
||||
if: ${{ inputs.run-build == 'true' }}
|
||||
shell: bash
|
||||
run: npm run build
|
||||
|
||||
+5
-5
@@ -43,11 +43,6 @@ labels:
|
||||
matcher:
|
||||
files: ['packages/appium/**']
|
||||
|
||||
- label: '@appium/http-server'
|
||||
sync: true
|
||||
matcher:
|
||||
files: ['packages/http-server/**']
|
||||
|
||||
- label: '@appium/base-driver'
|
||||
sync: true
|
||||
matcher:
|
||||
@@ -73,6 +68,11 @@ labels:
|
||||
matcher:
|
||||
files: ['packages/driver-test-support/**']
|
||||
|
||||
- label: '@appium/eslint-config-appium-ts'
|
||||
sync: true
|
||||
matcher:
|
||||
files: ['packages/eslint-config-appium-ts/**']
|
||||
|
||||
- label: '@appium/oxc-config'
|
||||
sync: true
|
||||
matcher:
|
||||
|
||||
+24
-42
@@ -3,18 +3,15 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- appium4
|
||||
# this list of paths could potentially impact the build
|
||||
paths:
|
||||
- '**/tsconfig*.json'
|
||||
- 'packages/base-driver/test-fixtures/**/*'
|
||||
- 'packages/*/test/**'
|
||||
- 'packages/*/bin'
|
||||
- 'packages/**/*.js'
|
||||
- 'packages/**/*.mjs'
|
||||
- 'packages/**/*.cjs'
|
||||
- 'packages/**/*.ts'
|
||||
- 'packages/**/*.json'
|
||||
- 'packages/**/*.js'
|
||||
- 'package*.json'
|
||||
- 'lerna.json'
|
||||
- '.npmrc'
|
||||
@@ -26,17 +23,14 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- appium4
|
||||
paths:
|
||||
- '**/tsconfig*.json'
|
||||
- 'packages/base-driver/test-fixtures/**/*'
|
||||
- 'packages/*/test/**'
|
||||
- 'packages/*/bin'
|
||||
- 'packages/**/*.js'
|
||||
- 'packages/**/*.mjs'
|
||||
- 'packages/**/*.cjs'
|
||||
- 'packages/**/*.ts'
|
||||
- 'packages/**/*.json'
|
||||
- 'packages/**/*.js'
|
||||
- 'package*.json'
|
||||
- 'lerna.json'
|
||||
- '.npmrc'
|
||||
@@ -61,19 +55,15 @@ jobs:
|
||||
uses: appium/appium-workflows/.github/workflows/node-lts-matrix.yml@main
|
||||
|
||||
prepare_e2e_packages:
|
||||
needs:
|
||||
- prepare_matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.discover-packages.outputs.matrix }}
|
||||
packages: ${{ steps.discover-packages.outputs.packages }}
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- name: Discover packages with e2e tests
|
||||
id: discover-packages
|
||||
env:
|
||||
NODE_VERSIONS: ${{ needs.prepare_matrix.outputs.versions }}
|
||||
run: |
|
||||
targets='[]'
|
||||
packages=()
|
||||
for package_dir in packages/*/; do
|
||||
package_json="${package_dir}package.json"
|
||||
if [[ -f "$package_json" ]]; then
|
||||
@@ -93,26 +83,21 @@ jobs:
|
||||
# Use the directory path without packages/ prefix (remove trailing slash)
|
||||
package_name="${package_dir%/}"
|
||||
package_name="${package_name#packages/}"
|
||||
# Packages with a test:e2e:shards script print a JSON array of shard names
|
||||
shards='[""]'
|
||||
if node -e "process.exit(require('./$package_json').scripts?.['test:e2e:shards'] ? 0 : 1)"; then
|
||||
shards=$(cd "$package_dir" && npm run --silent test:e2e:shards)
|
||||
fi
|
||||
targets=$(jq -c --arg pkg "$package_name" --argjson shards "$shards" \
|
||||
'. + [$shards[] | {package_dir: $pkg, shard: ., name: (if . == "" then $pkg else "\($pkg) [\(.)]" end)}]' \
|
||||
<<< "$targets")
|
||||
packages+=("$package_name")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "Found e2e targets:"
|
||||
echo "$targets" | jq -r '.[].name' | sed 's/^/ - /'
|
||||
# All LTS versions of Node.js on Linux, the newest one on Windows
|
||||
matrix=$(jq -c --argjson versions "$NODE_VERSIONS" '
|
||||
[.[] as $target
|
||||
| ($versions[] | {os: "ubuntu-latest", "node-version": ., target: $target}),
|
||||
{os: "windows-latest", "node-version": ($versions | map(tostring | tonumber) | max), target: $target}]
|
||||
' <<< "$targets")
|
||||
echo "matrix=$matrix" >> $GITHUB_OUTPUT
|
||||
# Convert array to JSON array for GitHub Actions matrix
|
||||
if [[ ${#packages[@]} -eq 0 ]]; then
|
||||
echo "No packages with e2e tests found"
|
||||
packages_json="[]"
|
||||
else
|
||||
# Use jq to create a compact single-line JSON array
|
||||
packages_json=$(printf '%s\n' "${packages[@]}" | jq -R '.' | jq -s '.' | jq -c '.')
|
||||
fi
|
||||
echo "packages=$packages_json" >> $GITHUB_OUTPUT
|
||||
echo "Found packages with e2e tests:"
|
||||
echo "$packages_json" | jq -r '.[]' | sed 's/^/ - /'
|
||||
|
||||
test-smoke:
|
||||
needs:
|
||||
@@ -173,18 +158,16 @@ jobs:
|
||||
|
||||
test-e2e:
|
||||
needs:
|
||||
- prepare_matrix
|
||||
- prepare_e2e_packages
|
||||
name: E2E Tests - ${{ matrix.target.name }} (Node ${{ matrix.node-version }}, ${{ matrix.os }})
|
||||
name: E2E Tests - ${{ matrix.package_dir }} (Node ${{ matrix.node-version }})
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.prepare_e2e_packages.outputs.matrix) }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
|
||||
package_dir: ${{ fromJSON(needs.prepare_e2e_packages.outputs.packages) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- name: Setup, install and build
|
||||
@@ -193,12 +176,11 @@ jobs:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
install-command: npm ci --foreground-scripts
|
||||
run-build: 'true'
|
||||
socket-firewall: 'false'
|
||||
- name: Run E2E tests for ${{ matrix.target.name }}
|
||||
- name: Run E2E tests for ${{ matrix.package_dir }}
|
||||
run: |
|
||||
set -o pipefail
|
||||
cd "packages/${{ matrix.target.package_dir }}"
|
||||
npm run test:e2e -- ${{ matrix.target.shard }}
|
||||
cd "packages/${{ matrix.package_dir }}"
|
||||
npm run test:e2e
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
|
||||
@@ -10,7 +10,13 @@ permissions:
|
||||
|
||||
jobs:
|
||||
prepare_matrix:
|
||||
uses: appium/appium-workflows/.github/workflows/node-lts-matrix.yml@main
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
versions: ${{ steps.generate-matrix.outputs.lts }}
|
||||
steps:
|
||||
- name: Select all current LTS versions of Node.js
|
||||
id: generate-matrix
|
||||
uses: msimerson/node-lts-versions@v2.0.2
|
||||
|
||||
check:
|
||||
needs:
|
||||
|
||||
@@ -13,11 +13,11 @@ on:
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
allow_legacy_peer_deps:
|
||||
description: 'Beta branch only: pass --legacy-peer-deps to lerna''s internal npm calls, for when a dependent''s peerDependencies range still lags a just-bumped major (causes ERESOLVE otherwise). Leave off unless you hit that failure.'
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
bootstrap_packages:
|
||||
description: 'One-time beta-branch bootstrap only: comma-separated package names (e.g. @appium/base-driver,@appium/support) to force-bump to their next-major beta (premajor --preid beta), bypassing conventional-commit detection. Leave empty for a normal release.'
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -58,30 +58,41 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DRY_RUN: ${{ inputs.dry_run }}
|
||||
RECOVER_MISSING_ONLY: ${{ inputs.recover_missing_only }}
|
||||
ALLOW_LEGACY_PEER_DEPS: ${{ inputs.allow_legacy_peer_deps }}
|
||||
BOOTSTRAP_PACKAGES: ${{ inputs.bootstrap_packages }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# On the beta branch ($BETA_BRANCH), every release is a beta prerelease anchored at its
|
||||
# target major (see packages/semantic-release-config's "Next-major beta branches" docs
|
||||
# for the equivalent semantic-release behavior this mirrors).
|
||||
#
|
||||
# allow_legacy_peer_deps: independent next-major beta.0 bumps can briefly outrun a
|
||||
# dependent's committed peerDependencies range, aborting lerna's internal lockfile
|
||||
# refresh with ERESOLVE. Opt-in only - it masks a real (if temporary) peer mismatch.
|
||||
LEGACY_PEER_DEPS_FLAGS=""
|
||||
if [ "$ALLOW_LEGACY_PEER_DEPS" = "true" ]; then
|
||||
LEGACY_PEER_DEPS_FLAGS="--npm-client-args=--legacy-peer-deps"
|
||||
fi
|
||||
|
||||
BETA_FLAGS=""
|
||||
DIST_TAG_FLAGS=""
|
||||
NPM_TAG_FLAGS=""
|
||||
if [ "${{ github.ref_name }}" = "$BETA_BRANCH" ]; then
|
||||
BETA_FLAGS="--conventional-prerelease --preid beta $LEGACY_PEER_DEPS_FLAGS"
|
||||
BETA_FLAGS="--conventional-prerelease --preid beta"
|
||||
DIST_TAG_FLAGS="--dist-tag beta"
|
||||
# `npm publish` takes --tag; --dist-tag is lerna-only
|
||||
NPM_TAG_FLAGS="--tag beta"
|
||||
fi
|
||||
|
||||
# One-time bootstrap for packages just starting their beta train: force them
|
||||
# straight to <next-major>.0.0-beta.0 instead of waiting for/relying on a commit that
|
||||
# happens to be marked as breaking. Not part of the normal release flow below - this
|
||||
# exits early on its own.
|
||||
if [ -n "$BOOTSTRAP_PACKAGES" ]; then
|
||||
if [ "${{ github.ref_name }}" != "$BETA_BRANCH" ]; then
|
||||
echo "bootstrap_packages is only meaningful on the $BETA_BRANCH branch" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ "$RECOVER_MISSING_ONLY" = "true" ]; then
|
||||
echo "bootstrap_packages cannot be combined with recover_missing_only" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Bootstrapping ${BOOTSTRAP_PACKAGES} to their next-major beta (premajor --preid beta), bypassing conventional-commit detection"
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
printf "n\n" | npx lerna version premajor --preid beta --exact --no-git-tag-version --no-push --force-publish="$BOOTSTRAP_PACKAGES"
|
||||
else
|
||||
npx lerna publish premajor --preid beta --exact --force-publish="$BOOTSTRAP_PACKAGES" --dist-tag beta --yes
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Prints "<pkg_name>@<pkg_version>" to stdout for each non-private workspace package
|
||||
@@ -144,7 +155,7 @@ jobs:
|
||||
|
||||
echo "Publishing ${pkg_spec}"
|
||||
set +e
|
||||
(cd "$pkg_dir" && npm publish $NPM_TAG_FLAGS)
|
||||
(cd "$pkg_dir" && npm publish $DIST_TAG_FLAGS)
|
||||
publish_exit_code=$?
|
||||
set -e
|
||||
if [ $publish_exit_code -ne 0 ]; then
|
||||
@@ -183,7 +194,7 @@ jobs:
|
||||
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
echo "Running lerna publish in dry-run mode"
|
||||
printf "n\n" | npx lerna version --no-git-tag-version --no-push $BETA_FLAGS
|
||||
printf "n\n" | npx lerna version --exact --no-git-tag-version --no-push $BETA_FLAGS
|
||||
else
|
||||
echo "Running lerna publish for real"
|
||||
set +e
|
||||
|
||||
@@ -47,4 +47,4 @@ jobs:
|
||||
if [ "${{ github.ref_name }}" = "$BETA_BRANCH" ]; then
|
||||
BETA_FLAGS="--conventional-prerelease --preid beta"
|
||||
fi
|
||||
npx lerna version --yes $BETA_FLAGS
|
||||
npx lerna version --exact --yes $BETA_FLAGS
|
||||
|
||||
@@ -6,12 +6,14 @@ on:
|
||||
paths:
|
||||
- '.github/workflows/renovate.yml' # this file
|
||||
- '.renovaterc.json'
|
||||
- 'renovate/default.json'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/renovate.yml' # this file
|
||||
- '.renovaterc.json'
|
||||
- 'renovate/default.json'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -25,4 +27,4 @@ jobs:
|
||||
- name: Validate Renovate Config
|
||||
uses: rinchsan/renovate-config-validator@v0.2.1
|
||||
with:
|
||||
pattern: '.renovaterc.json'
|
||||
pattern: '{.renovaterc.json,renovate/default.json}'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# Do not disable package-lock. Disabling package-lock also disables npm-shrinkwrap
|
||||
package-lock=true
|
||||
save-exact=true
|
||||
foreground-scripts=true
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["github>appium/appium-workflows//renovate/default"],
|
||||
"extends": ["github>appium/appium//renovate/default"],
|
||||
"schedule": ["after 10pm", "before 5:00am"],
|
||||
"timezone": "America/Vancouver"
|
||||
}
|
||||
|
||||
@@ -149,6 +149,31 @@ a discretionary of special basis. Basically, this scheme is run at the project's
|
||||
not a public service. Making contributions to the project under this scheme does not obligate the
|
||||
project to pay you for such work, or otherwise compensate you in any way.
|
||||
|
||||
### Contributions Are Voluntary
|
||||
|
||||
Appium is a community-driven open source project, and all contributions to it are voluntary.
|
||||
Opening a pull request, or responding to review feedback, does not create a contract, a
|
||||
commission, a work-for-hire arrangement, or any other obligation on the part of the project, its
|
||||
Committers, the TC, or the OpenJS Foundation. In particular:
|
||||
|
||||
- The project does not hire contractors, assign paid tasks, or quote per-PR, per-task, or hourly
|
||||
rates. The "value tiers" above are an after-the-fact, discretionary gesture of appreciation, not
|
||||
a price list.
|
||||
- Compensation can't be requested, negotiated, or promised in advance, and it must not be made a
|
||||
condition for starting, continuing, or revising a contribution. A value tier is only assigned by a
|
||||
Committer after a change has been merged, and may be zero.
|
||||
- Review feedback, including requests to extend, rework, or re-scope a change, is a normal part of
|
||||
getting it merged and is never a reason to ask for additional payment.
|
||||
- Contributors are free to stop working on a change at any time. Maintainers may pick it up, or
|
||||
close it if it does not suit the project.
|
||||
- Contributions that appear to be primarily motivated by obtaining payouts (for example, bulk or
|
||||
low-effort changes, including AI-generated ones submitted without understanding or testing them)
|
||||
may be closed, and repeated abuse of the scheme may result in the contributor being excluded from
|
||||
it and from the project's spaces. Contributors are fully responsible for the content they submit,
|
||||
regardless of the tools used to produce it.
|
||||
|
||||
If you are not comfortable contributing on these terms, please do not contribute.
|
||||
|
||||
### Raising Issues Related to Governance
|
||||
|
||||
This governance model necessarily leaves many situations unspecified. If
|
||||
|
||||
@@ -133,7 +133,7 @@ appium plugin uninstall <plugin-name>
|
||||
## Server Command Line Interface
|
||||
|
||||
In order to start sending commands to the Appium server, it must be running on the URL and port
|
||||
where your client library expects it to listen. [Appium's command-line interface](http://appium.io/docs/en/latest/cli/server/)
|
||||
where your client library expects it to listen. [Appium's command-line interface](https://appium.io/docs/en/latest/reference/cli/)
|
||||
is used to launch and configure the server:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import appiumConfig from '@appium/eslint-config-appium-ts';
|
||||
import {defineConfig, globalIgnores} from 'eslint/config';
|
||||
|
||||
// Create a modified config subset for test support files:
|
||||
// Extract the test file related configs (Mocha plugin and custom rules),
|
||||
// then override their 'files' property (match by name — resilient to new config entries).
|
||||
const testFileConfigItems = appiumConfig.filter(
|
||||
(item) => typeof item?.name === 'string' && item.name.startsWith('Test Files'),
|
||||
);
|
||||
const testSupportFiles = ['packages/driver-test-support/lib/**', 'packages/plugin-test-support/lib/**'];
|
||||
const testSupportConfig = testFileConfigItems.map((item) => ({...item, files: testSupportFiles}));
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
name: 'Base Config',
|
||||
extends: [appiumConfig],
|
||||
},
|
||||
{
|
||||
name: 'Test Support',
|
||||
extends: [testSupportConfig],
|
||||
},
|
||||
{
|
||||
name: 'Consistent type-only imports (all packages)',
|
||||
files: ['**/*.{ts,tsx,mtsx}'],
|
||||
rules: {
|
||||
'@typescript-eslint/consistent-type-imports': [
|
||||
'error',
|
||||
{fixStyle: 'separate-type-imports', prefer: 'type-imports'},
|
||||
],
|
||||
},
|
||||
},
|
||||
globalIgnores([
|
||||
'**/build-fixtures/**',
|
||||
'packages/appium/docs/**/assets/**',
|
||||
'packages/appium/docs/**/js/**',
|
||||
'packages/appium/sample-code/**',
|
||||
]),
|
||||
]);
|
||||
+5
-1
@@ -2,6 +2,9 @@
|
||||
"$schema": "https://json.schemastore.org/lerna",
|
||||
"changelogPreset": "conventional-changelog-conventionalcommits",
|
||||
"command": {
|
||||
"add": {
|
||||
"exact": true
|
||||
},
|
||||
"publish": {
|
||||
"message": "chore: publish"
|
||||
},
|
||||
@@ -11,7 +14,8 @@
|
||||
"version": {
|
||||
"conventionalCommits": true,
|
||||
"createRelease": "github",
|
||||
"allowBranch": ["master", "appium4"]
|
||||
"allowBranch": ["master", "appium4"],
|
||||
"exact": true
|
||||
}
|
||||
},
|
||||
"ignoreChanges": ["**/test/**", "**/*.md"],
|
||||
|
||||
Generated
+6709
-3016
File diff suppressed because it is too large
Load Diff
+24
-11
@@ -37,7 +37,7 @@
|
||||
"clean": "run-s clean:distfiles clean:workspaces",
|
||||
"clean:dangerously": "run-s clean:workspaces clean:force",
|
||||
"clean:deps": "lerna clean --yes",
|
||||
"clean:distfiles": "node ./scripts/clean-distfiles.mjs && npx nx reset",
|
||||
"clean:distfiles": "npx rimraf --glob \"./packages/*/build\" \"./packages/*/**/.tsconfig.tsbuildinfo\"; npx nx reset",
|
||||
"clean:interactive": "git clean -d -x -i",
|
||||
"clean:force": "git clean -d -x -f",
|
||||
"clean:workspaces": "lerna run clean || true",
|
||||
@@ -49,6 +49,7 @@
|
||||
"docs:check-llmstxt": "npm run -w packages/appium check:docs:llmstxt",
|
||||
"docs:preview": "npm run -w packages/appium build:docs:preview",
|
||||
"docs:publish": "npm run -w packages/appium publish:docs",
|
||||
"doctor": "node ./scripts/doctor-stub.mjs",
|
||||
"install-docs-deps": "npm run -w packages/appium install-docs-deps",
|
||||
"format": "oxfmt -c oxfmt.config.mjs .",
|
||||
"format:check": "oxfmt -c oxfmt.config.mjs --check .",
|
||||
@@ -62,7 +63,7 @@
|
||||
"rebuild": "run-s clean build",
|
||||
"reinstall": "run-s clean clean:deps ci",
|
||||
"reinstall:angry": "npm run clean:dangerously && npm ci",
|
||||
"release": "lerna publish",
|
||||
"release": "lerna publish --exact",
|
||||
"stage-synced-pkgs": "git add -A packages/appium/README.md \"packages/*/package.json\"",
|
||||
"start": "appium",
|
||||
"sync-pkgs": "node ./scripts/sync-monorepo-packages.mjs",
|
||||
@@ -80,30 +81,42 @@
|
||||
"zip-and-upload": "run-s zip upload"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@appium/oxc-config": "2.0.0-beta.0",
|
||||
"@tsconfig/node22": "22.0.0",
|
||||
"@appium/oxc-config": "1.0.0",
|
||||
"@tsconfig/node20": "20.1.10",
|
||||
"@types/async-lock": "1.4.2",
|
||||
"@types/bluebird": "3.5.42",
|
||||
"@types/content-disposition": "0.5.9",
|
||||
"@types/express": "5.0.6",
|
||||
"@types/finalhandler": "1.2.4",
|
||||
"@types/jsftp": "2.1.5",
|
||||
"@types/json-schema": "7.0.15",
|
||||
"@types/klaw": "3.0.8",
|
||||
"@types/lockfile": "1.0.4",
|
||||
"@types/method-override": "3.0.0",
|
||||
"@types/mime-types": "3.0.1",
|
||||
"@types/morgan": "1.9.10",
|
||||
"@types/node": "24.19.2",
|
||||
"@types/picomatch": "4.0.3",
|
||||
"@types/plist": "3.0.5",
|
||||
"@types/pluralize": "0.0.33",
|
||||
"@types/semver": "7.8.0",
|
||||
"@types/serve-favicon": "2.5.7",
|
||||
"@types/shell-quote": "1.7.5",
|
||||
"@types/sinon": "22.0.2",
|
||||
"@types/sinon": "22.0.0",
|
||||
"@types/which": "3.0.4",
|
||||
"@types/ws": "8.18.1",
|
||||
"@types/ws": "8.18.2",
|
||||
"@types/yargs": "17.0.35",
|
||||
"asyncbox": "6.6.0",
|
||||
"axios": "1.20.0",
|
||||
"asyncbox": "6.5.0",
|
||||
"conventional-changelog-conventionalcommits": "9.3.1",
|
||||
"cpy-cli": "7.0.0",
|
||||
"cross-env": "10.1.0",
|
||||
"finalhandler": "2.1.1",
|
||||
"json-schema-to-typescript": "16.0.0",
|
||||
"lerna": "10.1.1",
|
||||
"mjpeg-consumer": "2.0.0",
|
||||
"mjpeg-server": "0.3.1",
|
||||
"npm-run-all2": "9.0.4",
|
||||
"rewiremock": "3.14.6",
|
||||
"rimraf": "6.1.3",
|
||||
"serve-static": "2.2.1",
|
||||
"sinon": "22.1.0",
|
||||
"teen_process": "4.2.1",
|
||||
"tsd": "0.33.0",
|
||||
@@ -121,7 +134,7 @@
|
||||
"http-cache-semantics": "4.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^22.22.2 || ^24.15.0 || >=26.0.0",
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
||||
"npm": ">=10"
|
||||
}
|
||||
}
|
||||
|
||||
+11
-264
@@ -3,284 +3,31 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [4.0.0-beta.8](https://github.com/appium/appium/compare/appium@4.0.0-beta.7...appium@4.0.0-beta.8) (2026-11-13)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **base-driver:** a command result shaped like {protocol, value} is no longer unwrapped. It is returned as the command value. {protocol, error} is still thrown when error is an Error and protocol is W3C or MJSONWP.
|
||||
* @appium/tsconfig now sets noImplicitOverride: true. Extensions extending this config must mark overriding members with override, otherwise tsc fails with TS4114.
|
||||
## [3.9.0](https://github.com/appium/appium/compare/appium@3.8.0...appium@3.9.0) (2026-10-27)
|
||||
|
||||
### Features
|
||||
|
||||
* **appium:** add flow control for BiDi event delivery ([#23146](https://github.com/appium/appium/issues/23146)) ([ba7dcbb](https://github.com/appium/appium/commit/ba7dcbbda0720303c119cb1b121465cc2a471e65))
|
||||
* enable noImplicitOverride in the shared tsconfig ([#23143](https://github.com/appium/appium/issues/23143)) ([ddc1d55](https://github.com/appium/appium/commit/ddc1d555dbf04d1cdd4dfd79139e48b1b077817b))
|
||||
* **support:** add port helpers to net ([#23156](https://github.com/appium/appium/issues/23156)) ([d5d90c5](https://github.com/appium/appium/commit/d5d90c5d9373eedb96525105c25069b85f13dcbc))
|
||||
* **appium:** fallback to latest compatible extension version for CLI `install` ([#23013](https://github.com/appium/appium/issues/23013)) ([3c20d79](https://github.com/appium/appium/commit/3c20d7923806bcc2333670e6cef5c24c6da60d62))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** align insecure feature logging with automationName scope ([#23122](https://github.com/appium/appium/issues/23122)) ([370a404](https://github.com/appium/appium/commit/370a40410c5de3b6a196fb6c1c0157db75794ecf))
|
||||
* **appium:** avoid overlapping CLI spinners ([#23125](https://github.com/appium/appium/issues/23125)) ([42b0317](https://github.com/appium/appium/commit/42b03172f2eeb4d787987623c6e2e3a8525b35d6))
|
||||
* **base-driver:** keep command results that contain a protocol field ([#23121](https://github.com/appium/appium/issues/23121)) ([bf7b97b](https://github.com/appium/appium/commit/bf7b97bd3605cab1c88d64732a89dc68b47520a2))
|
||||
* **appium:** backport bidi close code validation ([#22942](https://github.com/appium/appium/issues/22942)) ([14110e5](https://github.com/appium/appium/commit/14110e50b0bf3414c778e039acb7058a3c649e2e))
|
||||
* **appium:** prevent recursion when logging the first BiDi event of a method ([#22891](https://github.com/appium/appium/issues/22891)) ([77945dd](https://github.com/appium/appium/commit/77945ddaf10665f9457f6bdc94f9103a631f5ca4))
|
||||
* **base-driver:** track and remove BiDi subscriptions by ID ([#22895](https://github.com/appium/appium/issues/22895)) ([6241300](https://github.com/appium/appium/commit/62413002a83e70b14eb0a3979cd7a054757a0d80))
|
||||
* **support:** prevent zip extraction through symlink chains ([#23002](https://github.com/appium/appium/issues/23002)) ([#23069](https://github.com/appium/appium/issues/23069)) ([4c753a1](https://github.com/appium/appium/commit/4c753a134d8e172cfec4caec9033fe2a3d884e27))
|
||||
|
||||
|
||||
## [4.0.0-beta.7](https://github.com/appium/appium/compare/appium@4.0.0-beta.6...appium@4.0.0-beta.7) (2026-10-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** respect server compatibility in extension update and warn on non-npm install ([#23119](https://github.com/appium/appium/issues/23119)) ([80f69e3](https://github.com/appium/appium/commit/80f69e32d87172eaf838819845e8017517acbaf2))
|
||||
|
||||
|
||||
## [4.0.0-beta.6](https://github.com/appium/appium/compare/appium@4.0.0-beta.5...appium@4.0.0-beta.6) (2026-10-26)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **support:** ExtractAllOptions.useSystemUnzip is removed.
|
||||
* **support:** Non-UTF-8-flagged file names now default to utf8 instead of cp437, and cp437 decoding is no longer supported (modern archives use UTF-8). Such archives must be recreated or converted; fileNamesEncoding only accepts Node.js BufferEncodings.
|
||||
* **appium:** install local extensions without global npm links (#23086)
|
||||
* **base-driver:** preserve proxied command validation ordering (#23060)
|
||||
* **base-driver:** The protected BaseDriver#commandsQueueGuard beyond promise-based acquire(key, fn) - it is now an asyncbox AsyncLock, so callback-style acquire() and the internal queues field are gone (use getQueueLength() / isBusy()).
|
||||
* **base-driver:** validate every timeout capability candidate (#23062)
|
||||
* **appium:** removed the --callback-address (-ca) server argument and the server.callback-address config property
|
||||
* **appium:** removed the --callback-port (-cp) server argument and the server.callback-port config property
|
||||
* **appium:** removed the --debug-log-spacing server argument and the server.debug-log-spacing config property
|
||||
* **appium:** removed the --strict-caps server argument and the server.strict-caps config property
|
||||
* **appium:** removed the --trace-dir server argument and the server.trace-dir config property
|
||||
* **base-driver:** POST body has to be a JSON object, otherwise the server returns invalid argument error.
|
||||
## [3.8.0](https://github.com/appium/appium/compare/appium@3.7.0...appium@3.8.0) (2026-09-24)
|
||||
|
||||
### Features
|
||||
|
||||
* **support:** Remove system unzip from extractAllTo ([#23091](https://github.com/appium/appium/issues/23091)) ([0f1a761](https://github.com/appium/appium/commit/0f1a76184b78ee3d60652b9a610c808213196f7c))
|
||||
* **appium:** accept package names for installed extension commands ([#22747](https://github.com/appium/appium/issues/22747)) ([6c911de](https://github.com/appium/appium/commit/6c911debd72cb7fe094d27671d1cf14098ff537a))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** install local extensions without global npm links ([#23086](https://github.com/appium/appium/issues/23086)) ([3615d6d](https://github.com/appium/appium/commit/3615d6df4c5a785524092f8c28dc338385a4468a))
|
||||
* **appium:** preserve npm arguments on Windows ([#22957](https://github.com/appium/appium/issues/22957)) ([dd71f66](https://github.com/appium/appium/commit/dd71f66e4ac343bc48e78f5b661ca02b351553c1))
|
||||
* **appium:** remove unused server arguments ([#23063](https://github.com/appium/appium/issues/23063)) ([16c84ea](https://github.com/appium/appium/commit/16c84ea20314f605b93070de283818a78c0ed4bb))
|
||||
* **appium:** send log webhooks to ipv6 hosts ([#23061](https://github.com/appium/appium/issues/23061)) ([819905b](https://github.com/appium/appium/commit/819905beb265431446ec56776373ec15f13a0a8f))
|
||||
* **base-driver:** preserve proxied command validation ordering ([#23060](https://github.com/appium/appium/issues/23060)) ([6cc4095](https://github.com/appium/appium/commit/6cc4095c59bc7ce23b47ce768707aae978794824))
|
||||
* **base-driver:** reject command POST bodies that are not JSON objects ([#23007](https://github.com/appium/appium/issues/23007)) ([39e9512](https://github.com/appium/appium/commit/39e9512b4a4c936edae0d7a56bdd4bd613075322))
|
||||
* **base-driver:** use AsyncLock from asyncbox instead of async-lock ([#23066](https://github.com/appium/appium/issues/23066)) ([17421ae](https://github.com/appium/appium/commit/17421ae61fa9f9e74a52b116f3ed2ee3c09fbc1f))
|
||||
* **base-driver:** validate every timeout capability candidate ([#23062](https://github.com/appium/appium/issues/23062)) ([531f482](https://github.com/appium/appium/commit/531f482d8759e7c621276b212489b764a994766a))
|
||||
* **docs:** correct stale instructions in .NET quickstart ([#23049](https://github.com/appium/appium/issues/23049)) ([2dd05e1](https://github.com/appium/appium/commit/2dd05e12d3e5911203856977120813ce56b69552))
|
||||
* **docs:** X-Appium-Is-Sensitive also accepts the value 'yes' ([#23051](https://github.com/appium/appium/issues/23051)) ([2cf7f4e](https://github.com/appium/appium/commit/2cf7f4e6b21fdf36f85986187d5361d980f7cb42))
|
||||
* **support:** prevent zip extraction through symlink chains ([#23002](https://github.com/appium/appium/issues/23002)) ([8e42cbc](https://github.com/appium/appium/commit/8e42cbc82d95da690b73399782f750043464352d))
|
||||
|
||||
|
||||
## [4.0.0-beta.5](https://github.com/appium/appium/compare/appium@4.0.0-beta.4...appium@4.0.0-beta.5) (2026-10-18)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **base-driver:** match standard capability names case-sensitively (#22976)
|
||||
* **appium:** Drivers must use base-driver with shared command activity tracking. Custom timeout implementations must delegate timer creation to super.startNewCommandTimeout(); legacy private-counter implementations are no longer protected by method overrides.
|
||||
|
||||
* add fake driver/plugin example
|
||||
|
||||
* remove from readme
|
||||
|
||||
* fix(appium): release one proxied BiDi command per response
|
||||
|
||||
* test(appium): cover overlapping duplicate BiDi command IDs
|
||||
* **appium:** Drivers must use base-driver with shared command activity tracking. Custom timeout implementations must delegate timer creation to super.startNewCommandTimeout(); legacy private-counter implementations are no longer protected by method overrides.
|
||||
|
||||
* add fake driver/plugin example
|
||||
|
||||
* remove from readme
|
||||
|
||||
* Remove actions needed for driver updates in migration guide
|
||||
|
||||
Removed the section detailing actions needed for driver updates related to shared command activity tracking.
|
||||
|
||||
* refactor(base-driver): simplify shutdown promise handling
|
||||
|
||||
* Add actions needed for custom startNewCommandTimeout
|
||||
|
||||
Updated migration guide to include new requirements for custom command timeout implementations.
|
||||
* **types:** the locale, language, autoWebview, orientation and udid capabilities are no longer part of the standard capability constraints. They are not generic enough and must be defined by the corresponding drivers.
|
||||
* **types:** the deprecated appium:autoLaunch capability is no longer part of the standard capability constraints.
|
||||
|
||||
### Features
|
||||
|
||||
* **appium:** fallback to latest compatible extension version for CLI `install` ([#22951](https://github.com/appium/appium/issues/22951)) ([0b3fe1c](https://github.com/appium/appium/commit/0b3fe1ce35fd40eea8f91a3e8f9846ee03445276))
|
||||
* **types:** remove deprecated autoLaunch capability ([#22950](https://github.com/appium/appium/issues/22950)) ([8822cea](https://github.com/appium/appium/commit/8822ceaabb68a213a8244e4f955d8ee68221e329))
|
||||
* **types:** remove driver-specific capabilities from base constraints ([#22952](https://github.com/appium/appium/issues/22952)) ([cce0b58](https://github.com/appium/appium/commit/cce0b5814d94157caa6a25834a469277ad1a4dcc))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** apply default capabilities to every firstMatch candidate ([#22988](https://github.com/appium/appium/issues/22988)) ([f820e04](https://github.com/appium/appium/commit/f820e04000f138addab57917ef92d01071596f96))
|
||||
* **appium:** classify driver selection failures as session not created ([#22970](https://github.com/appium/appium/issues/22970)) ([9b1ddb8](https://github.com/appium/appium/commit/9b1ddb8bf6cb51ce93114b70c536d0db18b39bfa))
|
||||
* **appium:** suspend idle timeout during BiDi commands ([#22947](https://github.com/appium/appium/issues/22947)) ([3f82e6a](https://github.com/appium/appium/commit/3f82e6a1817de5acb6584b92c98bd156295060d3))
|
||||
* **appium:** track idle timeout across plugin commands ([#22946](https://github.com/appium/appium/issues/22946)) ([c10c413](https://github.com/appium/appium/commit/c10c41384cdb4276faaab1a908cf9f80a77464a5))
|
||||
* **base-driver:** match standard capability names case-sensitively ([#22976](https://github.com/appium/appium/issues/22976)) ([f3edfc5](https://github.com/appium/appium/commit/f3edfc5e03deb6821599614a35cf5ec5df03a3c3)), closes [#22966](https://github.com/appium/appium/issues/22966)
|
||||
* **base-driver:** preserve capability invalid argument errors ([#22977](https://github.com/appium/appium/issues/22977)) ([b452a5e](https://github.com/appium/appium/commit/b452a5eade468d6c20a62c89357f72f492441038)), closes [#22966](https://github.com/appium/appium/issues/22966)
|
||||
* **base-driver:** validate and merge all capability candidates ([#22982](https://github.com/appium/appium/issues/22982)) ([aba33a2](https://github.com/appium/appium/commit/aba33a2d17621e5db28e4505773c6603b075e7f2))
|
||||
* **base-driver:** validate standard timeouts and preserve null values ([#22961](https://github.com/appium/appium/issues/22961)) ([eef8246](https://github.com/appium/appium/commit/eef8246f8a6983c7818c99bfd94d5ae7ec8bfa1e))
|
||||
|
||||
|
||||
## [4.0.0-beta.4](https://github.com/appium/appium/compare/appium@4.0.0-beta.3...appium@4.0.0-beta.4) (2026-10-09)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **appium:** Replace the `windows` known-driver shortcut with `wincore` pointing to appium-wincore-driver instead of the obsolete appium-windows-driver
|
||||
|
||||
### Features
|
||||
|
||||
* **appium:** replace obsolete windows driver with appium-wincore-driver ([#22917](https://github.com/appium/appium/issues/22917)) ([7544a10](https://github.com/appium/appium/commit/7544a1008d96f44f19499500314b6ae21d54d4f2))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** prevent recursion when logging the first BiDi event of a method ([#22897](https://github.com/appium/appium/issues/22897)) ([e230727](https://github.com/appium/appium/commit/e230727090f24a3c777c88de9d43d83ff94ea97d))
|
||||
* centralize URL hostname formatting and bracket IPv6 hosts ([#22914](https://github.com/appium/appium/issues/22914)) ([c5ddcef](https://github.com/appium/appium/commit/c5ddcef8940dfa5fac8d180bed65dc80ba8fafab))
|
||||
* tune wincore driver integration ([#22922](https://github.com/appium/appium/issues/22922)) ([9f8455e](https://github.com/appium/appium/commit/9f8455e1973e97c8a6451a9291de741dadfed775))
|
||||
|
||||
|
||||
## [4.0.0-beta.3](https://github.com/appium/appium/compare/appium@4.0.0-beta.2...appium@4.0.0-beta.3) (2026-10-05)
|
||||
|
||||
### Features
|
||||
|
||||
* **universal-xml-plugin:** add execute methods to toggle translation ([#22862](https://github.com/appium/appium/issues/22862)) ([b95aaac](https://github.com/appium/appium/commit/b95aaac60bed065ce0a0d1e4f7baf9c5e60572b1)), closes [#21630](https://github.com/appium/appium/issues/21630)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** apply initial settings from selected capabilities ([#22882](https://github.com/appium/appium/issues/22882)) ([95c0461](https://github.com/appium/appium/commit/95c04611e7d1cd8acfa4c6ce51276899938588d3))
|
||||
* **appium:** bracket IPv6 hosts in BiDi websocket URLs ([#22872](https://github.com/appium/appium/issues/22872)) ([3875344](https://github.com/appium/appium/commit/3875344e111dc23e4c99310ad918b769dbb38927))
|
||||
* **appium:** close bidi sockets when a session ends unexpectedly ([#22854](https://github.com/appium/appium/issues/22854)) ([3cdc69b](https://github.com/appium/appium/commit/3cdc69b198e85607b4f35a5b3f57b542b0ae9b80))
|
||||
* **appium:** detect project homes with prerelease dependencies ([#22871](https://github.com/appium/appium/issues/22871)) ([11d9904](https://github.com/appium/appium/commit/11d9904166c9e692e6fa8491acfce4ac892c1a8e))
|
||||
* **appium:** do not crash when a proxied bidi socket closes without a sendable code ([#22835](https://github.com/appium/appium/issues/22835)) ([66ab396](https://github.com/appium/appium/commit/66ab396a71c419f1fb456b8a1ddf23bc3491baf8))
|
||||
* **appium:** explain manual recovery after manifest lock timeouts ([#22875](https://github.com/appium/appium/issues/22875)) ([b9c020c](https://github.com/appium/appium/commit/b9c020c6ebf88643ffe6b6d5e302b43673bbb028))
|
||||
* **appium:** import extensions through escaped file URLs ([#22884](https://github.com/appium/appium/issues/22884)) ([8312252](https://github.com/appium/appium/commit/83122525db72f2d6ff06e27cd3da5269318be3a8))
|
||||
* **appium:** match global and module BiDi event subscriptions ([#22883](https://github.com/appium/appium/issues/22883)) ([879873b](https://github.com/appium/appium/commit/879873bad5669c9b264f3fcb60d05562f6ca3b1e))
|
||||
* **appium:** resolve default extension export conditions ([#22885](https://github.com/appium/appium/issues/22885)) ([3188c9f](https://github.com/appium/appium/commit/3188c9fbab17c16192a6e75ff62f69f4d844be8f))
|
||||
* **appium:** roll back sessions when initialization fails ([#22873](https://github.com/appium/appium/issues/22873)) ([f24e704](https://github.com/appium/appium/commit/f24e7046eb2815822f655a644aee9786d90fd4e8))
|
||||
* **appium:** start idle timeout after session initialization ([#22881](https://github.com/appium/appium/issues/22881)) ([e37f1c1](https://github.com/appium/appium/commit/e37f1c158394617bcaa474da25f1650b9b24ebd1))
|
||||
* **base-driver:** track and remove BiDi subscriptions by ID ([#22876](https://github.com/appium/appium/issues/22876)) ([b791915](https://github.com/appium/appium/commit/b791915ffcf322e1cc84dbde606be55d34f020b3))
|
||||
* use native ESM entrypoint detection ([#22868](https://github.com/appium/appium/issues/22868)) ([e391bb2](https://github.com/appium/appium/commit/e391bb249fec5f700a6d63a747ff921a80689fb5))
|
||||
|
||||
|
||||
## [4.0.0-beta.2](https://github.com/appium/appium/compare/appium@4.0.0-beta.1...appium@4.0.0-beta.2) (2026-09-27)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **base-driver:** @appium/base-driver no longer exports server, normalizeBasePath, configureServer, ServerOpts, ConfigureServerOpts, ConfigureHttpOpts, or StartServerOpts, and no longer depends on express/morgan/body-parser/ method-override/path-to-regexp. Use the new @appium/http-server package instead.
|
||||
* **base-driver:** appium/driver.js and driver.d.ts no longer re-export server/normalizeBasePath/configureServer/ServerOpts (or their types), and no longer use a blanket export *. Import from @appium/http-server directly if you were relying on this undocumented path.
|
||||
|
||||
### Features
|
||||
|
||||
* **appium:** accept package names for installed extension commands ([#22747](https://github.com/appium/appium/issues/22747)) ([#22812](https://github.com/appium/appium/issues/22812)) ([b7356ee](https://github.com/appium/appium/commit/b7356ee53eec3e322707eef0d2bd37976a47cfd2))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **appium:** release the manifest lock before errAndQuit exits ([#22821](https://github.com/appium/appium/issues/22821)) ([dc0568b](https://github.com/appium/appium/commit/dc0568bc658961f5d6a28fb955d8092d51cf9523))
|
||||
* **base-driver:** carry proxy req via AsyncLocalStorage instead of args ([#22799](https://github.com/appium/appium/issues/22799)) ([2596da0](https://github.com/appium/appium/commit/2596da02d201d7e5fbfd24cf9dd2801302f8abc7))
|
||||
* **support:** narrow fs.glob overload for default withFileTypes/lazy ([#22795](https://github.com/appium/appium/issues/22795)) ([09a04f4](https://github.com/appium/appium/commit/09a04f48831e17b9b7f3b8dc0a72f0df5096ae51))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **base-driver:** extract the HTTP/Express server into @appium/http-server ([#22800](https://github.com/appium/appium/issues/22800)) ([225a1c6](https://github.com/appium/appium/commit/225a1c6d9d24fa2696699d4b61436a49b847d666))
|
||||
|
||||
|
||||
## [4.0.0-beta.1](https://github.com/appium/appium/compare/appium@4.0.0-beta.0...appium@4.0.0-beta.1) (2026-09-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** catch up peerDependencies to published beta.0; drop bootstrap_packages ([#22793](https://github.com/appium/appium/issues/22793)) ([b09efc3](https://github.com/appium/appium/commit/b09efc31c6967bbcf2c4314db9d2a0b6454fa8fb))
|
||||
|
||||
|
||||
## [4.0.0-beta.0](https://github.com/appium/appium/compare/appium@3.7.0...appium@4.0.0-beta.0) (2026-09-19)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **base-driver:** align timeouts endpoints closer to W3C standard (#22776)
|
||||
* users relying on the implicit debug default for console/file logs will now see info-level output unless they explicitly pass --log-level debug.
|
||||
* **support:** Any script or tool that consumes Appium CLI output (driver/plugin list/install/update, doctor, etc.) and relies on the previous stream layout will need to be updated. Previously, non-JSON human-readable output (info/success/warning messages) was written to STDERR, with STDOUT reserved almost exclusively for --json output. Now that output goes to STDOUT, and only actual errors go to STDERR.
|
||||
* **support:** Scripts that discarded STDOUT (1>/dev/null) to suppress "chatter" while relying on STDERR for status text will now see that text on STDOUT instead.
|
||||
* **support:** Scripts that captured STDERR to detect/log informational or success messages will no longer see them there — only genuine errors will appear on STDERR. --json output and error behavior are unaffected: --json continues to write clean JSON to STDOUT only, and errors continue to go to STDERR.
|
||||
* **support:** @appium/logger's Log class changes its default output stream from STDERR to STDOUT for all levels except error, and adds an errorStream/stderrLevel pair of properties. Any code that set .stream on a Log instance expecting it to capture all levels (including error) will now need to also set .errorStream to the same target.
|
||||
* **base-driver:** @appium/base-driver's default export (BaseDriver) and @appium/base-driver's basedriver/helpers.js default export are removed; use the named exports instead. The appium/driver.js and driver.d.ts re-exports of the default are removed accordingly.
|
||||
* **base-driver:** BaseDriver.reset() is removed; it was unused, not part of any protocol route or the Driver interface, and had no callers in this monorepo or any driver package that was checked.
|
||||
* **base-driver:** BaseDriver's constructor is removed in favor of inherited DriverCore construction; opts is no longer a required constructor argument (it now defaults to {}, matching DriverCore).
|
||||
* **support:** @appium/support's fs.glob option shape changed from the glob package's GlobOptions to a smaller, @appium/support-owned GlobOptions interface. Supported fields: cwd, withFileTypes, absolute, lazy. Options like nodir/ignore/nocase are no longer supported directly — callers needing directory filtering can pass withFileTypes: true and filter on .isFile()/.isDirectory(); callers needing path exclusion can filter the returned array by pattern.
|
||||
* **appium:** The --allow-cors CLI flag and allow-cors config file property have been removed. Use --allow-insecure=*:cors (or --relaxed-security, optionally overridden with --deny-insecure=*:cors) instead.
|
||||
* **base-driver:** ISessionHandler.createSession (@appium/types) and LegacyCreateSessionArgs — overload and type deleted, single-argument signature only.
|
||||
* **base-driver:** BaseDriver.createSession and AppiumDriver.createSession — collapsed to the single-argument mplementation; capability validation now checks the one argument directly instead of scanning three positions for the first W3C-shaped value.
|
||||
* **base-driver:** FakeDriver.createSession (and the base-driver e2e test double) — overrides updated to match.
|
||||
* **base-driver:** RelaxedCapsPlugin.createSession — this plugin existed specifically to normalize capabilities across the (now-gone) three positions; its hook is simplified to a single caps argument.
|
||||
* **base-driver:** POST /session wire route (w3c.ts) — payloadParams.optional no longer sends capabilities three times into the command args.
|
||||
* **base-driver:** BaseDriver.getSession, ISessionHandler.getSession, and the GET /session/:sessionId JSONWP route are gone. Use getAppiumSessionCapabilities to retrieve session capabilities and EventCommands.getLogEvents to retrieve event history instead.
|
||||
* **base-driver:** The appium:eventTimings capability is removed; it only ever controlled whether getSession's response was decorated with event history, which getLogEvents already exposes unconditionally.
|
||||
* **support:** move npm-related helpers into appium package (#22721)
|
||||
* **logger:** @appium/logger and @appium/support no longer export a default log — import the named log export instead.
|
||||
* **logger:** AppiumLogger#errorAndThrow has been removed; use errorWithException instead.
|
||||
* **logger:** Logger#enableProgress, disableProgress, progressEnabled, enableUnicode, disableUnicode have been removed; they were already permanently disabled no-ops.
|
||||
* **base-plugin:** Plugin#logger has been removed; use Plugin#log instead.
|
||||
* **base-plugin:** @appium/base-plugin no longer exports BasePlugin as the default export; use the named BasePlugin export.
|
||||
* Core.driverData, DriverData, and the driverData parameter on ISessionHandler.createSession/deleteSession are gone. Any driver overriding get driverData() or relying on the umbrella driver passing sibling-session data into createSession/deleteSession needs to migrate off this mechanism.
|
||||
* FakeDriver no longer supports the uniqueApp capability.
|
||||
* **support:** npm.installPackage now takes a hasAppiumDependency boolean computed by the caller instead of importing the check itself, avoiding a support -> appium dependency.
|
||||
* **support:** The env export is removed from @appium/support.
|
||||
* the minimum supported Node.js engine is set to ^22.22.2 || ^24.15.0 || >=26.0.0
|
||||
* **base-driver:** @appium/base-driver no longer exports statusCodes or getSummaryByCode (the jsonwp-status module was removed).
|
||||
* **base-driver:** errorFromMJSONWPStatusCode (aliased as errorFromCode) has been removed; use errorFromW3CJsonCode for W3C error-signature mapping.
|
||||
* **base-driver:** ProtocolError instances no longer have a jsonwpCode property.
|
||||
* **base-driver:** WebDriverProxy (formerly JWProxy) no longer proxies to or interprets responses from downstream servers speaking the legacy MJSONWP protocol; the ProtocolConverter class, COMMAND_URLS_CONFLICTS, and the downstreamProtocol getter/setter have been removed. Downstream automation servers must speak W3C WebDriver.
|
||||
* **base-driver:** Responses no longer duplicate element references under the legacy ELEMENT key; only the W3C element-6066-11e4-a52e-4f735466cecf key is present. The MJSONWP_ELEMENT_KEY constant has been removed.
|
||||
* **base-driver:** determineProtocol has been removed, and drivers can no longer produce the legacy {sessionId, status, value} response shape; all responses are now W3C-shaped regardless of how the client formatted its createSession capabilities.
|
||||
* **base-driver:** DriverCore#setProtocolMJSONWP() has been removed.
|
||||
* **base-driver:** The deprecated JWProxy export has been removed; use WebDriverProxy instead. Its source also moved from lib/jsonwp-proxy/proxy.js to lib/wd-proxy/proxy.js.
|
||||
* **base-driver:** DriverCore#isMjsonwpProtocol() has been removed.
|
||||
* **support:** The following @appium/support exports have been removed: process (getProcessIds, killProcess), mkdirp, imageUtil (requireSharp, cropBase64Image), mjpeg (MJpegStream), net's FTP upload
|
||||
support (FtpUploadOptions, NotHttpUploadOptions; uploadFile only supports http/https now), util's uuidV1/uuidV3/uuidV5/localIp/cancellableDelay/multiResolve, and fs's readPackageJsonFrom/findRoot/ F_OK/R_OK/W_OK/X_OK.
|
||||
* **appium:** The --nodeconfig server argument and the server.nodeconfig config file property no longer exist. Users who need to register with a Selenium Grid should use the Grid 4 relay feature instead (see the Grid guide).
|
||||
* **base-driver:** TLS-enabled Appium servers no longer negotiate SPDY/HTTP2 (spdy/2, spdy/3, spdy/3.1, h2) via ALPN; connections are now served as plain HTTPS (HTTP/1.1) using Node's native https module. Clients relying on SPDY or HTTP/2 multiplexing against Appium's TLS listener must switch to HTTP/1.1.
|
||||
* **appium:** `npm install -g appium --drivers=... --plugins=...` no longer installs extensions automatically. Use `appium driver/plugin install` or add extensions to package.json instead.
|
||||
* require('@appium/support') no longer works; consumers must import it instead.
|
||||
* require('@appium/base-driver') no longer works; drivers extending BaseDriver via require must switch to import.
|
||||
* require('@appium/base-plugin') no longer works; plugins extending BasePlugin via require must switch to import.
|
||||
* require('appium') no longer works; plugins extending the package via require must switch to import.
|
||||
* require('@appium/fake-plugin') no longer works; consumers must import it instead.
|
||||
* require('@appium/fake-driver') no longer works; consumers must import it instead.
|
||||
* require('@appium/types') no longer works; consumers must import it instead.
|
||||
* require('@appium/logger') no longer works; consumers must import it instead.
|
||||
* require('@appium/schema') no longer works; consumers must import it instead.
|
||||
|
||||
### Features
|
||||
|
||||
* **appium:** add --app-url-rules server arg to restrict remote app URLs ([#22753](https://github.com/appium/appium/issues/22753)) ([0b104f6](https://github.com/appium/appium/commit/0b104f6bf9b7180b111df40fd6a15b26d649eabd))
|
||||
* **appium:** remove postinstall autoinstall-extensions script ([#22675](https://github.com/appium/appium/issues/22675)) ([cd0d8f1](https://github.com/appium/appium/commit/cd0d8f14e9d5906ecd1b438038a7f67f74f742fc))
|
||||
* **appium:** remove Selenium Grid 3 support ([#22677](https://github.com/appium/appium/issues/22677)) ([8fcdcb3](https://github.com/appium/appium/commit/8fcdcb30b07c1ee582256fbef3538d6a3ceea5f2))
|
||||
* **appium:** replace --allow-cors flag with --allow-insecure=*:cors ([#22731](https://github.com/appium/appium/issues/22731)) ([926a0a5](https://github.com/appium/appium/commit/926a0a594935a6cf2e7375eb174eeb15af964f12))
|
||||
* **appium:** validate extension manifests and extensions.yaml via ajv ([#22732](https://github.com/appium/appium/issues/22732)) ([8840f9f](https://github.com/appium/appium/commit/8840f9f9322b63bc8940c390b8230f1e5306fa62))
|
||||
* backport diff from master ([#22749](https://github.com/appium/appium/issues/22749)) ([6323df1](https://github.com/appium/appium/commit/6323df1d7354f85cc631508f5cb6a3e35270d4bd))
|
||||
* **base-driver:** add definitions for all WebDriver BiDi commands ([#22770](https://github.com/appium/appium/issues/22770)) ([ac01aa8](https://github.com/appium/appium/commit/ac01aa83ad73982eea48f856dfc0249b4a26e395))
|
||||
* **base-driver:** align timeouts endpoints closer to W3C standard ([#22776](https://github.com/appium/appium/issues/22776)) ([93115d1](https://github.com/appium/appium/commit/93115d195773b011306ffb2e6d7d6cc935df0148))
|
||||
* **base-driver:** remove legacy (M)JSONWP protocol support ([#22681](https://github.com/appium/appium/issues/22681)) ([0b83e77](https://github.com/appium/appium/commit/0b83e77e7a1c24a885d9895a99db30281cf4acea))
|
||||
* **base-driver:** replace spdy with native https transport ([#22676](https://github.com/appium/appium/issues/22676)) ([ec7de47](https://github.com/appium/appium/commit/ec7de4768fdd8dde9d28db6fc2dfd63be45fd4c6))
|
||||
* bump minimum supported Node.js engine to ^22.22.2 || ^24.15.0 || >=26.0.0 ([#22685](https://github.com/appium/appium/issues/22685)) ([9f4a11e](https://github.com/appium/appium/commit/9f4a11e7190290986d01743557e90e6e44f87638))
|
||||
* Change the default log level to `info` ([#22756](https://github.com/appium/appium/issues/22756)) ([5e644a3](https://github.com/appium/appium/commit/5e644a392fbf11e2ca985408853d7f51aa85be17))
|
||||
* convert remaining monorepo packages to ESM-only ([#22674](https://github.com/appium/appium/issues/22674)) ([3516e50](https://github.com/appium/appium/commit/3516e50ce6d022f4c0dc539071c593bf2983325f))
|
||||
* **support:** move env/APPIUM_HOME resolution into appium package ([#22708](https://github.com/appium/appium/issues/22708)) ([8db8e57](https://github.com/appium/appium/commit/8db8e5748e26a7150cacbea09ba3ec52c5ce3fc0))
|
||||
* **support:** remove deprecated APIs ([#22678](https://github.com/appium/appium/issues/22678)) ([e8ee716](https://github.com/appium/appium/commit/e8ee71685b4c21116e61c88fd8d2f0e39fac2edb))
|
||||
* **types:** check execute method params against the command signature ([#22754](https://github.com/appium/appium/issues/22754)) ([b25fc20](https://github.com/appium/appium/commit/b25fc20c51a191c33695c1c71fbf129de834b52d))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address code review cleanups (plist, env memoize, test reuse) ([#22740](https://github.com/appium/appium/issues/22740)) ([0df8834](https://github.com/appium/appium/commit/0df883463812d57d44a0d6d80e9b88f124361934))
|
||||
* Address several TODOs ([#22762](https://github.com/appium/appium/issues/22762)) ([d6ef7e3](https://github.com/appium/appium/commit/d6ef7e3f1240f161df622c850aea06637f9d1078))
|
||||
* adjust deprecated JSONWP/MJSONWP routes ([#22763](https://github.com/appium/appium/issues/22763)) ([b129cbb](https://github.com/appium/appium/commit/b129cbbcd55656ae7f33b80b4b52719eb5179509))
|
||||
* **appium:** lock the extension manifest while driver/plugin commands run ([#22767](https://github.com/appium/appium/issues/22767)) ([a73644f](https://github.com/appium/appium/commit/a73644fb4f4e7b0363117ac1262d7018094b42ff))
|
||||
* **base-driver:** clean up aborted session creation ([#22733](https://github.com/appium/appium/issues/22733)) ([33d866e](https://github.com/appium/appium/commit/33d866e57506e1546aa4870dde75f7209be107bc))
|
||||
* declare dependencies that were only resolving via hoisting ([#22758](https://github.com/appium/appium/issues/22758)) ([bcf1c57](https://github.com/appium/appium/commit/bcf1c579997b8dbb8292b1a77583aeef40b11ba4))
|
||||
* **support:** route non-error CLI console output to stdout ([#22742](https://github.com/appium/appium/issues/22742)) ([4eb4d7f](https://github.com/appium/appium/commit/4eb4d7f317a685d681b6cf4e25c15b617a8cc7df))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **base-driver:** remove deprecated getSession command ([#22725](https://github.com/appium/appium/issues/22725)) ([f71d980](https://github.com/appium/appium/commit/f71d980779d23e9a19d33285646fad128eae4917))
|
||||
* **base-driver:** remove deprecated multi-argument createSession overload ([#22730](https://github.com/appium/appium/issues/22730)) ([db72249](https://github.com/appium/appium/commit/db722498739ae7fe1deef1b98e02d04b455a4f70))
|
||||
* **base-driver:** replace command mixin with explicit named exports ([#22741](https://github.com/appium/appium/issues/22741)) ([506bfee](https://github.com/appium/appium/commit/506bfeeb9aa15c0dd1f481868d347cb9b0d37f86))
|
||||
* **base-plugin:** remove deprecated legacy logger and default export ([#22718](https://github.com/appium/appium/issues/22718)) ([62db5f0](https://github.com/appium/appium/commit/62db5f0b20c496b495ce27d490453861ddefb259))
|
||||
* **logger:** remove default exports and dead logging APIs ([#22719](https://github.com/appium/appium/issues/22719)) ([fe24f52](https://github.com/appium/appium/commit/fe24f527a4412ed86c7b5e5afe0c6e26dc569e6b))
|
||||
* remove deprecated driverData mechanism ([#22716](https://github.com/appium/appium/issues/22716)) ([ef8a8e1](https://github.com/appium/appium/commit/ef8a8e1934bfdc9699c2b9a7eca3e2201b4b9f93))
|
||||
* **support:** move npm-related helpers into appium package ([#22721](https://github.com/appium/appium/issues/22721)) ([d82d496](https://github.com/appium/appium/commit/d82d496f9e80d6628abface3b623601a6f9791f9))
|
||||
* **support:** replace glob package with native node:fs glob ([#22735](https://github.com/appium/appium/issues/22735)) ([add1615](https://github.com/appium/appium/commit/add161560701ac7fb2bc372ddefd9317146fbae8))
|
||||
* **appium:** do not treat a directory as a CLI argument file ([#22709](https://github.com/appium/appium/issues/22709)) ([6ba6faf](https://github.com/appium/appium/commit/6ba6faf6f533192afbdf9462dbbb3a5c1e5d85c5))
|
||||
* **appium:** filter prerelease versions in driver update e2e test ([#22794](https://github.com/appium/appium/issues/22794)) ([4e8e334](https://github.com/appium/appium/commit/4e8e334cbc0ae910f521ae7ff7d3ed15f9be0a6a))
|
||||
* **appium:** match insecure feature prefixes by automationName, case-insensitively ([#22710](https://github.com/appium/appium/issues/22710)) ([6ab17fe](https://github.com/appium/appium/commit/6ab17feb71d74c1f349616f22896faeb256a66ec))
|
||||
|
||||
|
||||
## [3.7.0](https://github.com/appium/appium/compare/appium@3.6.0...appium@3.7.0) (2026-08-24)
|
||||
|
||||
@@ -133,7 +133,7 @@ appium plugin uninstall <plugin-name>
|
||||
## Server Command Line Interface
|
||||
|
||||
In order to start sending commands to the Appium server, it must be running on the URL and port
|
||||
where your client library expects it to listen. [Appium's command-line interface](http://appium.io/docs/en/latest/cli/server/)
|
||||
where your client library expects it to listen. [Appium's command-line interface](https://appium.io/docs/en/latest/reference/cli/)
|
||||
is used to launch and configure the server:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -230,6 +230,16 @@ async createSession(w3cCaps) {
|
||||
}
|
||||
```
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Older drivers may still define `createSession` with up to four parameters, e.g.
|
||||
`createSession(jwpCaps, reqCaps, w3cCaps, otherDriverData)`. This shape is a holdover from the
|
||||
retired JSON Wire Protocol, which required desired and required caps as the first two
|
||||
arguments; only the first W3C-shaped argument was ever used. The `otherDriverData` parameter is
|
||||
likewise deprecated in favor of [IPC](#send-messages-to-plugins-running-on-the-same-session) for
|
||||
coordinating with other concurrently-running sessions. New drivers should use the single-argument
|
||||
form shown above.
|
||||
|
||||
You'll want to make sure to call `super.createSession` in order to get the session ID as well as
|
||||
the processed capabilities (note that capabilities are also set on `this.caps`; modifying `caps`
|
||||
locally here would have no effect other than changing what the user sees in the create session
|
||||
@@ -535,7 +545,7 @@ this.proxyCommand = proxy.command.bind(proxy);
|
||||
Here we are creating a proxy object and assigning some of its methods to `this` under the names
|
||||
`proxyReqRes` and `proxyCommand`. This is required for Appium to use the proxy, so don't forget
|
||||
this step! The `WebDriverProxy` has a variety of other options [which you can check out in the
|
||||
source code as well.](https://github.com/appium/appium/blob/master/packages/base-driver/lib/wd-proxy/proxy.ts)
|
||||
source code as well.](https://github.com/appium/appium/blob/master/packages/base-driver/lib/jsonwp-proxy/proxy.ts)
|
||||
|
||||
Finally, we need a way to tell Appium when the proxy is active. For your driver it might always
|
||||
be active, or it might only be active when in a certain context. You can define the logic as an
|
||||
@@ -715,12 +725,6 @@ A couple notes about this system:
|
||||
mode!
|
||||
1. The `executeMethod` helper will reject with an error if a script name doesn't match one of the
|
||||
script names defined as a command in `executeMethodMap`, or if there are missing parameters.
|
||||
1. If your driver is written in TypeScript, declare the map `as const satisfies
|
||||
ExecuteMethodMap<MyDriver>` (with `ExecuteMethodMap` imported from `@appium/types`). The
|
||||
compiler then checks that each `command` names a method of your driver, and that the
|
||||
`required`/`optional` params are consistent with that method's signature: the method must not
|
||||
require a parameter which is listed as `optional` (or not listed at all), and must accept all
|
||||
of the listed parameters.
|
||||
|
||||
One of the nice things about the Execute Method strategy is that methods implemented in this way
|
||||
will be available via the classic or BiDi interfaces (since they will result in the same Appium
|
||||
@@ -788,36 +792,6 @@ this.eventEmitter.emit('bidiEvent', {
|
||||
Now, if the client has subscribed to the `system.cpu` event, it will be notified with the load
|
||||
whenever the driver emits it.
|
||||
|
||||
#### Slow clients and high-rate events
|
||||
|
||||
Appium does not buffer events indefinitely for a client that does not read them. A connection
|
||||
that keeps more than `--bidi-max-buffered-bytes` unsent for longer than `--bidi-max-buffered-ms`
|
||||
is closed with the code `1013`, and connections that do not answer WebSocket pings (see
|
||||
`--bidi-heartbeat-interval`) are terminated. Both only affect the offending connection.
|
||||
|
||||
Drivers that emit events at a high rate (e.g. media streams) can let Appium skip events for a
|
||||
connection that is falling behind, instead of waiting for it to be closed. Add a `delivery` hint
|
||||
to the event (it is never sent to clients; older Appium versions ignore it):
|
||||
|
||||
```js
|
||||
this.eventEmitter.emit('bidiEvent', {
|
||||
method: 'appium:media.units',
|
||||
params: {track: 'video', units},
|
||||
delivery: {policy: 'droppable', chain: 'video', syncPoint: startsWithKeyframe},
|
||||
})
|
||||
```
|
||||
|
||||
- `policy`: `reliable` (default) events are always sent, `droppable` ones may be skipped.
|
||||
- `chain`: events of the same chain depend on each other. After one is skipped for a connection,
|
||||
the following ones are skipped for it too, until an event with `syncPoint: true` (e.g. a keyframe)
|
||||
arrives and the connection has caught up. Every connection resynchronizes independently.
|
||||
|
||||
Subscriptions are per session, not per connection, so Appium decides by the state of each
|
||||
connection's buffer. To react to dropped events (e.g. to request a keyframe or lower the bitrate),
|
||||
listen to `bidiBackpressure` on the same emitter. Its payload is `{method, chain?, state, dropped}`,
|
||||
where `state` is `dropping` once the first connection starts skipping events (and again whenever a
|
||||
sync point is skipped, so that you can request a new one) and `recovered` once the last one stops, and `dropped` is the largest number of events skipped for a single connection.
|
||||
|
||||
### Make itself aware of resources other concurrent drivers are using
|
||||
|
||||
Let's say your driver uses up some system resources, like ports. There are a few ways to make sure
|
||||
@@ -825,32 +799,50 @@ that multiple simultaneous sessions don't use the same resources:
|
||||
|
||||
1. Have your users specify resource IDs via capabilities (`appium:driverPort` etc)
|
||||
1. Just always use free resources (find a new random port for each session)
|
||||
1. Have each running instance of your driver publish and subscribe to messages on a shared IPC
|
||||
channel, so sessions can coordinate directly with one another.
|
||||
1. Have each driver express what resources it is using, then examine currently-used resources from
|
||||
other drivers when a new session begins.
|
||||
|
||||
The per-session IPC channel described in [Send messages to plugins running on the same
|
||||
session](#send-messages-to-plugins-running-on-the-same-session) is isolated per session, so it
|
||||
can't be used for this: it doesn't let you talk to *other* sessions of your driver. Instead,
|
||||
construct and hold on to your own `AppiumIpc` instance (exported from `appium/driver.js`) at
|
||||
module scope in your driver's package, for example as a memoized singleton. Since Node.js caches
|
||||
modules, every instance of your driver loaded within the same Appium server process will share
|
||||
that one `AppiumIpc` object, and can use it to publish and subscribe to topics across sessions —
|
||||
the same way the per-session channel works, just not scoped to a single session. See
|
||||
[xcuitest-driver's `session-claim-handler.ts`](https://github.com/appium/appium-xcuitest-driver/blob/master/lib/session-claim-handler.ts)
|
||||
for a real example, which uses this technique to detect and resolve conflicting sessions targeting
|
||||
the same device UDID.
|
||||
!!! warning "Deprecated"
|
||||
|
||||
The `driverData`-based mechanism described below is deprecated. Prefer
|
||||
[IPC](#send-messages-to-plugins-running-on-the-same-session) for coordinating resources across
|
||||
concurrently-running sessions instead.
|
||||
|
||||
To support this third strategy, you can implement `get driverData` in your driver to return what
|
||||
sorts of resources your driver is currently using, for example:
|
||||
|
||||
```js
|
||||
get driverData() {
|
||||
return {specialPort: 1234, specialFile: /path/to/file}
|
||||
}
|
||||
```
|
||||
|
||||
Now, when a new session is started on your driver, the `driverData` response from any other
|
||||
simultaneously running drivers (of the same type) will also be included, as the last parameter of
|
||||
the deprecated, multi-argument form of the `createSession` method:
|
||||
|
||||
```js
|
||||
async createSession(jwpCaps, reqCaps, w3cCaps, driverData)
|
||||
```
|
||||
|
||||
You can dig into this `driverData` array to see what resources other drivers are using to help
|
||||
determine which ones you want to use for this particular session.
|
||||
|
||||
!!! warning
|
||||
|
||||
This only works for sessions running within the same Node.js process (i.e. the same Appium
|
||||
server). It cannot coordinate sessions running on different Appium server processes; for that,
|
||||
consider file-based locking or a similar out-of-process mechanism.
|
||||
Be careful here, since `driverData` is only passed between sessions of a single running Appium
|
||||
server. There's nothing to stop a user from running multiple Appium servers and requesting your
|
||||
driver simultaneously on each of them. In this case, you won't be able to ensure independence
|
||||
of resources via `driverData`, so you might consider using file-based locking mechanisms or
|
||||
something similar.
|
||||
|
||||
!!! warning
|
||||
|
||||
Appium also doesn't provide any features for ensuring unrelated drivers don't interfere with
|
||||
one another, so it's up to the drivers to allow users to specify resource locations or
|
||||
addresses to avoid clashes.
|
||||
It's also important to note you will only receive `driverData` for other instances of *your*
|
||||
driver. So unrelated drivers also running may still be using some system resources. In general
|
||||
Appium doesn't provide any features for ensuring unrelated drivers don't interfere with one
|
||||
another, so it's up to the drivers to allow users to specify resource locations or addresses to
|
||||
avoid clashes.
|
||||
|
||||
### Log events to the Appium event timeline
|
||||
|
||||
@@ -998,15 +990,10 @@ export type IpcMessage<T> = {
|
||||
#### IPC Notes
|
||||
|
||||
There are some important things to keep in mind when using Appium's IPC feature:
|
||||
- The `ipcSubscribe` method (and the IPC channel it subscribes to) is only available once
|
||||
`onIpcInit` has been called, at the end of the `createSession` flow. It cannot be used statically
|
||||
or in `createSession` hooks
|
||||
- The channel that `ipcSubscribe` gives you access to is scoped to the current session, and is
|
||||
shared only with the plugins active in that same session (this is also to prevent drivers/plugins
|
||||
from accessing or reading data sent on IPC channels in other sessions.) To coordinate across
|
||||
multiple concurrent sessions of your own driver instead, see [Make itself aware of resources
|
||||
other concurrent drivers are
|
||||
using](#make-itself-aware-of-resources-other-concurrent-drivers-are-using).
|
||||
- IPC is only available once `onIpcInit` has been called, at the end of the `createSession` flow.
|
||||
It cannot be used statically or in `createSession` hooks
|
||||
- In sum, IPC is only for use during a session (this is also to prevent drivers/plugins from
|
||||
accessing or reading data sent on IPC channels in other sessions.)
|
||||
- The default max size of an IPC message is 1MB. This can be configured by the server-admin by
|
||||
using the `--max-ipc-data-size` arg (value is a number in bytes).
|
||||
- If a message exceeds the configured size, any call to `publish` methods will throw, so be
|
||||
|
||||
@@ -257,7 +257,7 @@ throw new errors.NoSuchElementError();
|
||||
### Log messages to the Appium log
|
||||
|
||||
You can always use `console.log`, of course, but Appium provides a nice logger for you as
|
||||
`this.log` (it has `.info`, `.debug`, `.warn`, `.error` methods on it for differing log
|
||||
`this.logger` (it has `.info`, `.debug`, `.log`, `.warn`, `.error` methods on it for differing log
|
||||
levels). If you want to create an Appium logger outside of a plugin context (say in a script or
|
||||
helper file), you can always construct your own too:
|
||||
|
||||
@@ -476,7 +476,7 @@ capability.
|
||||
|
||||
You probably don't normally need to update the Appium server object (which is an
|
||||
[Express](https://expressjs.com/) server having already been
|
||||
[configured](https://github.com/appium/appium/blob/master/packages/http-server/lib/server.ts)
|
||||
[configured](https://github.com/appium/appium/blob/master/packages/base-driver/lib/express/server.ts)
|
||||
in a variety of ways). But, for example, you could add new routes to the server to support your
|
||||
plugin's requirements. To update the server you must implement the `static async updateServer`
|
||||
method in your class. This method takes three parameters:
|
||||
|
||||
@@ -42,7 +42,7 @@ In order to get some value in logs replaced by a generic mask it is necessary:
|
||||
[util.format](https://nodejs.org/api/util.html#utilformatformat-args) API.
|
||||
|
||||
- While sending the appropriate server request, where this log line is used and should be masked,
|
||||
add the custom header `X-Appium-Is-Sensitive` with its value set to `1`, `true` or `yes` (case-insensitive).
|
||||
add the custom header `X-Appium-Is-Sensitive` with its value set to `1` or `true` (case-insensitive).
|
||||
Without such header the above log value is not going to be masked.
|
||||
This way it is possible to conditionally mask log records depending on which
|
||||
request is being handled by the extension if the log expression is used in the
|
||||
|
||||
@@ -15,7 +15,7 @@ To learn more about drivers, check out the [Driver Intro](../intro/drivers.md).
|
||||
|
||||
These drivers are currently maintained by the Appium team:
|
||||
|
||||
### [Chromium](https://appium.github.io/appium-chromium-driver)
|
||||
### [Chromium](https://appium.github.io/appium-chromium-driver/)
|
||||
|
||||
* Target: Desktop Chromium-based browsers (Chrome, Microsoft Edge, etc.)
|
||||
* Mode: Web
|
||||
@@ -24,7 +24,7 @@ These drivers are currently maintained by the Appium team:
|
||||
appium driver install chromium
|
||||
```
|
||||
|
||||
### [Espresso](https://appium.github.io/appium-espresso-driver)
|
||||
### [Espresso](https://appium.github.io/appium-espresso-driver/)
|
||||
|
||||
* Target: Android applications (mobile, TV, Wear, XR, Automotive)
|
||||
* Mode: Native, Hybrid, Web
|
||||
@@ -33,7 +33,7 @@ appium driver install chromium
|
||||
appium driver install espresso
|
||||
```
|
||||
|
||||
### [Gecko](https://appium.github.io/appium-geckodriver)
|
||||
### [Gecko](https://appium.github.io/appium-geckodriver/)
|
||||
|
||||
* Target: Desktop and mobile Gecko-based browsers (Firefox, etc.)
|
||||
* Mode: Web
|
||||
@@ -42,7 +42,7 @@ appium driver install espresso
|
||||
appium driver install gecko
|
||||
```
|
||||
|
||||
### [Mac2](https://appium.github.io/appium-mac2-driver)
|
||||
### [Mac2](https://appium.github.io/appium-mac2-driver/)
|
||||
|
||||
* Target: macOS applications
|
||||
* Mode: Native
|
||||
@@ -51,7 +51,7 @@ appium driver install gecko
|
||||
appium driver install mac2
|
||||
```
|
||||
|
||||
### [Safari](https://appium.github.io/appium-safari-driver)
|
||||
### [Safari](https://appium.github.io/appium-safari-driver/)
|
||||
|
||||
* Target: Desktop and mobile Safari browsers
|
||||
* Mode: Web
|
||||
@@ -60,7 +60,7 @@ appium driver install mac2
|
||||
appium driver install safari
|
||||
```
|
||||
|
||||
### [UiAutomator2](https://appium.github.io/appium-uiautomator2-driver)
|
||||
### [UiAutomator2](https://appium.github.io/appium-uiautomator2-driver/)
|
||||
|
||||
* Target: Android applications (mobile, TV, Wear, XR, Automotive)
|
||||
* Modes: Native, Hybrid, Web
|
||||
@@ -69,13 +69,18 @@ appium driver install safari
|
||||
appium driver install uiautomator2
|
||||
```
|
||||
|
||||
### [WinCore](https://appium.github.io/appium-wincore-driver)
|
||||
### [Windows](https://github.com/appium/appium-windows-driver)
|
||||
|
||||
!!! warning
|
||||
|
||||
Only the Node.js-based driver part is maintained by the Appium team. The server part
|
||||
(WinAppDriver executable) is provided by Microsoft, but has not been maintained since 2022.
|
||||
|
||||
* Target: Windows applications
|
||||
* Mode: Native
|
||||
|
||||
```sh title="Install This Driver"
|
||||
appium driver install wincore
|
||||
appium driver install windows
|
||||
```
|
||||
|
||||
### [XCUITest](https://appium.github.io/appium-xcuitest-driver/)
|
||||
@@ -150,6 +155,11 @@ appium driver install --source=npm @itsmeaj/appium-linux-driver
|
||||
|
||||
### [NovaWindows](https://github.com/AutomateThePlanet/appium-novawindows-driver)
|
||||
|
||||
!!! info
|
||||
|
||||
This driver is recommended as a drop-in replacement for the partially unmaintained
|
||||
[Windows driver](#windows)
|
||||
|
||||
* Target: Windows applications
|
||||
* Mode: Native, Hybrid
|
||||
* Supported by: Community / Automate The Planet
|
||||
@@ -192,20 +202,6 @@ npm install appium-tizen-driver
|
||||
appium driver install --source=npm appium-tizen-tv-driver
|
||||
```
|
||||
|
||||
### [Windows (legacy)](https://github.com/appium/appium-windows-driver)
|
||||
|
||||
!!! warning
|
||||
|
||||
This driver relies on WinAppDriver, which has not been maintained since 2022, and is only
|
||||
compatible with Appium 1-3. Use the [WinCore](#wincore) driver with Appium 4 and newer.
|
||||
|
||||
* Target: Windows applications
|
||||
* Mode: Native
|
||||
|
||||
```sh title="Install This Driver"
|
||||
appium driver install --source=npm appium-windows-driver
|
||||
```
|
||||
|
||||
### [You.i Engine](https://github.com/YOU-i-Labs/appium-youiengine-driver)
|
||||
|
||||
!!! warning
|
||||
|
||||
@@ -15,7 +15,7 @@ bundle for each test.
|
||||
## What Is Cached
|
||||
|
||||
Caching could be applied to application bundles generated by
|
||||
[`configureApp`](https://github.com/appium/appium/blob/master/packages/base-driver/lib/basedriver/helpers.js#L99) helper call.
|
||||
[`configureApp`](https://github.com/appium/appium/blob/master/packages/base-driver/lib/basedriver/helpers.ts#L99) helper call.
|
||||
Inherited drivers can customize their caching logic by providing own `onPostProcess`
|
||||
(or both `inDownload` and `onPostProcess`) property definition, but the general
|
||||
rule of thumb is that we need to cache locally all application bundles need to be downloaded and/or extracted
|
||||
|
||||
@@ -95,4 +95,4 @@ and the values of any specific configuration it provides are under this. For exa
|
||||
|
||||
All properties are case-sensitive and will be in
|
||||
[kebab-case](https://en.wikipedia.org/wiki/Naming_convention_(programming)#Delimiter-separated_words).
|
||||
For example, `base-path` is allowed, but `basePath` is not.
|
||||
For example, `callback-port` is allowed, but `callbackPort` is not.
|
||||
|
||||
@@ -6,12 +6,13 @@ title: Retrieving Event Timings
|
||||
---
|
||||
|
||||
Appium comes with the ability to retrieve timing information about startup
|
||||
information and command length. This is an advanced feature; event and
|
||||
command timings are collected automatically for the duration of a session.
|
||||
information and command length. This is an advanced feature; the server records
|
||||
event timings for every session.
|
||||
|
||||
The `POST /session/:id/appium/events` response (i.e., the response to
|
||||
`driver.logs.events` or similar, depending on client) has the following
|
||||
structure:
|
||||
The timings can be retrieved at any point during a session via the
|
||||
`POST /session/:id/appium/events` endpoint (i.e., the response to
|
||||
`driver.logs.events` or similar, depending on client). The response body is the
|
||||
event history object itself. This is its structure:
|
||||
|
||||
```
|
||||
{
|
||||
@@ -62,7 +63,8 @@ generate various kinds of reports from event timings output:
|
||||
!!! note
|
||||
|
||||
In the past, when the `appium:eventTimings` capability was set to `true`, the event history
|
||||
was also returned as an `events` property of the `GET /session/:id` response
|
||||
was also returned as an `events` property of the (now deprecated) `GET /session/:id`
|
||||
response
|
||||
|
||||
## Add a custom event
|
||||
|
||||
|
||||
@@ -1,343 +0,0 @@
|
||||
---
|
||||
title: Automating Gestures
|
||||
---
|
||||
|
||||
Appium supports automating complex pointer, touch, key, and wheel interactions through the
|
||||
W3C WebDriver [Perform Actions](../reference/api/webdriver.md#performactions) API
|
||||
([W3C Specification](https://w3c.github.io/webdriver/#actions)). Alternatively, many drivers provide
|
||||
platform-native gesture [Execute Methods](./execute-methods.md) for common interactions.
|
||||
|
||||
In the W3C Actions API, interactions are defined by creating one or more virtual input sources
|
||||
(such as `pointer` with `pointerType: "touch"`, `key`, `wheel`, or `none`) and queuing a sequence
|
||||
of synchronized ticks (`pointerMove`, `pointerDown`, `pointerUp`, `pause`). See the
|
||||
[Selenium Actions API documentation](https://www.selenium.dev/documentation/webdriver/actions_api/)
|
||||
for a general overview of input sources and tick synchronization.
|
||||
|
||||
Below are examples of common single-finger and multi-touch gestures implemented using the W3C
|
||||
Actions API across client languages.
|
||||
|
||||
## Double Tap
|
||||
|
||||
Performs two quick touch taps at `(x, y)` with a short pause between them:
|
||||
|
||||
=== "JS (WebDriverIO)"
|
||||
|
||||
```js
|
||||
await driver
|
||||
.action('pointer', {parameters: {pointerType: 'touch'}})
|
||||
.move({x: 200, y: 300, duration: 0})
|
||||
.down()
|
||||
.up()
|
||||
.pause(100)
|
||||
.down()
|
||||
.up()
|
||||
.perform();
|
||||
```
|
||||
|
||||
=== "Java"
|
||||
|
||||
```java
|
||||
PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
|
||||
Sequence doubleTap = new Sequence(finger, 1)
|
||||
.addAction(finger.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), 200, 300))
|
||||
.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()))
|
||||
.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg()))
|
||||
.addAction(new Pause(finger, Duration.ofMillis(100)))
|
||||
.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()))
|
||||
.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));
|
||||
driver.perform(Collections.singletonList(doubleTap));
|
||||
```
|
||||
|
||||
=== "Python"
|
||||
|
||||
```py
|
||||
actions = ActionChains(driver)
|
||||
actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, "finger"))
|
||||
actions.w3c_actions.pointer_action.move_to_location(200, 300)
|
||||
actions.w3c_actions.pointer_action.pointer_down()
|
||||
actions.w3c_actions.pointer_action.pointer_up()
|
||||
actions.w3c_actions.pointer_action.pause(0.1)
|
||||
actions.w3c_actions.pointer_action.pointer_down()
|
||||
actions.w3c_actions.pointer_action.pointer_up()
|
||||
actions.perform()
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```rb
|
||||
f1 = driver.action.add_pointer_input(:touch, 'finger')
|
||||
f1.create_pointer_move(duration: 0, x: 200, y: 300, origin: :viewport)
|
||||
f1.create_pointer_down(:left)
|
||||
f1.create_pointer_up(:left)
|
||||
f1.create_pause(0.1)
|
||||
f1.create_pointer_down(:left)
|
||||
f1.create_pointer_up(:left)
|
||||
driver.perform_actions([f1])
|
||||
```
|
||||
|
||||
=== "C#"
|
||||
|
||||
```csharp
|
||||
var finger = new PointerInputDevice(PointerKind.Touch, "finger");
|
||||
var doubleTap = new ActionSequence(finger, 0);
|
||||
doubleTap.AddAction(finger.CreatePointerMove(CoordinateOrigin.Viewport, 200, 300, TimeSpan.Zero));
|
||||
doubleTap.AddAction(finger.CreatePointerDown(MouseButton.Touch));
|
||||
doubleTap.AddAction(finger.CreatePointerUp(MouseButton.Touch));
|
||||
doubleTap.AddAction(finger.CreatePause(TimeSpan.FromMilliseconds(100)));
|
||||
doubleTap.AddAction(finger.CreatePointerDown(MouseButton.Touch));
|
||||
doubleTap.AddAction(finger.CreatePointerUp(MouseButton.Touch));
|
||||
driver.PerformActions(new List<ActionSequence> { doubleTap });
|
||||
```
|
||||
|
||||
## Long Press
|
||||
|
||||
Presses and holds a touch pointer at `(x, y)` for 1000ms before releasing:
|
||||
|
||||
=== "JS (WebDriverIO)"
|
||||
|
||||
```js
|
||||
await driver
|
||||
.action('pointer', {parameters: {pointerType: 'touch'}})
|
||||
.move({x: 200, y: 300, duration: 0})
|
||||
.down()
|
||||
.pause(1000)
|
||||
.up()
|
||||
.perform();
|
||||
```
|
||||
|
||||
=== "Java"
|
||||
|
||||
```java
|
||||
PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
|
||||
Sequence longPress = new Sequence(finger, 1)
|
||||
.addAction(finger.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), 200, 300))
|
||||
.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()))
|
||||
.addAction(new Pause(finger, Duration.ofMillis(1000)))
|
||||
.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));
|
||||
driver.perform(Collections.singletonList(longPress));
|
||||
```
|
||||
|
||||
=== "Python"
|
||||
|
||||
```py
|
||||
actions = ActionChains(driver)
|
||||
actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, "finger"))
|
||||
actions.w3c_actions.pointer_action.move_to_location(200, 300)
|
||||
actions.w3c_actions.pointer_action.pointer_down()
|
||||
actions.w3c_actions.pointer_action.pause(1.0)
|
||||
actions.w3c_actions.pointer_action.pointer_up()
|
||||
actions.perform()
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```rb
|
||||
f1 = driver.action.add_pointer_input(:touch, 'finger')
|
||||
f1.create_pointer_move(duration: 0, x: 200, y: 300, origin: :viewport)
|
||||
f1.create_pointer_down(:left)
|
||||
f1.create_pause(1.0)
|
||||
f1.create_pointer_up(:left)
|
||||
driver.perform_actions([f1])
|
||||
```
|
||||
|
||||
=== "C#"
|
||||
|
||||
```csharp
|
||||
var finger = new PointerInputDevice(PointerKind.Touch, "finger");
|
||||
var longPress = new ActionSequence(finger, 0);
|
||||
longPress.AddAction(finger.CreatePointerMove(CoordinateOrigin.Viewport, 200, 300, TimeSpan.Zero));
|
||||
longPress.AddAction(finger.CreatePointerDown(MouseButton.Touch));
|
||||
longPress.AddAction(finger.CreatePause(TimeSpan.FromMilliseconds(1000)));
|
||||
longPress.AddAction(finger.CreatePointerUp(MouseButton.Touch));
|
||||
driver.PerformActions(new List<ActionSequence> { longPress });
|
||||
```
|
||||
|
||||
## Drag and Drop / Swipe
|
||||
|
||||
Moves a touch pointer from `(200, 600)` to `(200, 200)` over 600ms:
|
||||
|
||||
=== "JS (WebDriverIO)"
|
||||
|
||||
```js
|
||||
await driver
|
||||
.action('pointer', {parameters: {pointerType: 'touch'}})
|
||||
.move({x: 200, y: 600, duration: 0})
|
||||
.down()
|
||||
.pause(100)
|
||||
.move({x: 200, y: 200, duration: 600})
|
||||
.up()
|
||||
.perform();
|
||||
```
|
||||
|
||||
=== "Java"
|
||||
|
||||
```java
|
||||
PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
|
||||
Sequence dragAndDrop = new Sequence(finger, 1)
|
||||
.addAction(finger.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), 200, 600))
|
||||
.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()))
|
||||
.addAction(new Pause(finger, Duration.ofMillis(100)))
|
||||
.addAction(finger.createPointerMove(Duration.ofMillis(600), PointerInput.Origin.viewport(), 200, 200))
|
||||
.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));
|
||||
driver.perform(Collections.singletonList(dragAndDrop));
|
||||
```
|
||||
|
||||
=== "Python"
|
||||
|
||||
```py
|
||||
actions = ActionChains(driver)
|
||||
actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, "finger"))
|
||||
actions.w3c_actions.pointer_action.move_to_location(200, 600)
|
||||
actions.w3c_actions.pointer_action.pointer_down()
|
||||
actions.w3c_actions.pointer_action.pause(0.1)
|
||||
actions.w3c_actions.pointer_action.move_to_location(200, 200)
|
||||
actions.w3c_actions.pointer_action.pointer_up()
|
||||
actions.perform()
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```rb
|
||||
f1 = driver.action.add_pointer_input(:touch, 'finger')
|
||||
f1.create_pointer_move(duration: 0, x: 200, y: 600, origin: :viewport)
|
||||
f1.create_pointer_down(:left)
|
||||
f1.create_pause(0.1)
|
||||
f1.create_pointer_move(duration: 0.6, x: 200, y: 200, origin: :viewport)
|
||||
f1.create_pointer_up(:left)
|
||||
driver.perform_actions([f1])
|
||||
```
|
||||
|
||||
=== "C#"
|
||||
|
||||
```csharp
|
||||
var finger = new PointerInputDevice(PointerKind.Touch, "finger");
|
||||
var dragAndDrop = new ActionSequence(finger, 0);
|
||||
dragAndDrop.AddAction(finger.CreatePointerMove(CoordinateOrigin.Viewport, 200, 600, TimeSpan.Zero));
|
||||
dragAndDrop.AddAction(finger.CreatePointerDown(MouseButton.Touch));
|
||||
dragAndDrop.AddAction(finger.CreatePause(TimeSpan.FromMilliseconds(100)));
|
||||
dragAndDrop.AddAction(finger.CreatePointerMove(CoordinateOrigin.Viewport, 200, 200, TimeSpan.FromMilliseconds(600)));
|
||||
dragAndDrop.AddAction(finger.CreatePointerUp(MouseButton.Touch));
|
||||
driver.PerformActions(new List<ActionSequence> { dragAndDrop });
|
||||
```
|
||||
|
||||
## Pinch and Zoom (Multi-Touch)
|
||||
|
||||
Uses two concurrent `touch` pointer sequences (`finger1` and `finger2`) moving apart to zoom in (or toward each other to pinch):
|
||||
|
||||
=== "JS (WebDriverIO)"
|
||||
|
||||
```js
|
||||
await driver.performActions([
|
||||
{
|
||||
type: 'pointer',
|
||||
id: 'finger1',
|
||||
parameters: {pointerType: 'touch'},
|
||||
actions: [
|
||||
{type: 'pointerMove', duration: 0, x: 200, y: 400},
|
||||
{type: 'pointerDown', button: 0},
|
||||
{type: 'pause', duration: 100},
|
||||
{type: 'pointerMove', duration: 500, x: 200, y: 200},
|
||||
{type: 'pointerUp', button: 0},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'pointer',
|
||||
id: 'finger2',
|
||||
parameters: {pointerType: 'touch'},
|
||||
actions: [
|
||||
{type: 'pointerMove', duration: 0, x: 200, y: 450},
|
||||
{type: 'pointerDown', button: 0},
|
||||
{type: 'pause', duration: 100},
|
||||
{type: 'pointerMove', duration: 500, x: 200, y: 650},
|
||||
{type: 'pointerUp', button: 0},
|
||||
],
|
||||
},
|
||||
]);
|
||||
```
|
||||
|
||||
=== "Java"
|
||||
|
||||
```java
|
||||
PointerInput finger1 = new PointerInput(PointerInput.Kind.TOUCH, "finger1");
|
||||
Sequence seq1 = new Sequence(finger1, 1)
|
||||
.addAction(finger1.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), 200, 400))
|
||||
.addAction(finger1.createPointerDown(PointerInput.MouseButton.LEFT.asArg()))
|
||||
.addAction(new Pause(finger1, Duration.ofMillis(100)))
|
||||
.addAction(finger1.createPointerMove(Duration.ofMillis(500), PointerInput.Origin.viewport(), 200, 200))
|
||||
.addAction(finger1.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));
|
||||
|
||||
PointerInput finger2 = new PointerInput(PointerInput.Kind.TOUCH, "finger2");
|
||||
Sequence seq2 = new Sequence(finger2, 1)
|
||||
.addAction(finger2.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), 200, 450))
|
||||
.addAction(finger2.createPointerDown(PointerInput.MouseButton.LEFT.asArg()))
|
||||
.addAction(new Pause(finger2, Duration.ofMillis(100)))
|
||||
.addAction(finger2.createPointerMove(Duration.ofMillis(500), PointerInput.Origin.viewport(), 200, 650))
|
||||
.addAction(finger2.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));
|
||||
|
||||
driver.perform(Arrays.asList(seq1, seq2));
|
||||
```
|
||||
|
||||
=== "Python"
|
||||
|
||||
```py
|
||||
action_builder = ActionBuilder(driver)
|
||||
finger1 = action_builder.add_pointer_input(interaction.POINTER_TOUCH, "finger1")
|
||||
finger2 = action_builder.add_pointer_input(interaction.POINTER_TOUCH, "finger2")
|
||||
|
||||
finger1.create_pointer_move(duration=0, x=200, y=400)
|
||||
finger1.create_pointer_down(button=MouseButton.LEFT)
|
||||
finger1.create_pause(0.1)
|
||||
finger1.create_pointer_move(duration=500, x=200, y=200)
|
||||
finger1.create_pointer_up(button=MouseButton.LEFT)
|
||||
|
||||
finger2.create_pointer_move(duration=0, x=200, y=450)
|
||||
finger2.create_pointer_down(button=MouseButton.LEFT)
|
||||
finger2.create_pause(0.1)
|
||||
finger2.create_pointer_move(duration=500, x=200, y=650)
|
||||
finger2.create_pointer_up(button=MouseButton.LEFT)
|
||||
|
||||
action_builder.perform()
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
```rb
|
||||
f1 = driver.action.add_pointer_input(:touch, 'finger1')
|
||||
f1.create_pointer_move(duration: 0, x: 200, y: 400, origin: :viewport)
|
||||
f1.create_pointer_down(:left)
|
||||
f1.create_pause(0.1)
|
||||
f1.create_pointer_move(duration: 0.5, x: 200, y: 200, origin: :viewport)
|
||||
f1.create_pointer_up(:left)
|
||||
|
||||
f2 = driver.action.add_pointer_input(:touch, 'finger2')
|
||||
f2.create_pointer_move(duration: 0, x: 200, y: 450, origin: :viewport)
|
||||
f2.create_pointer_down(:left)
|
||||
f2.create_pause(0.1)
|
||||
f2.create_pointer_move(duration: 0.5, x: 200, y: 650, origin: :viewport)
|
||||
f2.create_pointer_up(:left)
|
||||
|
||||
driver.perform_actions([f1, f2])
|
||||
```
|
||||
|
||||
=== "C#"
|
||||
|
||||
```csharp
|
||||
var finger1 = new PointerInputDevice(PointerKind.Touch, "finger1");
|
||||
var seq1 = new ActionSequence(finger1, 0);
|
||||
seq1.AddAction(finger1.CreatePointerMove(CoordinateOrigin.Viewport, 200, 400, TimeSpan.Zero));
|
||||
seq1.AddAction(finger1.CreatePointerDown(MouseButton.Touch));
|
||||
seq1.AddAction(finger1.CreatePause(TimeSpan.FromMilliseconds(100)));
|
||||
seq1.AddAction(finger1.CreatePointerMove(CoordinateOrigin.Viewport, 200, 200, TimeSpan.FromMilliseconds(500)));
|
||||
seq1.AddAction(finger1.CreatePointerUp(MouseButton.Touch));
|
||||
|
||||
var finger2 = new PointerInputDevice(PointerKind.Touch, "finger2");
|
||||
var seq2 = new ActionSequence(finger2, 0);
|
||||
seq2.AddAction(finger2.CreatePointerMove(CoordinateOrigin.Viewport, 200, 450, TimeSpan.Zero));
|
||||
seq2.AddAction(finger2.CreatePointerDown(MouseButton.Touch));
|
||||
seq2.AddAction(finger2.CreatePause(TimeSpan.FromMilliseconds(100)));
|
||||
seq2.AddAction(finger2.CreatePointerMove(CoordinateOrigin.Viewport, 200, 650, TimeSpan.FromMilliseconds(500)));
|
||||
seq2.AddAction(finger2.CreatePointerUp(MouseButton.Touch));
|
||||
|
||||
driver.PerformActions(new List<ActionSequence> { seq1, seq2 });
|
||||
```
|
||||
|
||||
@@ -117,3 +117,62 @@ hub, you'll be able to send all your Appium traffic via the single hub endpoint
|
||||
|
||||
And of course, you're able to link up Appium servers and nodes running on different machines in
|
||||
your network to form a larger grid.
|
||||
|
||||
## Using Selenium Grid 3
|
||||
|
||||
It is possible to register your Appium server with a local [Selenium Grid 3](https://www.selenium.dev/documentation/legacy/selenium_3/grid_3/)
|
||||
([setup docs](https://www.selenium.dev/documentation/legacy/grid_3/setting_up_your_own_grid/)) instance by using the
|
||||
`--nodeconfig` server argument.
|
||||
|
||||
```bash
|
||||
appium server --nodeconfig /path/to/nodeconfig.json --base-path=/wd/hub
|
||||
```
|
||||
|
||||
In the referenced config file you have to define the `browserName`, `version` and `platform`
|
||||
capabilities and based on these parameters the grid will re-direct your test to the right device.
|
||||
You will also need to configure your host details and the Selenium Grid details. For a full list of
|
||||
all parameters and descriptions see
|
||||
[here](https://www.selenium.dev/documentation/legacy/selenium_3/grid_setup/).
|
||||
|
||||
Once you start the Appium server it will register with the grid, and you will see your device on
|
||||
the grid console page:
|
||||
|
||||
`http://**\<grid-ip-address\>**:**\<grid-port\>**/grid/console`
|
||||
|
||||
### Example Grid Node Configuration JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"capabilities":
|
||||
[
|
||||
{
|
||||
"browserName": "<e.g._iPhone5_or_iPad4>",
|
||||
"version":"<version_of_iOS_e.g._7.1>",
|
||||
"maxInstances": 1,
|
||||
"platform":"<platform_e.g._MAC_or_ANDROID>"
|
||||
}
|
||||
],
|
||||
"configuration":
|
||||
{
|
||||
"cleanUpCycle":2000,
|
||||
"timeout":30000,
|
||||
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
|
||||
"url":"http://<host_name_appium_server_or_ip-address_appium_server>:<appium_port>/wd/hub",
|
||||
"host": "<host_name_appium_server_or_ip-address_appium_server>",
|
||||
"port": <appium_port>,
|
||||
"maxSession": 1,
|
||||
"register": true,
|
||||
"registerCycle": 5000,
|
||||
"hubPort": <grid_port>,
|
||||
"hubHost": "<Grid_host_name_or_grid_ip-address>",
|
||||
"hubProtocol": "<Protocol_of_Grid_defaults_to_http>"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If `url`, `host`, and `port` are not given, the config will be auto updated to point to
|
||||
`localhost:<appium-port>`.
|
||||
|
||||
If your Appium server is running on a different machine to your Selenium Grid server, make sure you
|
||||
use an external name/IP address in your `host` and `url` configuration; `localhost` and `127.0.0.1`
|
||||
will prevent Selenium Grid from connecting correctly.
|
||||
|
||||
@@ -31,6 +31,10 @@ installing it only installs the core Appium server, without any drivers.
|
||||
|
||||
When it comes to installing Appium 2 drivers, there are several approaches you can take:
|
||||
|
||||
* Add the `--drivers` flag when installing Appium, for example:
|
||||
```bash
|
||||
npm i -g appium --drivers=xcuitest,uiautomator2
|
||||
```
|
||||
* Use the [Appium Extension CLI](../reference/cli/extensions.md), for example:
|
||||
```bash
|
||||
appium driver install uiautomator2
|
||||
@@ -197,12 +201,8 @@ and [Mobile JSON Wire Protocol](https://github.com/SeleniumHQ/mobile-spec/blob/m
|
||||
(MJSONWP) were used instead.
|
||||
|
||||
In Appium 1, all of these protocols were supported, so that older Selenium/Appium clients could
|
||||
still communicate with newer Appium servers. Appium 2 removes support for JSONWP/MJSONWP (including
|
||||
legacy `TouchAction` and `MultiAction` endpoints) and is now only compatible with the W3C WebDriver
|
||||
Protocol. Multi-touch and pointer gestures should be performed using the W3C
|
||||
[Perform Actions](../reference/api/webdriver.md#performactions) API (see the
|
||||
[Automating Gestures](./gestures.md) guide) or driver-specific
|
||||
[Execute Methods](./execute-methods.md).
|
||||
still communicate with newer Appium servers. Appium 2 removes support for JSONWP/MJSONWP and is now
|
||||
only compatible with the W3C WebDriver Protocol.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
|
||||
@@ -1,650 +0,0 @@
|
||||
---
|
||||
title: Migrating to Appium 4
|
||||
---
|
||||
|
||||
This document is a guide for those who are using Appium 3 and would like to upgrade to Appium 4.
|
||||
It contains a list of breaking changes (including behavioral fixes), as well as suggestions for
|
||||
handling them.
|
||||
|
||||
Appium 3 was largely focused on cleaning up old endpoints, whereas Appium 4 includes a wider range
|
||||
of changes, including closer alignment to W3C WebDriver protocol requirements, removal of
|
||||
deprecated items not limited to endpoints, and general modernizing of the codebase.
|
||||
|
||||
## Installation
|
||||
|
||||
Appium 4 is currently only available as a beta release, published under the `beta` npm dist-tag.
|
||||
The installation method otherwise remains the same as for Appium 3. If you want to upgrade, you
|
||||
can simply install Appium 4 on top of your existing installation:
|
||||
|
||||
```bash
|
||||
# optional: `appium setup reset`
|
||||
npm install -g appium@beta
|
||||
```
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
### Node 22.22+ Required
|
||||
|
||||
Appium 3 required a Node.js version in the range `^20.19.0 || ^22.12.0 || >=24.0.0`. Appium 4 drops
|
||||
Node 20 and bumps the required range to `^22.22.2 || ^24.15.0 || >=26.0.0`. The minimum `npm`
|
||||
version remains unchanged.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Upgrade Node.js to `v22.22.2` or newer
|
||||
|
||||
### ESM-Only
|
||||
|
||||
Every package in the Appium monorepo (`appium` and its dependents) is now published as ESM-only,
|
||||
with no CommonJS build. `require()` no longer works for these packages.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Import Appium packages using ESM `import` syntax, or use dynamic `import()` from CommonJS code
|
||||
|
||||
### JSONWP/MJSONWP Internals Removed
|
||||
|
||||
The release of Appium 2 removed general support for the obsolete JSONWP and MJSONWP protocols,
|
||||
though some Appium-related packages using JSONWP/MJSONWP under the hood could still continue to
|
||||
function.
|
||||
|
||||
Appium 4 removes most of the remaining internal code that supported these protocols, which means
|
||||
that drivers that still relied on these protocols are no longer compatible with Appium 4. Most
|
||||
notably, this includes the Windows driver ([see dedicated section below](#windows-driver-replaced-by-wincore-driver)). All other official drivers rely on the W3C protocol and are not affected by this change.
|
||||
|
||||
Despite this, Appium 4 does retain temporary support for a select few JSONWP/MJSONWP endpoints (see
|
||||
[Deprecated Endpoints Removed](#deprecated-endpoints-removed)).
|
||||
|
||||
For extension developers, a more detailed breakdown is available [in the Developer-Facing Changes
|
||||
section below](#jsonwpmjsonwp-removal).
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Migrate to drivers that support the W3C WebDriver protocol
|
||||
|
||||
### Windows Driver Replaced by WinCore Driver
|
||||
|
||||
As part of [dropping support for the deprecated JSONWP and MJSONWP protocols](#jsonwpmjsonwp-support-fully-removed),
|
||||
Appium 4 is no longer compatible with the Windows driver ([`appium-windows-driver`](https://github.com/appium/appium-windows-driver)),
|
||||
since the driver cannot support the standard W3C WebDriver protocol. As a result, the
|
||||
`appium driver install windows` CLI command also no longer works.
|
||||
|
||||
Its official replacement is the WinCore driver ([`appium-wincore-driver`](https://github.com/appium/appium-wincore-driver)),
|
||||
which can be installed using the new `appium driver install wincore` command. Since the WinCore
|
||||
driver is also compatible with Appium 3, you can safely migrate from the Windows driver while
|
||||
remaining on Appium 3 - though note that the installation shortcut is only available since Appium 4.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
If you currently use the Windows driver with Appium 3, you can migrate as follows:
|
||||
|
||||
1. Install `appium-wincore-driver` v3: `appium driver install --source=npm appium-wincore-driver@3`
|
||||
2. Migrate your tests to use the WinCore driver
|
||||
3. Uninstall the Windows driver: `appium driver uninstall windows`
|
||||
4. Upgrade to Appium 4
|
||||
5. Update the WinCore driver to its Appium 4 version: `appium driver update wincore --unsafe`
|
||||
|
||||
### Deprecated Endpoints Removed
|
||||
|
||||
Similarly to Appium 3, Appium 4 also removes several previously deprecated server endpoints, all of
|
||||
which belong to the obsolete JSONWP/MJSONWP protocols. Compared to Appium 3, this cleanup is much
|
||||
smaller (12 removed endpoints total, compared to 98 for Appium 3).
|
||||
|
||||
All removed endpoints are listed below, along with their replacement endpoints or driver-specific
|
||||
execute methods:
|
||||
|
||||
* `GET /session/:sessionId`
|
||||
* :octicons-arrow-right-24: [`GET /session/:sessionId/appium/capabilities`](../reference/api/appium.md#getappiumsessioncapabilities) (for capabilities)
|
||||
* :octicons-arrow-right-24: [`GET /session/:sessionId/appium/events`](../reference/api/appium.md#getlogevents) (for event timings)
|
||||
* `POST /session/:sessionId/ime/activate`
|
||||
* :octicons-check-24: Moved to [UiAutomator2](https://appium.github.io/appium-uiautomator2-driver/)/[Espresso](https://appium.github.io/appium-espresso-driver/) drivers
|
||||
* `GET /session/:sessionId/ime/activated`
|
||||
* :octicons-check-24: Moved to UiAutomator2/Espresso drivers
|
||||
* `GET /session/:sessionId/ime/active_engine`
|
||||
* :octicons-check-24: Moved to UiAutomator2/Espresso drivers
|
||||
* `GET /session/:sessionId/ime/available_engines`
|
||||
* :octicons-check-24: Moved to UiAutomator2/Espresso drivers
|
||||
* `POST /session/:sessionId/ime/deactivate`
|
||||
* :octicons-check-24: Moved to UiAutomator2/Espresso drivers
|
||||
* `GET /session/:sessionId/location`
|
||||
* :octicons-check-24: Moved to [XCUITest](https://appium.github.io/appium-xcuitest-driver/) driver
|
||||
* :octicons-arrow-right-24: `mobile: getGeolocation` (UiAutomator2/Espresso drivers)
|
||||
* :octicons-arrow-right-24: `mobile: getSimulatedLocation` (XCUITest driver)
|
||||
* `POST /session/:sessionId/location`
|
||||
* :octicons-check-24: Moved to UiAutomator2/Espresso/XCUITest drivers
|
||||
* :octicons-arrow-right-24: `mobile: setGeolocation` (UiAutomator2/Espresso drivers)
|
||||
* :octicons-arrow-right-24: `mobile: setSimulatedLocation` (XCUITest driver)
|
||||
* `GET /session/:sessionId/network_connection`
|
||||
* :octicons-check-24: Moved to UiAutomator2/Espresso drivers
|
||||
* :octicons-arrow-right-24: `mobile: getConnectivity` (UiAutomator2/Espresso drivers)
|
||||
* `POST /session/:sessionId/network_connection`
|
||||
* :octicons-check-24: Moved to UiAutomator2/Espresso drivers
|
||||
* :octicons-arrow-right-24: `mobile: setConnectivity` (UiAutomator2/Espresso drivers)
|
||||
* `POST /session/:sessionId/receive_async_response`
|
||||
* :octicons-arrow-right-24: [`POST /session/:sessionId/execute/async`](../reference/api/webdriver.md#executeasync)
|
||||
* `GET /session/:sessionId/element/:elementId`
|
||||
* :octicons-no-entry-24: JSONWP protocol command stub with no direct replacement
|
||||
|
||||
#### Remaining Deprecations
|
||||
|
||||
There are 7 more deprecated endpoints that are intentionally _not_ removed in Appium 4. They are
|
||||
the last remaining JSONWP/MJSONWP endpoints supported by Appium, and are listed in the
|
||||
[JSONWP](../reference/api/jsonwp.md) and [MJSONWP](../reference/api/mjsonwp.md) reference pages.
|
||||
|
||||
These endpoints are kept due to their common usage (for context management), and their deprecation
|
||||
being somewhat recent. All of them are therefore planned to be removed in the next major Appium
|
||||
version, in order to give users time to migrate to their replacements.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Check your Appium client documentation for the affected methods, and adjust your code to use
|
||||
their replacements
|
||||
|
||||
### `--allow-cors` Flag Renamed
|
||||
|
||||
In Appium 3, the `--allow-cors` server argument was the only feature flag not integrated with
|
||||
Appium's default [insecure feature flag mechanism](./security.md). Appium 4 removes this argument
|
||||
and replaces it with the `cors` insecure feature name. This means the feature can now be controlled
|
||||
using the `--allow-insecure`, `--deny-insecure` and `--relaxed-security` flags.
|
||||
|
||||
Similarly to the `session_discovery` feature, the `cors` feature must also be prefixed with the
|
||||
wildcard (`*`) symbol.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Replace `--allow-cors` with `--allow-insecure=*:cors` or `--relaxed-security`
|
||||
|
||||
### Default Log Level Set to Info
|
||||
|
||||
The default logging level for server logs has been changed from `debug` to `info`. Debug-level
|
||||
logging is very verbose and mostly only useful for troubleshooting.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Pass `--log-level debug` explicitly if you rely on the previous verbosity
|
||||
|
||||
### CLI Command Output Streams Split
|
||||
|
||||
In Appium 3, all non-JSON output of Appium's CLI commands (`driver`/`plugin`/`setup`, but not
|
||||
`server`) was written to `stderr`. Appium 4 now writes `log`/`ok`/`info`/`warn` level messages of
|
||||
these commands to `stdout`, while `error` level output remains in `stderr`.
|
||||
|
||||
The log output of the server itself (the `server` command) is unaffected, since it already split
|
||||
streams this way.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
If you use scripts that capture non-JSON output of `driver`/`plugin`/`setup` commands, make
|
||||
sure they read from the correct stream
|
||||
|
||||
### SPDY/HTTP2 No Longer Supported
|
||||
|
||||
In Appium 3, the server could be launched with SSL/TLS, which enabled support for the SPDY and
|
||||
HTTP/2 protocols. This functionality relied on the unmaintained `spdy` package. Appium 4 replaces
|
||||
this package with Node's native `https` module, which only supports plain HTTPS (HTTP/1.1).
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Clients relying on SPDY or HTTP/2 multiplexing against Appium's TLS listener must switch to
|
||||
plain HTTPS (HTTP/1.1) or use a proxy
|
||||
|
||||
### Selenium Grid 3 Support Removed
|
||||
|
||||
Support for Selenium Grid 3 hub has been removed, along with its `--nodeconfig` server
|
||||
argument/config file property. Selenium Grid 4 remains supported.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
If you relied on Grid 3 registration, use the [Selenium Grid 4 relay feature](./grid.md) instead
|
||||
|
||||
### Post-Install Script Removed
|
||||
|
||||
Appium 2 and 3 supported a postinstall hook that allowed for installation of drivers/plugins
|
||||
together with the Appium server itself:
|
||||
```
|
||||
npm install -g appium --drivers=... --plugins=...
|
||||
```
|
||||
Since postinstall hooks are a supply-chain security risk, and newer versions of `npm` disable them
|
||||
by default, this hook has been removed in Appium 4.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
If you install drivers/plugins using the postinstall hook, migrate to Appium's
|
||||
[`install`](../reference/cli/extensions.md#install) command, or declare extensions in your
|
||||
project's `package.json` file
|
||||
|
||||
### Event Timings Capability Removed
|
||||
|
||||
In Appium 3, the `appium:eventTimings` capability could be set to `true` in order to include event
|
||||
timing information in the response of the `GET /session/:sessionId` endpoint. Since Appium 4
|
||||
removes this endpoint (see [Deprecated Endpoints Removed](#deprecated-endpoints-removed)), the
|
||||
capability became obsolete, and has also been removed.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Remove any instances of the `appium:eventTimings` capability, and instead use the [getLogEvents](../reference/api/appium.md#getlogevents) endpoint to retrieve event timings
|
||||
|
||||
### Unused Server Arguments Removed
|
||||
|
||||
The following server arguments have had no effect for a long time and have been removed, along with
|
||||
their equivalents in the configuration file:
|
||||
|
||||
* `--callback-address` (`-ca`)
|
||||
* `--callback-port` (`-cp`)
|
||||
* `--debug-log-spacing`
|
||||
* `--shell`
|
||||
* `--strict-caps`
|
||||
* `--trace-dir`
|
||||
|
||||
Passing any of them on the command line now fails with an unrecognized argument error (unless
|
||||
[`--allow-unknown-args`](../reference/cli/server.md) is set), and config files containing them
|
||||
fail schema validation.
|
||||
|
||||
!!! info "Actions Needed"
|
||||
|
||||
Remove these arguments from startup scripts and config files
|
||||
|
||||
## Behavior Fixes
|
||||
|
||||
This is a list of smaller changes that are positioned as fixes, rather than removal of existing
|
||||
functionality, and may or may not be breaking depending on your usecase. The majority of changes
|
||||
are related to alignment with the W3C WebDriver specification, and should not generally require
|
||||
any user action.
|
||||
|
||||
### Session Lifecycle
|
||||
|
||||
* If a successfully created session fails initialization, Appium now attempts to delete the newly
|
||||
created session and removes its registration while preserving the original initialization error
|
||||
([#22873](https://github.com/appium/appium/pull/22873))
|
||||
* The new command idle timeout (`appium:newCommandTimeout`) now only starts after finishing the
|
||||
setup of initial settings and BiDi responses, preventing a session from expiring during
|
||||
initialization ([#22881](https://github.com/appium/appium/pull/22881))
|
||||
* If the new command idle timeout expires and the session deletion process starts, any driver
|
||||
cleanup failures are now logged, instead of becoming an unhandled rejection that can terminate
|
||||
the server and unrelated sessions ([#22964](https://github.com/appium/appium/pull/22964))
|
||||
* Upon session deletion, any commands still waiting in the command queue are now rejected with HTTP
|
||||
`404` / `invalid session id`, instead of remaining pending indefinitely
|
||||
([#22874](https://github.com/appium/appium/pull/22874))
|
||||
|
||||
### Capabilities
|
||||
|
||||
* Names of standard WebDriver capabilities must now be case-sensitive (e.g. `platformName`, not
|
||||
`PlatformName`). Handling of the _values_ of these capabilities, as well as names of prefixed
|
||||
capabilities (e.g. `appium:app`), remains unchanged
|
||||
([#22976](https://github.com/appium/appium/pull/22976))
|
||||
* Malformed capability containers and parse failures now return HTTP `400` / `invalid argument`,
|
||||
instead of HTTP `500` / `session not created`
|
||||
([#22977](https://github.com/appium/appium/pull/22977))
|
||||
* Top-level `null` capabilities are omitted before validation and merging, avoiding false
|
||||
duplicate-key errors. Nested nulls, such as `timeouts: {script: null}`, are preserved
|
||||
([#22975](https://github.com/appium/appium/pull/22975))
|
||||
* Session settings provided inside `appium:options` are now honored
|
||||
([#22882](https://github.com/appium/appium/pull/22882))
|
||||
* The standard `timeouts` capability now correctly initializes BaseDriver's timeout state using
|
||||
the same value checks as the [Set Timeouts](../reference/api/webdriver.md#timeouts) endpoint.
|
||||
Backend handling remains driver-specific ([#22983](https://github.com/appium/appium/pull/22983))
|
||||
* Setting both `appium:noReset` and `appium:fullReset` to `true` now returns HTTP `500` /
|
||||
`session not created` instead of a generic error, and no longer leaves partially initialized
|
||||
session state behind ([#22861](https://github.com/appium/appium/pull/22861),
|
||||
[#22870](https://github.com/appium/appium/pull/22870))
|
||||
* Setting `appium:newCommandTimeout` to `null`, a blank string, or a non-finite numeric value is
|
||||
now ignored (keeping the default timeout value), instead of causing the timeout to be silently
|
||||
disabled ([#22815](https://github.com/appium/appium/pull/22815),
|
||||
[#23103](https://github.com/appium/appium/pull/23103)). Other invalid types, such as negative
|
||||
numbers or nonnumeric strings, still fail capability validation
|
||||
* Percent-encoded credentials in `appium:app` URLs are now decoded once before Basic authentication,
|
||||
and complete HTTP-compressed downloads are no longer rejected if the decompressed file size
|
||||
differs from `Content-Length` ([#22887](https://github.com/appium/appium/pull/22887),
|
||||
[#22886](https://github.com/appium/appium/pull/22886))
|
||||
* Setting `firstMatch` to an empty array (`[]`) is now rejected with HTTP `400` /
|
||||
`invalid argument`, instead of being silently replaced with a single empty entry
|
||||
([#22860](https://github.com/appium/appium/pull/22860))
|
||||
* Every `firstMatch` candidate is now validated and merged before selection. Invalid supplied values
|
||||
or duplicate keys in any candidate reject the request, even if another candidate could match;
|
||||
missing required driver capabilities and unsupported platforms still allow matching to continue
|
||||
([#22982](https://github.com/appium/appium/pull/22982))
|
||||
* Default capabilities (which can be set using `--default-capabilities`) are now applied to each
|
||||
individual `firstMatch` candidate separately. Values set in `alwaysMatch` or the current
|
||||
candidate still take precedence ([#22988](https://github.com/appium/appium/pull/22988)). See
|
||||
[Default Capabilities](../reference/cli/server.md#default-capabilities) for an example.
|
||||
* Session settings are now applied from the selected `firstMatch` candidate, instead of potentially
|
||||
being overridden by later unselected candidates. Defaults and `alwaysMatch` settings are still
|
||||
applied first ([#22882](https://github.com/appium/appium/pull/22882))
|
||||
* Values of the standard `timeouts` capability are now also validated in `alwaysMatch` and every
|
||||
`firstMatch` candidate ([#23062](https://github.com/appium/appium/pull/23062)). A malformed
|
||||
timeout object or invalid standard timeout value is rejected with HTTP `400` /
|
||||
`invalid argument`, even if an earlier `firstMatch` candidate could match. Top-level
|
||||
`timeouts: null` is still omitted, nested null timeout values are preserved, and unknown timeout
|
||||
properties are ignored for validation
|
||||
|
||||
### HTTP Responses
|
||||
|
||||
* All WebDriver HTTP responses now include the `Cache-Control: no-cache` header. Caches must
|
||||
revalidate these responses before reusing them
|
||||
([#22971](https://github.com/appium/appium/pull/22971))
|
||||
* Any WebDriver error `data` (e.g. alert text) is now preserved in driver and proxy responses
|
||||
([#22974](https://github.com/appium/appium/pull/22974))
|
||||
* The body of any `POST` command now has to be a JSON object; requests where the body is empty or
|
||||
set to an empty JSON array (`[]`) return HTTP `400` with `invalid argument`
|
||||
([#23007](https://github.com/appium/appium/pull/23007)). A value of `{}` is still accepted,
|
||||
including commands that take no parameters. Routes that set `payloadParams.wrap` may still accept
|
||||
an empty array
|
||||
* `GET` requests to the server root route (e.g. `GET /` for a default server base path) now return
|
||||
HTTP `404` / `unknown command`, instead of Express's HTML 404 page. Extensions can still register
|
||||
their own root route ([#22969](https://github.com/appium/appium/pull/22969))
|
||||
* `HEAD` requests to any `GET` command URL now return HTTP `405` without executing the `GET`
|
||||
command. Custom server routes and `HEAD` request handlers retain their behavior
|
||||
([#22992](https://github.com/appium/appium/pull/22992))
|
||||
* Driver commands rejecting with `null` or `undefined` now return HTTP `500` / `unknown error`,
|
||||
instead of causing the error handler itself to fail
|
||||
([#22869](https://github.com/appium/appium/pull/22869))
|
||||
* `TimeoutError` and `ScriptTimeoutError` now map to HTTP `500` instead of HTTP `408`
|
||||
([#22686](https://github.com/appium/appium/pull/22686))
|
||||
* A `detached shadow root` error is now preserved as HTTP `404`, instead of being converted to HTTP
|
||||
`500` / `unknown error` ([#22968](https://github.com/appium/appium/pull/22968))
|
||||
|
||||
### Specific Endpoints
|
||||
|
||||
* [New Session](../reference/api/webdriver.md#createsession): now raises the `session not created`
|
||||
error instead of `unknown error` if no installed driver matches the requested platform/automation
|
||||
combination, or the matching driver cannot be loaded or does not export its class. Validation of
|
||||
missing `platformName`/`appium:automationName` is unchanged
|
||||
([#22970](https://github.com/appium/appium/pull/22970))
|
||||
* [Get Timeouts](../reference/api/webdriver.md#gettimeouts): now returns `script` and `pageLoad` in
|
||||
addition to the existing `implicit` and Appium-specific `command` values
|
||||
([#22776](https://github.com/appium/appium/pull/22776))
|
||||
* [Set Timeouts](../reference/api/webdriver.md#timeouts): `script`, `pageLoad`, and `implicit` now
|
||||
only accept null or integer values; strings and fractions return HTTP `400` / `invalid argument`
|
||||
([#22961](https://github.com/appium/appium/pull/22961))
|
||||
* Set Timeouts: `null` values now correctly disable the specified timeout
|
||||
([#22961](https://github.com/appium/appium/pull/22961))
|
||||
* Set Timeouts: omitting `script`, `pageLoad`, or `implicit` no longer fails: omitted fields keep their
|
||||
values and `{}` succeeds without changes. Invalid updates change no values
|
||||
([#22960](https://github.com/appium/appium/pull/22960),
|
||||
[#22961](https://github.com/appium/appium/pull/22961))
|
||||
* Set Timeouts: unknown values for the legacy `type` argument now return HTTP `400` /
|
||||
`invalid argument` instead of HTTP `500` / `unknown error`
|
||||
([#22987](https://github.com/appium/appium/pull/22987))
|
||||
* [getLog](../reference/api/others.md#getlog): unsupported `type` values now return HTTP `400` /
|
||||
`invalid argument` instead of HTTP `500` / `unknown error`
|
||||
([#22986](https://github.com/appium/appium/pull/22986))
|
||||
|
||||
### BiDi Protocol
|
||||
|
||||
* Subscriptions without `contexts` now receive events carrying a context, so that module
|
||||
subscriptions such as `events: ["log"]` now match events such as `log.entryAdded`. Overlapping
|
||||
subscriptions deliver each event only once ([#22883](https://github.com/appium/appium/pull/22883))
|
||||
* The implementation of [`session.subscribe`](../reference/api/bidi.md#bidisubscribe) (which does
|
||||
not yet support `userContexts`) now rejects `userContexts` with HTTP `500` /
|
||||
`unsupported operation`, instead of silently creating an unscoped subscription. Malformed
|
||||
`userContexts`, or supplying both `contexts` and `userContexts`, return HTTP `400` /
|
||||
`invalid argument`. Drivers implementing user-context support can override `bidiSubscribe`
|
||||
([#22877](https://github.com/appium/appium/pull/22877)).
|
||||
* Any `sessionId` or `id` keys inside BiDi command parameters are now validated like any other
|
||||
unknown parameter, instead of being silently accepted
|
||||
([#22771](https://github.com/appium/appium/pull/22771))
|
||||
|
||||
### [Storage Plugin](https://github.com/appium/appium/tree/master/packages/storage-plugin)
|
||||
|
||||
* All [endpoints](../reference/api/plugins.md#storage-plugin) and stream/events WebSocket paths now
|
||||
respect custom server `--base-path` values, instead of always being mounted at the server root
|
||||
([#22906](https://github.com/appium/appium/pull/22906))
|
||||
* File names starting with a dot or ending with `.filepart` are now rejected
|
||||
([#22863](https://github.com/appium/appium/pull/22863),
|
||||
[#22959](https://github.com/appium/appium/pull/22959))
|
||||
* Concurrent WebSocket uploads of the same file are now rejected
|
||||
([#22962](https://github.com/appium/appium/pull/22962))
|
||||
* Pending upload WebSocket routes are now preserved across retries
|
||||
([#22948](https://github.com/appium/appium/pull/22948))
|
||||
* Errors on upload event sockets are now logged instead of potentially terminating the server
|
||||
([#22963](https://github.com/appium/appium/pull/22963))
|
||||
|
||||
### Other Fixes
|
||||
|
||||
* The `appium driver`/`appium plugin` CLI commands now lock the extension manifest while running,
|
||||
preventing any concurrent CLI commands from silently clobbering each other's changes
|
||||
([#22767](https://github.com/appium/appium/pull/22767))
|
||||
* IPv6 literals are now correctly bracketed during URL assembly, including BiDi WebSocket URLs and
|
||||
[Execute Driver Plugin](https://github.com/appium/appium/tree/master/packages/execute-driver-plugin)
|
||||
connections ([#22872](https://github.com/appium/appium/pull/22872),
|
||||
[#22912](https://github.com/appium/appium/pull/22912),
|
||||
[#22914](https://github.com/appium/appium/pull/22914))
|
||||
|
||||
## Developer-Facing Changes
|
||||
|
||||
The following changes primarily affect developers of Appium clients, drivers, plugins, or tools
|
||||
that import Appium's internal packages directly. They do not affect most Appium end users.
|
||||
|
||||
### Extension Development
|
||||
|
||||
* When installing a locally available driver/plugin using Appium's CLI `install` command with the
|
||||
`--source=local` flag, Appium now installs the extension directly from the supplied local
|
||||
directory, without first creating an intermediate global `npm` link
|
||||
([#23086](https://github.com/appium/appium/pull/23086)). Local installs still link to the source
|
||||
directory, so source changes do not require reinstalling the extension. If you use tooling that
|
||||
relies on the package being linked in `npm`'s global prefix, manage that global link separately.
|
||||
* Extension manifests and `extensions.yaml` are now validated with `ajv`/JSON Schema; a corrupted
|
||||
`extensions.yaml` now resets to an empty manifest with a warning, instead of crashing later with a
|
||||
confusing error ([#22732](https://github.com/appium/appium/pull/22732))
|
||||
* `ExecuteMethodMap` type declarations now check `params` against the target method's signature at
|
||||
compile time, catching mismatched required/optional execute method parameters in driver code
|
||||
([#22754](https://github.com/appium/appium/pull/22754))
|
||||
* When a plugin intercepts a command that would otherwise be proxied downstream, Appium no longer
|
||||
validates its fields or values ([#23060](https://github.com/appium/appium/pull/23060)). This
|
||||
matches direct proxying, where the downstream remote end owns these checks. Plugins that
|
||||
previously relied on Appium to validate these arguments can now receive missing or invalid
|
||||
values (JSON-object request-body checks still remain in place before the plugin is called). If
|
||||
your plugin handles such a command without calling `next()`, validate the inputs it uses.
|
||||
Pass-through plugins can still call `next()` and delegate validation to the downstream remote end.
|
||||
|
||||
### `@appium/base-driver`
|
||||
|
||||
#### JSONWP/MJSONWP Removal
|
||||
|
||||
As listed [in the Breaking Changes section above](#jsonwpmjsonwp-internals-removed), the internal
|
||||
code responsible for JSONWP/MJSONWP protocol support has been removed
|
||||
([#22681](https://github.com/appium/appium/pull/22681)). This includes the following items:
|
||||
|
||||
* `ProtocolError` instances no longer carry a `jsonwpCode` property, and error responses no longer
|
||||
include a legacy numeric `status` code (`errorFromMJSONWPStatusCode`, aliased as `errorFromCode`,
|
||||
has been removed; use `errorFromW3CJsonCode`)
|
||||
* Responses no longer duplicate element references under the legacy `ELEMENT` key; only the W3C
|
||||
`element-6066-11e4-a52e-4f735466cecf` key is present
|
||||
* `WebDriverProxy` (formerly `JWProxy`, now removed as a name) no longer converts responses from a
|
||||
downstream automation server speaking legacy MJSONWP; downstream servers must speak W3C WebDriver
|
||||
* `determineProtocol`, `DriverCore#setProtocolMJSONWP()`, and `DriverCore#isMjsonwpProtocol()` have
|
||||
been removed; drivers can no longer produce the legacy `{sessionId, status, value}` response shape
|
||||
* `statusCodes` and `getSummaryByCode` are no longer available (the `jsonwp-status` module has been
|
||||
removed)
|
||||
* A command result shaped like `{protocol, value}` is no longer unwrapped. It is sent to the
|
||||
client as the command value, so a script returning `{protocol: 'W3C', value: 5}` gets that object
|
||||
back. A result of `{protocol, error}` whose `protocol` is `W3C` or `MJSONWP` and whose `error`
|
||||
is an `Error` is still thrown
|
||||
|
||||
#### HTTP Server Moved to Separate Package
|
||||
|
||||
The HTTP/Express server code has been extracted from `@appium/base-driver` into the new
|
||||
`@appium/http-server` package ([#22800](https://github.com/appium/appium/pull/22800)). The
|
||||
following items are therefore no longer exported from `@appium/base-driver` or `appium/driver.js`:
|
||||
|
||||
* Methods: `server`, `normalizeBasePath`, `configureServer`
|
||||
* Types: `ServerOpts`, `ConfigureServerOpts`, `ConfigureHttpOpts`, `StartServerOpts`
|
||||
|
||||
If you use these items, import them from `@appium/http-server` instead.
|
||||
|
||||
#### Other Changes
|
||||
|
||||
* The default class export has been removed
|
||||
([#22741](https://github.com/appium/appium/pull/22741)). Use the named `{BaseDriver}` export
|
||||
instead
|
||||
* The default export of `basedriver/helpers.js` has been removed
|
||||
([#22741](https://github.com/appium/appium/pull/22741)). Use named exports instead
|
||||
* `BaseDriver`'s constructor no longer takes command-mixin machinery into account
|
||||
([#22741](https://github.com/appium/appium/pull/22741))
|
||||
* `createSession()` no longer accepts the legacy multi-argument form
|
||||
(`jwpCaps, reqCaps, w3cCaps`); only the single `w3cCapabilities` argument is supported now
|
||||
([#22730](https://github.com/appium/appium/pull/22730))
|
||||
* The deprecated `driverData` mechanism (`Core.driverData`, the `driverData` parameter on
|
||||
`createSession`/`deleteSession`, and the `DriverData` type) has been removed
|
||||
([#22716](https://github.com/appium/appium/pull/22716)). Migrate to `IAppiumIpc` instead
|
||||
* The `server()` and `configureServer()` methods (now exported by `@appium/http-server`) now
|
||||
default to `allowCors: false` ([#22990](https://github.com/appium/appium/pull/22990))
|
||||
* Both `ipc.unsubscribe(topic, subscriber)` and `subscription.unsubscribe()` now finish waiting on
|
||||
async iterators and notify observers once ([#22955](https://github.com/appium/appium/pull/22955)).
|
||||
An observer that throws still propagates its error to the caller, but no longer prevents waiting
|
||||
iterators from finishing
|
||||
* The unused `reset()` method has been removed
|
||||
([#22741](https://github.com/appium/appium/pull/22741))
|
||||
* The `generateDriverLogPrefix()` helper no longer supports the deprecated `sessionId` argument
|
||||
([#22764](https://github.com/appium/appium/pull/22764))
|
||||
* The new command idle timeout now stays suspended through HTTP/BiDi plugin chains, including work
|
||||
after `next()`, and while proxied BiDi commands await a response
|
||||
([#22946](https://github.com/appium/appium/pull/22946),
|
||||
[#22947](https://github.com/appium/appium/pull/22947)). Custom `startNewCommandTimeout`
|
||||
implementations must delegate timer creation to `super.startNewCommandTimeout()` so they respect
|
||||
shared activity, while custom command execution must delegate to `super.executeCommand()` or wrap
|
||||
the full command in `runWithCommandTimeout`
|
||||
* The `appium:autoLaunch`, `appium:locale`, `appium:language`, `appium:autoWebview`,
|
||||
`appium:orientation`, and `appium:udid` capabilities are no longer validated as part of the
|
||||
standard capability constraints ([#22950](https://github.com/appium/appium/pull/22950),
|
||||
[#22952](https://github.com/appium/appium/pull/22952)). If you use them, declare them in your own
|
||||
driver constraints
|
||||
* The built-in test fixture routes (`/welcome`, `/test/guinea-pig*`, `/produce_error`, `/crash`),
|
||||
the `STATIC_DIR` export, and the `APPIUM_ENABLE_LEGACY_TEST_PAGES` environment variable have been
|
||||
removed ([#22680](https://github.com/appium/appium/pull/22680)). If you relied on these fixtures,
|
||||
migrate to use your own local test server
|
||||
|
||||
### `@appium/base-plugin`
|
||||
|
||||
* The default class export has been removed ([#22718](https://github.com/appium/appium/pull/22718)).
|
||||
Use the named `{BasePlugin}` export instead
|
||||
* `Plugin#logger` has been removed in favor of `Plugin#log`
|
||||
([#22718](https://github.com/appium/appium/pull/22718))
|
||||
* `Plugin#name` and `Plugin#cliArgs` are now read-only
|
||||
([#22718](https://github.com/appium/appium/pull/22718))
|
||||
|
||||
### `@appium/logger`
|
||||
|
||||
* The default class export has been removed ([#22719](https://github.com/appium/appium/pull/22719)).
|
||||
Use the named `{log}` export instead
|
||||
* The long-disabled, no-op progress/unicode methods (`enableProgress`, `disableProgress`,
|
||||
`progressEnabled`, `enableUnicode`, `disableUnicode`) have been removed
|
||||
([#22719](https://github.com/appium/appium/pull/22719))
|
||||
|
||||
### `@appium/support`
|
||||
|
||||
* `env`: the module has been integrated into the `appium` package as internal helpers
|
||||
([#22708](https://github.com/appium/appium/pull/22708))
|
||||
* `imageUtil`: the module has been removed ([#22678](https://github.com/appium/appium/pull/22678))
|
||||
* `fs`: the following exports have been removed: `readPackageJsonFrom` and `findRoot` methods,
|
||||
`F_OK`/`R_OK`/`W_OK`/`X_OK` constants, `CopyFileDescriptor` and `ReadFn` types
|
||||
([#22678](https://github.com/appium/appium/pull/22678))
|
||||
* `fs`: `glob()` now relies on Node's `fs.promises.glob` instead of the `glob` package, with a
|
||||
narrower `GlobOptions` shape ([#22735](https://github.com/appium/appium/pull/22735))
|
||||
* `fs`: `mv()` now preserves symlinks inside moved directories and moves source symlinks themselves
|
||||
without moving their targets' contents. Dangling source links are supported, and Windows
|
||||
case-only renames update the entry's spelling
|
||||
([#22880](https://github.com/appium/appium/pull/22880),
|
||||
[#22954](https://github.com/appium/appium/pull/22954),
|
||||
[#22958](https://github.com/appium/appium/pull/22958))
|
||||
* `fs`: `walkDir()` now continues after walker errors such as `EACCES` and `ELOOP` instead of
|
||||
hanging. These errors are logged and affected entries are skipped; `ENOENT` still rejects the
|
||||
returned promise ([#22956](https://github.com/appium/appium/pull/22956))
|
||||
* `fs`: `write()` now relies on Node's `promisify`, which resolves to an object
|
||||
(`{bytesWritten, buffer}`), instead of only `bytesWritten`
|
||||
([#22704](https://github.com/appium/appium/pull/22704))
|
||||
* `logger`: the default export has been removed. Use the named `{log}` export instead
|
||||
([#22719](https://github.com/appium/appium/pull/22719))
|
||||
* `logger`: `errorAndThrow` has been removed in favor of `errorWithException`
|
||||
([#22719](https://github.com/appium/appium/pull/22719))
|
||||
* `net`: support for FTP-based file uploads has been removed, along with the `FtpUploadOptions` and
|
||||
`NotHttpUploadOptions` types ([#22678](https://github.com/appium/appium/pull/22678))
|
||||
* `net`: the new `checkPortStatus()` and `getFreePort()` helpers replace the `portscanner` package
|
||||
and custom free port lookups in drivers and plugins
|
||||
([#23156](https://github.com/appium/appium/pull/23156)). Unlike `portscanner`, they accept an
|
||||
options object instead of positional arguments. `getFreePort()` also covers `findAPortNotInUse()`:
|
||||
pass `port` (a single port or a `[startPort, endPort]` range) to probe specific ports, in which
|
||||
case it throws `NoFreePortError` if all of them are busy instead of resolving with `false`
|
||||
* `mjpeg`: the module has been removed ([#22678](https://github.com/appium/appium/pull/22678))
|
||||
* `mkdirp`: the module has been removed ([#22678](https://github.com/appium/appium/pull/22678)).
|
||||
Import `mkdirp()` from the `fs` module instead
|
||||
* `node`: `requirePackage()` has been removed
|
||||
([#22684](https://github.com/appium/appium/pull/22684))
|
||||
* `npm`: the module has been integrated into the `appium` package as internal helpers
|
||||
([#22721](https://github.com/appium/appium/pull/22721))
|
||||
* `process`: the module has been removed ([#22678](https://github.com/appium/appium/pull/22678))
|
||||
* `system`: `macOsxVersion()` has been removed
|
||||
([#22684](https://github.com/appium/appium/pull/22684))
|
||||
* `util`: the following methods have been removed: `uuidV1`, `uuidV3`, `uuidV5`, `localIp`,
|
||||
`cancellableDelay`, and `multiResolve` ([#22678](https://github.com/appium/appium/pull/22678))
|
||||
* `zip`: `extractAllTo()` always uses the built-in JS extractor now, so the `useSystemUnzip` option
|
||||
has been removed ([#23091](https://github.com/appium/appium/pull/23091)). The extractor supports
|
||||
only stored and deflate entries and verifies the CRC32 of every entry. File names that are not
|
||||
flagged as UTF-8 by the archive are decoded as `utf8` by default, and the legacy `cp437` decoding
|
||||
is no longer supported. Other single-byte encodings supported by Node.js can be selected via
|
||||
`fileNamesEncoding`. Archives with encrypted entries or other compression methods are rejected
|
||||
with `ZipStreamUnsupportedError`
|
||||
|
||||
### `@appium/tsconfig`
|
||||
|
||||
* `noImplicitOverride` is now set to `true`, which means that TypeScript drivers and plugins that
|
||||
extend the config must mark every member overriding a base class member (e.g. `BaseDriver` or
|
||||
`BasePlugin` methods, and `static` fields such as `newMethodMap`) with the `override` modifier
|
||||
([#23143](https://github.com/appium/appium/pull/23143)). Opt-out is also possible by setting
|
||||
`noImplicitOverride` to `false` in your own `tsconfig.json`.
|
||||
|
||||
### Client Development
|
||||
|
||||
* State-changing HTTP requests with an `Origin` header now return HTTP `403`, unless the CORS
|
||||
insecure feature is enabled on the Appium server
|
||||
([#23102](https://github.com/appium/appium/pull/23102)). Remove the `Origin` header or instruct
|
||||
users to enable CORS.
|
||||
|
||||
## New Features
|
||||
|
||||
### App URL Rules
|
||||
|
||||
The new `--app-url-rules` server CLI flag (and its equivalent configuration file property) allows
|
||||
server hosts to restrict the host/IP values allowed in capabilities like `appium:app`. Configurable
|
||||
properties include allow/deny lists, HTTPS-only, credentials, and redirect limits.
|
||||
|
||||
Refer to [the Security guide](./security.md#restricting-remote-app-urls) for more details.
|
||||
|
||||
### CLI Update Command Checks Server Requirement
|
||||
|
||||
As a follow-up to Appium 3.9, which changed the default behavior of the Appium CLI
|
||||
[`install`](../reference/cli/extensions.md#install) command to install the newest extension version
|
||||
that is compatible with the current server (as opposed to throwing an error if the server
|
||||
requirement of the latest extension version is incompatible), Appium 4 adjusts the
|
||||
[`update`](../reference/cli/extensions.md#update) command to now implement this behavior as well.
|
||||
|
||||
This makes default usage of both `install` and `update` safe even when future major extension
|
||||
versions raise their server requirements.
|
||||
|
||||
### Commands Can Bypass Queue
|
||||
|
||||
Driver commands (endpoints) are now allowed to bypass the default command queue, which enables the
|
||||
command to execute while another long-running command is in progress.
|
||||
|
||||
By default, only the standard [Status](../reference/api/webdriver.md#getstatus) endpoint is exempt
|
||||
from the queue, but driver developers can also customize the list of exempt commands by overriding
|
||||
the `queueExemptCommands` getter.
|
||||
|
||||
The behavior of the idle timer (set by `appium:newCommandTimeout`) has also been adjusted to only
|
||||
reset once no commands are executing.
|
||||
|
||||
### New Set Timeouts Parameter
|
||||
|
||||
The standard [Set Timeouts](../reference/api/webdriver.md#timeouts) endpoint has been extended to
|
||||
additionally accept the Appium-specific `command` parameter. This aligns its handling with
|
||||
[Get Timeouts](../reference/api/webdriver.md#gettimeouts), which already returned this parameter.
|
||||
The parameter itself is mapped to the `appium:newCommandTimeout` capability.
|
||||
|
||||
The non-standard `type`/`ms` parameters, which were previously the only way to change this timeout
|
||||
mid-session, have been deprecated as a result.
|
||||
|
||||
### Universal XML Plugin Can Be Toggled
|
||||
|
||||
The [Universal XML plugin](https://github.com/appium/appium/tree/master/packages/universal-xml-plugin)
|
||||
now provides the [`universalXml: setEnabled` and `universalXml: isEnabled` execute methods](../reference/api/plugins.md#universal-xml-plugin),
|
||||
which allow toggling the translation during a session, e.g. to retrieve the original page source.
|
||||
@@ -37,10 +37,6 @@ sessions the feature should apply. The prefix can be either the driver's `automa
|
||||
wildcard (`*`) symbol, if the feature should be applied to all drivers. The prefix and feature name
|
||||
are separated using the colon character (`:`).
|
||||
|
||||
Use the driver's `automationName`, which may differ from its install name. An install-name-only
|
||||
prefix does not enable or disable a feature. When configuring a session, Appium warns about such
|
||||
entries for that driver unless the prefix is another installed driver's `automationName`.
|
||||
|
||||
For example, `first:foo` refers to the `foo` feature for the `first` driver, whereas `*:bar` refers
|
||||
to the `bar` feature for all drivers.
|
||||
|
||||
@@ -89,118 +85,3 @@ Turn on multiple insecure features for specific drivers:
|
||||
```bash
|
||||
appium --allow-insecure=uiautomator2:adb_shell,xcuitest:get_server_logs
|
||||
```
|
||||
|
||||
## Restricting Remote App URLs
|
||||
|
||||
Several drivers accept a URL instead of a local path in capabilities such as `appium:app`, in which
|
||||
case the Appium server downloads the application package from that URL before starting the session.
|
||||
By default, any `http:` or `https:` URL is accepted. Server hosts who want to control which URLs
|
||||
their server is allowed to download from can do so with the `--app-url-rules` argument (or the
|
||||
`server.app-url-rules` property in a [configuration file](./config.md)). Its value is a JSON object
|
||||
(or a path to a JSON file) with any of the following properties:
|
||||
|
||||
|<div style="width:10em">Rule</div>|Description|Default|
|
||||
|----------------------------------|-----------|-------|
|
||||
|`allow`|List of hostname patterns, IP addresses, or CIDR subnets. If non-empty, a hostname or its resolved address must match _at least one_|`[]`|
|
||||
|`deny`|List of hostname patterns, IP addresses, or CIDR subnets. A matching hostname or resolved address is rejected, even if an `allow` rule also matches|`[]`|
|
||||
|`httpsOnly`|Only accept `https:` URLs|`false`|
|
||||
|`allowCredentials`|Accept URLs containing a username and/or password (e.g. `https://user:pass@host/app.apk`)|`true`|
|
||||
|`maxRedirects`|Maximum number of HTTP redirects to follow while downloading. Set to `0` to reject any redirect|`21`|
|
||||
|
||||
Hostnames are normalized (lowercased, converted to Punycode, trailing dot removed) before matching
|
||||
and resolved on every download. Address rules apply to literal addresses and all dynamically
|
||||
resolved IPv4/IPv6 addresses. The rules are also applied to every redirect, so redirects cannot be
|
||||
used to escape them. If a URL violates any rule, the session is not created and a generic error
|
||||
is returned. The violated rule is deliberately neither reported to the client nor written to the
|
||||
server log, since server logs are often handed over to clients as well. URL schemes, ports, paths,
|
||||
queries, and fragments are not matched.
|
||||
|
||||
Hostname patterns use the [picomatch](https://github.com/micromatch/picomatch#globbing-features)
|
||||
glob syntax and are matched against the whole hostname:
|
||||
|
||||
|Pattern|Matches|
|
||||
|-------|-------|
|
||||
|`artifacts.example.com`|Exactly this hostname|
|
||||
|`*.example.com`|Any subdomain of `example.com` (including nested ones, like `a.b.example.com`), but not `example.com` itself|
|
||||
|`*example.com`|Any hostname ending with `example.com`, including `example.com` itself|
|
||||
|`apps.{staging,prod}.example.com`|`apps.staging.example.com` and `apps.prod.example.com`|
|
||||
|`build-?.example.com`|`build-1.example.com`, `build-a.example.com`, etc.|
|
||||
|`node[0-9].example.com`|`node0.example.com` to `node9.example.com`|
|
||||
|
||||
IP address rules match a single address (`192.0.2.10`, `2001:db8::1`) or a whole subnet in CIDR
|
||||
notation (`10.0.0.0/8`, `2001:db8::/32`). IPv4 rules also match IPv4-mapped IPv6 addresses
|
||||
(e.g. `::ffff:10.1.2.3`).
|
||||
|
||||
!!! note
|
||||
|
||||
These rules only apply to URLs the server downloads via the standard app configuration helper,
|
||||
which is used for `appium:app` and similar capabilities by all official drivers. Drivers may
|
||||
define custom capabilities with URLs that are processed differently and thus are not covered.
|
||||
|
||||
!!! note
|
||||
|
||||
If the server downloads applications through an HTTP proxy (configured via the `HTTP_PROXY`,
|
||||
`HTTPS_PROXY` and `NO_PROXY` environment variables), the proxy resolves the destination host
|
||||
itself, so rules containing IP addresses or subnets cannot be enforced for proxied downloads.
|
||||
Such downloads are rejected; either exclude the download hosts from proxying via `NO_PROXY`
|
||||
or only use hostname-based rules.
|
||||
|
||||
### Examples
|
||||
|
||||
Only allow HTTPS downloads from an internal artifact server, without credentials in the URL and
|
||||
without following redirects:
|
||||
|
||||
```bash
|
||||
appium --app-url-rules='{"allow": ["artifacts.example.com", "10.0.0.0/8"], "httpsOnly": true, "allowCredentials": false, "maxRedirects": 0}'
|
||||
```
|
||||
|
||||
The same configuration as part of a config file:
|
||||
|
||||
```yaml
|
||||
server:
|
||||
app-url-rules:
|
||||
allow:
|
||||
- 'artifacts.example.com'
|
||||
- '10.0.0.0/8'
|
||||
httpsOnly: true
|
||||
allowCredentials: false
|
||||
maxRedirects: 0
|
||||
```
|
||||
|
||||
Allow downloads from any subdomain of `example.com` and from two IPv6 subnets, except from the
|
||||
staging environment:
|
||||
|
||||
```yaml
|
||||
server:
|
||||
app-url-rules:
|
||||
allow:
|
||||
- '*.example.com'
|
||||
- '2001:db8:1::/48'
|
||||
- '2001:db8:2::/48'
|
||||
deny:
|
||||
- '*.staging.example.com'
|
||||
```
|
||||
|
||||
Allow downloads from anywhere, except from the server itself, private networks, link-local
|
||||
addresses (such as cloud metadata services), and any `.internal` hostname:
|
||||
|
||||
```yaml
|
||||
server:
|
||||
app-url-rules:
|
||||
deny:
|
||||
- 'localhost'
|
||||
- '*.internal'
|
||||
- '127.0.0.0/8'
|
||||
- '10.0.0.0/8'
|
||||
- '172.16.0.0/12'
|
||||
- '192.168.0.0/16'
|
||||
- '169.254.0.0/16'
|
||||
- '::1/128'
|
||||
- 'fc00::/7'
|
||||
- 'fe80::/10'
|
||||
```
|
||||
|
||||
The rules in the last example are applied to the addresses each hostname resolves to, so they
|
||||
cannot be bypassed via DNS. Note that the `deny` list also blocks any download from the server's
|
||||
own private network, so a private artifact server must be excluded from the `deny` rules in order
|
||||
to work.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
hide:
|
||||
- toc
|
||||
|
||||
title: SSL/TLS Support
|
||||
title: SSL/TLS/SPDY Support
|
||||
---
|
||||
|
||||
Appium 2.2 introduces the option to start the Appium server with SSL/TLS support.
|
||||
@@ -19,14 +19,15 @@ Both arguments must be provided and should contain paths to a valid
|
||||
[X509 PEM](https://www.ssl.com/guide/pem-der-crt-and-cer-x-509-encodings-and-conversions/)
|
||||
certificate and its corresponding private key.
|
||||
|
||||
After the server is started use the `https` protocol and a client supporting SSL/TLS to
|
||||
communicate to it.
|
||||
After the server is started use the `https` protocol and a client supporting SSL/TLS or
|
||||
[SPDY](https://en.wikipedia.org/wiki/SPDY) to communicate to it.
|
||||
|
||||
### Supported Features
|
||||
|
||||
Once a secure server socket is established it uses Node.js' native
|
||||
[`https`](https://nodejs.org/api/https.html) module to serve connections. All insecure client
|
||||
connections will be rejected by the server.
|
||||
Once a secure server socket is established it supports the following protocols:
|
||||
`['h2', 'spdy/3.1', 'spdy/3', 'spdy/2', 'http/1.1', 'http/1.0']`. See
|
||||
[the SPDY node module documentation](https://www.npmjs.com/package/spdy) to get more details about
|
||||
its features. All insecure client connections will be rejected by the server.
|
||||
|
||||
### Self-Signed Certificates
|
||||
|
||||
|
||||
@@ -39,16 +39,6 @@ So, for example, the `Find Element` command corresponds to an HTTP `POST` reques
|
||||
endpoint `/session/:sessionid/element` (where in this case, `:sessionid` is a placeholder for the
|
||||
unique session ID generated by the server in a previous call to `Create Session`).
|
||||
|
||||
If the client disconnects before Appium finishes sending a `Create Session` response and the
|
||||
request has no `X-Idempotency-Key`, Appium deletes the new session once driver setup completes.
|
||||
Setup is not interrupted. With an accepted idempotency key, a retry that arrives before setup
|
||||
finishes waits for the same session ID, or the same error if setup failed. If the original client
|
||||
and all waiting retries disconnect before setup finishes, Appium deletes the new session and
|
||||
discards its cached result; a later retry starts a new session. Otherwise, Appium keeps the session
|
||||
and caches its response for replay while it remains in the bounded, in-memory idempotency cache.
|
||||
Disconnecting after a response was sent, or during a command in an existing session, does not
|
||||
automatically end that session. Use `Delete Session` when you are done.
|
||||
|
||||
This information is primarily useful for people developing technology that works with the WebDriver
|
||||
spec. It's not particularly useful for people trying to write Appium or Selenium tests. When you
|
||||
write an Appium test, you want to use a programming language you're familiar with. Luckily, there
|
||||
|
||||
@@ -19,7 +19,7 @@ Appium, called `BaseDriver`. You could have something very close to a "working"
|
||||
very simple lines of code:
|
||||
|
||||
```js
|
||||
import {BaseDriver} from '@appium/base-driver'
|
||||
import BaseDriver from '@appium/base-driver'
|
||||
|
||||
class MyNewDriver extends BaseDriver {
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
# Appium
|
||||
|
||||
Appium is an open-source framework for UI automation of many app platforms - mobile (iOS,
|
||||
Android, Tizen), browser (Chrome, Firefox, Safari), desktop (macOS, Windows), TV (Roku, tvOS,
|
||||
Android TV, Samsung), smartwatch (watchOS, Android Wear) and more - driven over the W3C WebDriver
|
||||
protocol.
|
||||
> Appium is an open-source framework for UI automation of many app platforms - mobile (iOS, Android, Tizen), browser (Chrome, Firefox, Safari), desktop (macOS, Windows), TV (Roku, tvOS, Android TV, Samsung) and more - driven over the W3C WebDriver protocol.
|
||||
|
||||
Appium is split into four parts: the Appium server, which defines the core APIs; drivers, which
|
||||
implement connectivity to a specific platform; clients, which implement Appium's API in a specific
|
||||
@@ -12,12 +9,14 @@ anything you need the server, at least one driver, and a client.
|
||||
|
||||
Notes for tools generating Appium code from this documentation:
|
||||
|
||||
- Appium 4 is the current major version, and these pages describe Appium 4. Older Appium versions
|
||||
are not supported, but the documentation for Appium 2 and 3 is still available under their own
|
||||
versions of this site, reachable from the version selector.
|
||||
- Appium 3 is the current major version, and these pages describe Appium 3. Appium 2 is still
|
||||
supported but is documented separately, under its own version of this site, reachable from the
|
||||
version selector. Appium 1 is no longer supported: `DesiredCapabilities`, `MobileBy`, the
|
||||
`findElementByAccessibilityId` family of methods, and the `/wd/hub` server base path are all
|
||||
Appium 1 era patterns - the default base path has been `/` since Appium 2.
|
||||
- Drivers are not bundled with the server. Install them explicitly, for example
|
||||
`appium driver install uiautomator2` or `appium driver install xcuitest`.
|
||||
- Appium 4 requires Node.js in the range `^22.22.2 || ^24.15.0 || >=26.0.0`, and npm 10 or newer.
|
||||
- Appium 3 requires Node.js in the range `^20.19.0 || ^22.12.0 || >=24.0.0`, and npm 10 or newer.
|
||||
- Standard W3C capabilities are written without a prefix. `platformName`, `browserName` and
|
||||
`browserVersion` are the ones used most often with Appium, and the rest of the specification's
|
||||
set - `acceptInsecureCerts`, `pageLoadStrategy`, `timeouts`, `webSocketUrl` and so on - is also
|
||||
@@ -33,14 +32,10 @@ Notes for tools generating Appium code from this documentation:
|
||||
- Beyond the small common set documented here, capabilities, execute methods, settings and locator
|
||||
strategies are defined by each driver and documented on that driver's own site. Refer users to
|
||||
the driver's documentation rather than guessing names.
|
||||
- If upgrading to a new major version of Appium, always check all relevant migration guides. Every
|
||||
major version has its own dedicated migration guide.
|
||||
- Appium 4 moves to ESM-only packaging and no longer supports the Windows driver. Refer users to
|
||||
the WinCore driver instead.
|
||||
- Appium 4 replaces the `--allow-cors` server flag with `--allow-insecure=*:cors`. Do not use the
|
||||
former flag anymore.
|
||||
- Appium 3 and 4 removed various deprecated endpoints. Check the respective migration guides before
|
||||
using an endpoint carried over from older code.
|
||||
- Appium 3 removed many endpoints that were deprecated in Appium 2. Check the Appium 3 migration
|
||||
guide before using an endpoint carried over from older code.
|
||||
- `GET /sessions` was removed. Session discovery is now `GET /appium/sessions`, and requires
|
||||
starting the server with `--allow-insecure=*:session_discovery`.
|
||||
- In Appium 3, every `--allow-insecure` feature name must carry a scope prefix: either a driver
|
||||
name (`uiautomator2:adb_shell`) or the wildcard (`*:adb_shell`).
|
||||
- WebDriver BiDi support is opt-in per session, via the standard `webSocketUrl` capability.
|
||||
@@ -71,7 +66,7 @@ Which driver you install determines which platform you can automate, and the dri
|
||||
documentation is the authoritative source for its capabilities and commands.
|
||||
|
||||
- [The Appium Ecosystem](https://appium.io/docs/en/latest/ecosystem/): index of officially-supported and community-supported Appium projects.
|
||||
- [Appium Drivers](https://appium.io/docs/en/latest/ecosystem/drivers/): every known driver with its install command and documentation link. Official drivers include UiAutomator2 and Espresso (Android), XCUITest (iOS, iPadOS, tvOS, watchOS), Mac2 (macOS), WinCore, Chromium, Gecko and Safari. Appium 2 and 3 feature the Windows driver instead of WinCore.
|
||||
- [Appium Drivers](https://appium.io/docs/en/latest/ecosystem/drivers/): every known driver with its install command and documentation link. Official drivers include UiAutomator2 and Espresso (Android), XCUITest (iOS, iPadOS, tvOS, watchOS), Mac2 (macOS), Windows, Chromium, Gecko and Safari.
|
||||
- [Appium Clients](https://appium.io/docs/en/latest/ecosystem/clients/): official clients for Java, Python, Ruby and .NET, plus community clients including WebdriverIO, Nightwatch.js, Robot Framework, Rust and Swift.
|
||||
- [Appium Plugins](https://appium.io/docs/en/latest/ecosystem/plugins/): optional extensions that modify or extend server behaviour. Not required for standard automation.
|
||||
- [Appium-Related Tools](https://appium.io/docs/en/latest/ecosystem/tools/): tools for installation, test development and inspection, such as Appium Inspector, and tools for driving Appium from an AI agent, such as the Appium MCP server and the Appium agent skills.
|
||||
@@ -84,10 +79,9 @@ documentation is the authoritative source for its capabilities and commands.
|
||||
- [Capabilities](https://appium.io/docs/en/latest/reference/session/caps/): the full list of capabilities recognized by the Appium server and base driver, and therefore supported by every driver.
|
||||
- [Session Settings](https://appium.io/docs/en/latest/guides/settings/): parameters that, unlike capabilities, can be adjusted while a session is running.
|
||||
- [Execute Methods](https://appium.io/docs/en/latest/guides/execute-methods/): the `mobile:` command convention that drivers use to expose commands beyond the WebDriver spec, with examples in every official client language.
|
||||
- [Automating Gestures](https://appium.io/docs/en/latest/guides/gestures/): approaches for automating gestures, including several examples for various touch gestures using the W3C Actions API.
|
||||
- [Managing Contexts](https://appium.io/docs/en/latest/guides/context/): switching between native and webview modes with the Get Contexts, Get Current Context and Set Context commands.
|
||||
- [Caching of Application Bundles](https://appium.io/docs/en/latest/guides/caching/): how the base driver caches application builds, and how to use it for faster suite execution.
|
||||
- [Retrieving Event Timings](https://appium.io/docs/en/latest/guides/event-timing/): startup and command timing information, retrieved from the `POST /session/:sessionId/appium/events` endpoint.
|
||||
- [Retrieving Event Timings](https://appium.io/docs/en/latest/guides/event-timing/): startup and command timing information, retrieved from the `POST /session/:sessionId/appium/events` endpoint. The `appium:eventTimings` capability described on that page is not required for the endpoint to work, and is being removed in Appium 4.
|
||||
|
||||
## Server configuration and the command line
|
||||
|
||||
@@ -99,13 +93,13 @@ documentation is the authoritative source for its capabilities and commands.
|
||||
- [The Appium Config File](https://appium.io/docs/en/latest/guides/config/): supplying server arguments through a config file instead of the command line. CLI arguments take precedence.
|
||||
- [Filtering the Appium Log](https://appium.io/docs/en/latest/guides/log-filters/): redacting passwords, device identifiers and other sensitive values from server logs with `--log-filters`.
|
||||
- [Header Handling](https://appium.io/docs/en/latest/guides/headers/): request ID tracking through the `x-request-id` header.
|
||||
- [SSL/TLS Support](https://appium.io/docs/en/latest/guides/tls/): starting the server with secure connections enabled.
|
||||
- [SSL/TLS/SPDY Support](https://appium.io/docs/en/latest/guides/tls/): starting the server with secure connections enabled.
|
||||
- [Appium and Selenium Grid](https://appium.io/docs/en/latest/guides/grid/): relaying commands from a Selenium Grid to an Appium server.
|
||||
|
||||
## Security
|
||||
|
||||
- [Appium Server Security](https://appium.io/docs/en/latest/guides/security/): the insecure-feature mechanism with the `--allow-insecure`, `--deny-insecure` and `--relaxed-security` flags, and configuration options for application URL rules.
|
||||
- [Insecure Features](https://appium.io/docs/en/latest/reference/cli/insecure-features/): the features defined at the server and official-plugin level, including `session_discovery`, `cors`, and `execute_driver_script`. Drivers define their own in their own documentation.
|
||||
- [Appium Server Security](https://appium.io/docs/en/latest/guides/security/): the insecure-feature mechanism, and the `--allow-insecure`, `--deny-insecure` and `--relaxed-security` flags. In Appium 3 every feature name requires a scope prefix.
|
||||
- [Insecure Features](https://appium.io/docs/en/latest/reference/cli/insecure-features/): the features defined at the server and official-plugin level, including `session_discovery` and `execute_driver_script`. Drivers define their own in their own documentation.
|
||||
|
||||
## API endpoints
|
||||
|
||||
@@ -119,7 +113,6 @@ documentation is the authoritative source for its capabilities and commands.
|
||||
|
||||
## Migrating between major versions
|
||||
|
||||
- [Migrating to Appium 4](https://appium.io/docs/en/latest/guides/migrating-3-to-4/): breaking changes from Appium 3 to 4 - the Node 22 minimum, ESM-only requirement, removed endpoints, the Windows driver replacement, and more.
|
||||
- [Migrating to Appium 3](https://appium.io/docs/en/latest/guides/migrating-2-to-3/): every breaking change from Appium 2 to 3 - the Node 20 minimum, removed and modified endpoints, the mandatory `--allow-insecure` scope prefix, and the move from `GET /sessions` to `GET /appium/sessions`.
|
||||
- [Migrating to Appium 2](https://appium.io/docs/en/latest/guides/migrating-1-to-2/): the Appium 1 to 2 changes, including drivers becoming separately installed extensions and the default base path changing from `/wd/hub` to `/`.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ The basic plan for this quickstart is as follows:
|
||||
|
||||
1. Install Appium
|
||||
1. Install an Appium driver and its dependencies
|
||||
- This guide provides instructions for the [UiAutomator2 driver](https://appium.github.io/appium-uiautomator2-driver)
|
||||
- This guide provides instructions for the [UiAutomator2 driver](https://appium.github.io/appium-uiautomator2-driver/)
|
||||
1. Install an Appium client library in your language of choice
|
||||
- This guide contains options for JavaScript, Python, Java, Ruby, and .NET
|
||||
1. Write and run a simple Appium automation script using a sample application
|
||||
|
||||
@@ -8,14 +8,15 @@ title: Write a Test (.NET)
|
||||
The [Appium .NET Client](https://github.com/appium/dotnet-client/) is
|
||||
an official Appium client in C#. This driver is an extension of the Selenium C# client. It has all the functionalities of the regular driver, but add Appium-specific methods on top of this. The driver is available on the public NuGet Gallery as [Appium.WebDriver](https://www.nuget.org/packages/Appium.WebDriver/).
|
||||
|
||||
Now, create a new [NUnit](https://nunit.org/) project. We will also add the references to the Appium.Net driver, and other dependencies.
|
||||
Now, we get inside the directory and create a new [NUnit](https://nunit.org/) project. We will also add the references to the Appium.Net driver, and other dependencies.
|
||||
|
||||
```bash
|
||||
cd dotnet-client
|
||||
dotnet new nunit --name appiumtest
|
||||
|
||||
cd appiumtest
|
||||
|
||||
# This will install the latest version
|
||||
# This will install the latest 5.x version
|
||||
dotnet add package Appium.WebDriver --prerelease
|
||||
dotnet add package Newtonsoft.Json --version 13.0.3
|
||||
```
|
||||
@@ -46,7 +47,7 @@ public class Tests
|
||||
|
||||
driverOptions.AddAdditionalAppiumOption("appPackage", "com.android.settings");
|
||||
driverOptions.AddAdditionalAppiumOption("appActivity", ".Settings");
|
||||
// NoReset assumes the app com.android.settings is preinstalled on the emulator
|
||||
// NoReset assumes the app com.google.android is preinstalled on the emulator
|
||||
driverOptions.AddAdditionalAppiumOption("noReset", true);
|
||||
|
||||
_driver = new AndroidDriver(serverUri, driverOptions, TimeSpan.FromSeconds(180));
|
||||
|
||||
@@ -56,17 +56,16 @@ session.unsubscribe
|
||||
|
||||
> WebDriver BiDi documentation: [session.unsubscribe](https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe)
|
||||
|
||||
Unsubscribes from one or more BiDi events using subscription IDs or event names. Event names can
|
||||
also be scoped to contexts (legacy parameter). Removing a subscription ID preserves any overlapping
|
||||
subscriptions.
|
||||
Unsubscribes using either previously returned subscription IDs or event names.
|
||||
Removing a subscription ID preserves any overlapping subscriptions.
|
||||
|
||||
#### Parameters
|
||||
|
||||
|Name|Description|Type|Default|
|
||||
|--|--|--|--|
|
||||
|`subscriptions?`|Non-empty list of subscription IDs returned by `session.subscribe`. Cannot be combined with `events` or `contexts`.|string[]||
|
||||
|`contexts?`|Non-standard, only together with `events`: contexts in which to unsubscribe from the specified events. By default, the global scope is applied.|string[]|`['']`|
|
||||
|`events?`|Non-empty list of event names to unsubscribe from. Required when `subscriptions` is omitted.|string[]||
|
||||
|`contexts?`|Legacy parameter: contexts in which to unsubscribe from events specified in `events`. By default, the global scope is applied.|string[]|`['']`|
|
||||
|
||||
All subscription IDs must be known to the current session. An unknown ID causes an `invalid argument`
|
||||
error without removing any subscriptions. Subscription IDs are cleared when the session is deleted.
|
||||
|
||||
@@ -10,6 +10,125 @@ title: JSON Wire Protocol
|
||||
The following is a list of legacy [JSON Wire Protocol (JSONWP)](https://www.selenium.dev/documentation/legacy/json_wire_protocol/)
|
||||
endpoints supported in Appium.
|
||||
|
||||
### getSession
|
||||
|
||||
```
|
||||
GET /session/:sessionId
|
||||
```
|
||||
|
||||
> JSONWP documentation: [/session/:sessionId](https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionid)
|
||||
|
||||
Retrieves the capabilities of the current session.
|
||||
|
||||
Appium implements a modified version of this endpoint. If the `appium:eventTimings` capability is
|
||||
set to `true`, the returned result will additionally include the `events` key, whose value contains
|
||||
the event history and timings.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
For retrieving capabilities, please use [`getAppiumSessionCapabilities`](./appium.md#getappiumsessioncapabilities).<br />
|
||||
For retrieving event history, please use [`getLogEvents`](./appium.md#getlogevents).
|
||||
|
||||
#### Response
|
||||
|
||||
`Capabilities` - an object containing the session capabilities, and the event history (if applicable)
|
||||
|
||||
### availableIMEEngines
|
||||
|
||||
```
|
||||
GET /session/:sessionId/ime/available_engines
|
||||
```
|
||||
|
||||
> JSONWP documentation: [/session/:sessionId/ime/available_engines](https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidimeavailable_engines)
|
||||
|
||||
Retrieves all IME (input method editor) engines available on the device under test.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
In the future, this endpoint will be moved to the [UiAutomator2 and Espresso drivers](../../ecosystem/drivers.md)
|
||||
|
||||
#### Response
|
||||
|
||||
`string[]` - a list of available IME engines
|
||||
|
||||
### getActiveIMEEngine
|
||||
|
||||
```
|
||||
GET /session/:sessionId/ime/active_engine
|
||||
```
|
||||
|
||||
> JSONWP documentation: [/session/:sessionId/ime/active_engine](https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidimeactive_engine)
|
||||
|
||||
Retrieves the name of the active IME engine.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
In the future, this endpoint will be moved to the UiAutomator2 and Espresso drivers
|
||||
|
||||
#### Response
|
||||
|
||||
`string` - the name of the active IME engine
|
||||
|
||||
### isIMEActivated
|
||||
|
||||
```
|
||||
GET /session/:sessionId/ime/activated
|
||||
```
|
||||
|
||||
> JSONWP documentation: [/session/:sessionId/ime/activated](https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidimeactivated)
|
||||
|
||||
Determines if IME input is available and active.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
In the future, this endpoint will be moved to the UiAutomator2 and Espresso drivers
|
||||
|
||||
#### Response
|
||||
|
||||
`boolean` - `true` if IME is active, otherwise `false`
|
||||
|
||||
### deactivateIMEEngine
|
||||
|
||||
```
|
||||
POST /session/:sessionId/ime/deactivate
|
||||
```
|
||||
|
||||
> JSONWP documentation: [/session/:sessionId/ime/deactivate](https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidimedeactivate)
|
||||
|
||||
Deactivates the currently active IME engine.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
In the future, this endpoint will be moved to the UiAutomator2 and Espresso drivers
|
||||
|
||||
#### Response
|
||||
|
||||
`null`
|
||||
|
||||
### activateIMEEngine
|
||||
|
||||
```
|
||||
POST /session/:sessionId/ime/activate
|
||||
```
|
||||
|
||||
> JSONWP documentation: [/session/:sessionId/ime/activate](https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidimeactivate)
|
||||
|
||||
Activates an IME engine.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
In the future, this endpoint will be moved to the UiAutomator2 and Espresso drivers
|
||||
|
||||
#### Parameters
|
||||
|
||||
|Name|Description|Type|
|
||||
|--|--|--|
|
||||
|`engine`|Name of the IME engine to activate|string|
|
||||
|
||||
#### Response
|
||||
|
||||
`null`
|
||||
|
||||
### getOrientation
|
||||
|
||||
```
|
||||
@@ -51,3 +170,53 @@ Sets the orientation of the device under test.
|
||||
#### Response
|
||||
|
||||
`null`
|
||||
|
||||
### getGeoLocation
|
||||
|
||||
```
|
||||
GET /session/:sessionId/location
|
||||
```
|
||||
|
||||
> JSONWP documentation: [/session/:sessionId/location](https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidlocation)
|
||||
|
||||
Retrieves the current location of the device under test.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Please use driver-specific extension methods such as `mobile: getGeoLocation` or
|
||||
`mobile: getSimulatedLocation`
|
||||
|
||||
#### Response
|
||||
|
||||
`Location` - an object with the following properties:
|
||||
|
||||
|Name|Description|Type|
|
||||
|--|--|--|
|
||||
|`altitude`|Altitude of the device location|number|
|
||||
|`latitude`|Latitude of the device location|number|
|
||||
|`longitude`|Longitude of the device location|number|
|
||||
|
||||
### setGeoLocation
|
||||
|
||||
```
|
||||
POST /session/:sessionId/location
|
||||
```
|
||||
|
||||
> JSONWP documentation: [/session/:sessionId/location](https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidlocation)
|
||||
|
||||
Sets the current location of the device under test.
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Please use driver-specific extension methods such as `mobile: setGeoLocation` or
|
||||
`mobile: setSimulatedLocation`
|
||||
|
||||
#### Parameters
|
||||
|
||||
|Name|Description|Type|
|
||||
|--|--|--|
|
||||
|`location`|New device latitude, longitude and altitude|[`Location`](#response_6)|
|
||||
|
||||
#### Response
|
||||
|
||||
`null`
|
||||
|
||||
@@ -119,3 +119,53 @@ Retrieves all available application contexts.
|
||||
#### Response
|
||||
|
||||
`string[]` - the names of available contexts
|
||||
|
||||
### getNetworkConnection
|
||||
|
||||
```
|
||||
GET /session/:sessionId/network_connection
|
||||
```
|
||||
|
||||
> MJSONWP documentation: [Device Modes](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes)
|
||||
|
||||
Retrieves the current state of network types (data, Wi-Fi, airplane mode).
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Please use driver-specific extension methods such as `mobile: getConnectivity`
|
||||
|
||||
#### Response
|
||||
|
||||
`NetworkConnectionState` - a number indicating the current network state:
|
||||
|
||||
|Value|Data|Wi-Fi|Airplane Mode|
|
||||
|--|--|--|--|
|
||||
|`0`|OFF|OFF|OFF|
|
||||
|`1`|OFF|OFF|ON|
|
||||
|`2`|OFF|ON|OFF|
|
||||
|`4`|ON|OFF|OFF|
|
||||
|`6`|ON|ON|OFF|
|
||||
|
||||
### setNetworkConnection
|
||||
|
||||
```
|
||||
POST /session/:sessionId/network_connection
|
||||
```
|
||||
|
||||
> MJSONWP documentation: [Device Modes](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes)
|
||||
|
||||
Sets the state of network types (data, Wi-Fi, airplane mode).
|
||||
|
||||
!!! warning "Deprecated"
|
||||
|
||||
Please use driver-specific extension methods such as `mobile: setConnectivity`
|
||||
|
||||
#### Parameters
|
||||
|
||||
|<div style="width:6em">Name</div>|Description|<div style="width:18em">Type</div>|
|
||||
|--|--|--|
|
||||
|`parameters`|Object containing the `type` key, whose value is the desired network state|`{"type": `[`NetworkConnectionState`](#response_5)`}`|
|
||||
|
||||
#### Response
|
||||
|
||||
[`NetworkConnectionState`](#response_5) - the new network state
|
||||
|
||||
@@ -265,43 +265,6 @@ preserved, and only the incomplete uploads will be stopped.
|
||||
|
||||
## Universal XML Plugin
|
||||
|
||||
Translation is on by default. It can be turned off and on during a session with the
|
||||
[execute methods](../../guides/execute-methods.md) below, and applies only to the current session.
|
||||
|
||||
### execute
|
||||
|
||||
```
|
||||
POST /session/:sessionId/execute/sync
|
||||
```
|
||||
|
||||
Modifies the [`execute`](./webdriver.md#execute) endpoint:
|
||||
|
||||
* Adds the `universalXml: setEnabled` and `universalXml: isEnabled` execute methods. Any other
|
||||
script is passed on unchanged
|
||||
|
||||
#### universalXml: setEnabled
|
||||
|
||||
Turns translation on or off for the current session. While it is off, `findElement`,
|
||||
`findElements` and `getPageSource` are passed on unchanged.
|
||||
|
||||
##### Parameters
|
||||
|
||||
|Name|Description|Type|
|
||||
|--|--|--|
|
||||
|`enabled`|Whether node/attribute names should be translated|boolean|
|
||||
|
||||
##### Response
|
||||
|
||||
`null`
|
||||
|
||||
#### universalXml: isEnabled
|
||||
|
||||
Returns whether translation is on for the current session.
|
||||
|
||||
##### Response
|
||||
|
||||
`boolean` - `true` if translation is on
|
||||
|
||||
### findElement
|
||||
|
||||
```
|
||||
|
||||
@@ -25,11 +25,18 @@ POST /session
|
||||
|
||||
Creates a new WebDriver session.
|
||||
|
||||
Appium implements a modified version of this endpoint for historical reasons. While the W3C
|
||||
endpoint only accepts 1 parameter, Appium's implementation allows up to 3 parameters, as this was
|
||||
required by the legacy JSON Wire Protocol (JSONWP). Since Appium 2, the JSONWP format is no longer
|
||||
supported, and any of the 3 parameters can be used to specify the W3C capabilities.
|
||||
|
||||
#### Parameters
|
||||
|
||||
|Name|Description|Type|
|
||||
|--|--|--|
|
||||
|`capabilities?`|Capabilities of the new session|`W3CDriverCaps`|
|
||||
|`w3cCapabilities1?`|Capabilities of the new session|`W3CDriverCaps`|
|
||||
|`w3cCapabilities2?`|Another location for the new session capabilities (legacy)|`W3CDriverCaps`|
|
||||
|`w3cCapabilities?`|Another location for the new session capabilities (legacy)|`W3CDriverCaps`|
|
||||
|
||||
#### Response
|
||||
|
||||
@@ -84,19 +91,14 @@ GET /session/:sessionId/timeouts
|
||||
|
||||
Retrieves the timeout values of the current session.
|
||||
|
||||
Appium implements a modified version of this endpoint, by also returning the value of the `command`
|
||||
timeout for supported drivers and contexts.
|
||||
|
||||
#### Response
|
||||
|
||||
`GetTimeoutsResult` - an object with the following properties:
|
||||
|
||||
|Name|Description|Type|
|
||||
|--|--|--|
|
||||
|`script`|Script timeout|number or null|
|
||||
|`pageLoad`|Page load timeout|number or null|
|
||||
|`implicit`|Implicit wait timeout|number or null|
|
||||
|`command`|Appium command timeout|number|
|
||||
|`command`|Command timeout|number|
|
||||
|`implicit`|Implicit wait timeout|number|
|
||||
|
||||
### timeouts
|
||||
|
||||
@@ -108,17 +110,13 @@ POST /session/:sessionId/timeouts
|
||||
|
||||
Sets the timeout values of the current session.
|
||||
|
||||
Appium implements a modified version of this endpoint by adding the optional `command` parameter
|
||||
for supported drivers and contexts.
|
||||
|
||||
#### Parameters
|
||||
|
||||
|Name|Description|Type|
|
||||
|--|--|--|
|
||||
|`script?`|Script timeout (in milliseconds)|number or null|
|
||||
|`implicit?`|Implicit wait timeout (in milliseconds)|number or null|
|
||||
|`pageLoad?`|Page load timeout (in milliseconds)|number or null|
|
||||
|`command?`|Appium command timeout (in milliseconds)|number|
|
||||
|`implicit?`|Implicit wait timeout (in milliseconds)|number|
|
||||
|`pageLoad?`|Page load timeout (in milliseconds)|number|
|
||||
|`script?`|Script timeout (in milliseconds)|number|
|
||||
|
||||
#### Response
|
||||
|
||||
@@ -956,7 +954,7 @@ POST /session/:sessionId/actions
|
||||
|
||||
> WebDriver documentation: [Perform Actions](https://w3c.github.io/webdriver/#perform-actions)
|
||||
|
||||
Performs a sequence of [actions](https://w3c.github.io/webdriver/#actions). See the [Automating Gestures](../../guides/gestures.md) guide for multi-language examples.
|
||||
Performs a sequence of [actions](https://w3c.github.io/webdriver/#actions).
|
||||
|
||||
#### Parameters
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ they can only be enabled using the wildcard (`*`) prefix:
|
||||
| Feature Name | Description |
|
||||
|-------------------|-------------------------------------------------------------------------------|
|
||||
|`session_discovery`|Allows retrieving the list of active server sessions via `GET /appium/sessions`|
|
||||
|`cors` |Allows web browser connections to the server from any host |
|
||||
|
||||
|
||||
Of course, Appium drivers and plugins are free to define additional insecure features of their own.
|
||||
|
||||
@@ -26,16 +26,16 @@ appium
|
||||
|
||||
|<div style="width:15em">Argument</div>|Description|Type|<div style="width:7em">Default</div>|
|
||||
|--|--|--|--|
|
||||
|`--address`, `-a`|IPv4/IPv6 address or a hostname or a hostname or a hostname or a hostname to listen on|string|`0.0.0.0`|
|
||||
|`--address`, `-a`|IPv4/IPv6 address or a hostname to listen on|string|`0.0.0.0`|
|
||||
|`--allow-cors`|Allow web browser connections from any host|boolean|`false`|
|
||||
|`--allow-insecure`|List of [insecure features](../../guides/security.md) that should be allowed in this server's sessions. Individual features can be overridden by `--deny-insecure`. Has no effect in combination with `--relaxed-security`.|array<string>|`[]`|
|
||||
|`--allow-unknown-args`|Do not exit if unrecognized command-line arguments are passed to the server; ignore them instead. Useful when the Appium CLI is wrapped by external tooling that appends extra flags.|boolean|`false`|
|
||||
|`--app-url-rules`|Rules that remote application URLs (e.g. in the `appium:app` capability) must satisfy before the server downloads them. See the [Restricting Remote App URLs](../../guides/security.md#restricting-remote-app-urls) guide for details. Can be a path to a JSON file or raw JSON.|object||
|
||||
|`--base-path`, `-pa`|Base path to use as the prefix for all webdriver routes running on the server|string|`""`|
|
||||
|`--callback-address`, `-ca`|Callback IP address|string|same as `--address`|
|
||||
|`--callback-port`, `-cp`|Callback port|integer|`4723`|
|
||||
|`--config`|Path to an [Appium configuration JSON file](../../guides/config.md)|string||
|
||||
|`--bidi-heartbeat-interval`|Interval (in seconds) between WebSocket pings sent to each [BiDi](../api/bidi.md) client. A connection that misses two consecutive pongs is terminated. Disabled if set to `0`.|integer|`15`|
|
||||
|`--bidi-max-buffered-bytes`|Maximum number of bytes the server may keep buffered for a BiDi connection whose client is not reading fast enough. A connection that stays above the limit for longer than `--bidi-max-buffered-ms`, or exceeds twice the limit, is closed with the code `1013`. Disabled if set to `0`, which also turns off skipping of droppable events.|integer|`33554432`|
|
||||
|`--bidi-max-buffered-ms`|Time (in milliseconds) a BiDi connection may stay above `--bidi-max-buffered-bytes` before it is closed. If set to `0`, the connection is closed as soon as the limit is exceeded.|integer|`30000`|
|
||||
|`--default-capabilities`, `-dc`|Capabilities that will be used for each session, unless overridden by received capabilities. See [Default Capabilities](#default-capabilities) for how they are applied.|object||
|
||||
|`--debug-log-spacing`|Add exaggerated spacing in logs to help with visual inspection|boolean|`false`|
|
||||
|`--default-capabilities`, `-dc`|Capabilities that will be used for each session, unless overridden by received capabilities|object||
|
||||
|`--deny-insecure`|List of [insecure features](../../guides/security.md) that should be disabled in this server's sessions. Since all insecure features are disabled by default, this argument has no effect without either `--allow-insecure` or `--relaxed-security`, and is applied after both.|array<string>|`[]`|
|
||||
|`--driver`|Driver-specific configuration. Keys should correspond to driver package names|object||
|
||||
|`--drivers-import-chunk-size`|Maximum number of drivers that can be imported in parallel on server startup|number|`3`|
|
||||
@@ -44,7 +44,7 @@ appium
|
||||
|`--local-timezone`|Use local timezone for log timestamps|boolean|`false`|
|
||||
|`--log`, `-g`|Path to a file where the server logs should be output. This does not affect output on the console.|string||
|
||||
|`--log-filters`|List of log filtering rules. See the [log filtering guide](../../guides/log-filters.md) for details.|array||
|
||||
|`--log-level`|The log level for the server logs. Supported values are `debug`, `info`, `warn`, or `error`. Combining two supported values using a colon (e.g. `warn:debug`) allows to set separate log levels for the console and file outputs, respectively.|string|`info`|
|
||||
|`--log-level`|The log level for the server logs. Supported values are `debug`, `info`, `warn`, or `error`. Combining two supported values using a colon (e.g. `warn:debug`) allows to set separate log levels for the console and file outputs, respectively.|string|`debug`|
|
||||
|`--log-format`|The log format of the server logs. Supported values are `text`, `json`, or `pretty_json`. Setting the value to `json` disables colors.|string|`text`|
|
||||
|`--log-no-colors`|Disable colors in the server log|boolean|`false`|
|
||||
|`--log-timestamp`|Show timestamps in the server log|boolean|`false`|
|
||||
@@ -52,6 +52,7 @@ appium
|
||||
|`--max-ipc-data-size`|Maximum byte size of IPC message objects.|integer|`1048576` (1MB)|
|
||||
|`--max-ipc-topics`|Maximum number of IPC topics per session.|integer|`1000`|
|
||||
|`--no-perms-check`|Skip various permission checks on the server startup|boolean|`false`|
|
||||
|`--nodeconfig`|JSON configuration for registering Appium as a node with Selenium Grid 3|object||
|
||||
|`--plugin`|Plugin-specific configuration. Keys should correspond to plugin package names|object||
|
||||
|`--plugins-import-chunk-size`|Maximum number of plugins that can be imported in parallel on server startup|number|`7`|
|
||||
|`--port`, `-p`|Port to listen on|integer|`4723`|
|
||||
@@ -60,45 +61,12 @@ appium
|
||||
|`--shutdown-timeout`|Timeout (in milliseconds) for waiting on all active connections to close, when shutting down the server|number|`5000`|
|
||||
|`--ssl-cert-path`|Absolute path to the `.cert` file if TLS is used. Must be provided together with `--ssl-key-path`. See the [SSL/TLS/SPDY Support guide](../../guides/tls.md) for details.|string||
|
||||
|`--ssl-key-path`|Absolute path to the `.key` file if TLS is used. Must be provided together with `--ssl-cert-path`. See the [SSL/TLS/SPDY Support guide](../../guides/tls.md) for details.|string||
|
||||
|`--strict-caps`|Prevent creation of new client sessions that use unsupported capabilities|boolean|`false`|
|
||||
|`--tmp`|Absolute path to the directory used for temporary files|string|[`os.tmpdir()`](https://nodejs.org/api/os.html#ostmpdir)|
|
||||
|`--use-drivers`|List of drivers to activate. By default, all installed drivers are activated.|array<string>|`[]`|
|
||||
|`--use-plugins`|List of plugins to activate. By default, no plugins are activated. Set to `["all"]` to activate all installed plugins.|array<string>|`[]`|
|
||||
|`--webhook`, `-G`|URL for an HTTP listener where the server logs should be output. This does not affect output on the console. A bare `host:port` is also accepted, which posts the logs to the root path over plain http; a value having neither a scheme nor a port falls back to `127.0.0.1:9003`.|string||
|
||||
|
||||
### Default Capabilities
|
||||
|
||||
Capabilities set with `--default-capabilities` are added to the received capabilities before a
|
||||
driver is matched. This is Appium's own defaulting behavior, not something defined by the W3C
|
||||
WebDriver specification.
|
||||
|
||||
* A value the client sends in `alwaysMatch`, or in a given `firstMatch` candidate, takes precedence
|
||||
over the server default
|
||||
* Defaults fill missing keys in each `firstMatch` candidate separately. A value in one candidate
|
||||
does not stop the default from being applied to another candidate
|
||||
* A key sent in both `alwaysMatch` and `firstMatch` is still rejected by the usual capability
|
||||
validation. Server defaults do not change that
|
||||
|
||||
For example, with these server defaults:
|
||||
|
||||
```json
|
||||
{"appium:newCommandTimeout": 60}
|
||||
```
|
||||
|
||||
and these received capabilities:
|
||||
|
||||
```json
|
||||
{
|
||||
"alwaysMatch": {"appium:deviceName": "Pixel"},
|
||||
"firstMatch": [
|
||||
{"platformName": "iOS", "appium:newCommandTimeout": 120},
|
||||
{"platformName": "Android"}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
the iOS candidate keeps `appium:newCommandTimeout` of `120`, and the Android candidate gets the
|
||||
default `60`. The session uses the value from whichever candidate it is created with.
|
||||
|
||||
### Info Options
|
||||
|
||||
The following options are used for reference or debug purposes. They are only supported for the base `appium` command (not `appium server`), and will not launch the server.
|
||||
|
||||
@@ -32,7 +32,7 @@ appium setup browser
|
||||
|
||||
Installs the following extensions for desktop application testing:
|
||||
|
||||
* Drivers: `mac2`[^1], `wincore`[^2]
|
||||
* Drivers: `mac2`[^1], `windows`[^2]
|
||||
* Plugins: `images`, `inspector`
|
||||
|
||||
#### Usage
|
||||
|
||||
@@ -32,6 +32,7 @@ default value.
|
||||
| <div style="width:19em">Capability</div> | Description | Type | Default |
|
||||
|--|--|--|--|
|
||||
| `webSocketUrl` | Toggle support of the WebDriver BiDi protocol | `boolean` ||
|
||||
| `appium:eventTimings` (deprecated) | Toggle collection of [Event Timings](../../guides/event-timing.md). This capability is deprecated - please use the [`getLogEvents`](../api/appium.md#getlogevents) endpoint instead. | `boolean` ||
|
||||
| `appium:newCommandTimeout` | Number of seconds the Appium server should wait for clients to send commands before stopping the session. A value of `0` disables the timeout. | `number` | `60` |
|
||||
| `appium:printPageSourceOnFindFailure` | Toggle retrieval of the page source and its printing to the Appium log, whenever a request to find an element fails | `boolean` ||
|
||||
|
||||
@@ -41,9 +42,15 @@ These capabilities are not directly used in the Appium server/base driver, but a
|
||||
validation checks due to their relevance in other drivers. The actual handling of these
|
||||
capabilities is optional and entirely driver-dependent.
|
||||
|
||||
| Capability | Validation |
|
||||
|--------------------------|---------------------------------------------------------------|
|
||||
| `appium:platformVersion` | Must be `string` |
|
||||
| `appium:app` | Must be `string`; empty values are ignored |
|
||||
| `appium:fullReset` | Must be `boolean`; mutually exclusive with `appium:noReset` |
|
||||
| `appium:noReset` | Must be `boolean`; mutually exclusive with `appium:fullReset` |
|
||||
| Capability | Validation |
|
||||
|-----------------------------------|---------------------------------------------------------------|
|
||||
| `platformVersion` | Must be `string` |
|
||||
| `appium:app` | Must be `string`; empty values are ignored |
|
||||
| `appium:autoLaunch` (deprecated) | Must be `boolean` |
|
||||
| `appium:autoWebview` | Must be `boolean` |
|
||||
| `appium:fullReset` | Must be `boolean`; mutually exclusive with `appium:noReset` |
|
||||
| `appium:language` | Must be `string` |
|
||||
| `appium:locale` | Must be `string` |
|
||||
| `appium:orientation` | Must be either `LANDSCAPE` or `PORTRAIT` |
|
||||
| `appium:noReset` | Must be `boolean`; mutually exclusive with `appium:fullReset` |
|
||||
| `appium:udid` | Must be `string` |
|
||||
|
||||
@@ -46,7 +46,7 @@ contributors!
|
||||
## Gold Sponsors
|
||||
|
||||
<div class="sponsor-section">
|
||||
<a href="https://device.io/" target="_blank"><img src="https://images.opencollective.com/device-io/cc7e949/avatar/64.png" alt="Device.io" /></a>
|
||||
<a href="https://jetify.com/" target="_blank"><img src="https://images.opencollective.com/jetify/415824c/avatar/64.png" alt="Jetify" /></a>
|
||||
</div>
|
||||
|
||||
[Become a Gold Sponsor](https://opencollective.com/appium/contribute/gold-sponsor-72877/checkout?interval=month&amount=500&contributeAs=me)
|
||||
|
||||
@@ -50,7 +50,7 @@ npx appium-docs init
|
||||
This will:
|
||||
|
||||
1. Create a `tsconfig.json` if one does not already exist. This is necessary even if your extension
|
||||
is not written in TypeScript.
|
||||
is not written in TypeScript.
|
||||
2. Create a `mkdocs.yml` with the necessary configuration for MkDocs.
|
||||
|
||||
### Documenting Your Extension
|
||||
|
||||
@@ -17,7 +17,7 @@ If you maintain an Appium driver that you would like to be listed here, feel fre
|
||||
|
||||
These drivers are currently maintained by the Appium team:
|
||||
|
||||
### [Chromium](https://appium.github.io/appium-chromium-driver)
|
||||
### [Chromium](https://appium.github.io/appium-chromium-driver/)
|
||||
|
||||
- Target: Desktop Chromium-based browsers (Chrome, Microsoft Edge, etc.)
|
||||
- Mode: Web
|
||||
@@ -26,7 +26,7 @@ These drivers are currently maintained by the Appium team:
|
||||
appium driver install chromium
|
||||
```
|
||||
|
||||
### [Espresso](https://appium.github.io/appium-espresso-driver)
|
||||
### [Espresso](https://appium.github.io/appium-espresso-driver/)
|
||||
|
||||
- Target: Android applications (mobile, TV, Wear, XR, Automotive)
|
||||
- Mode: Native, Hybrid, Web
|
||||
@@ -35,7 +35,7 @@ appium driver install chromium
|
||||
appium driver install espresso
|
||||
```
|
||||
|
||||
### [Gecko](https://appium.github.io/appium-geckodriver)
|
||||
### [Gecko](https://appium.github.io/appium-geckodriver/)
|
||||
|
||||
- Target: Desktop and mobile Gecko-based browsers (Firefox, etc.)
|
||||
- Mode: Web
|
||||
@@ -44,7 +44,7 @@ appium driver install espresso
|
||||
appium driver install gecko
|
||||
```
|
||||
|
||||
### [Mac2](https://appium.github.io/appium-mac2-driver)
|
||||
### [Mac2](https://appium.github.io/appium-mac2-driver/)
|
||||
|
||||
- Target: macOS applications
|
||||
- Mode: Native
|
||||
@@ -53,7 +53,7 @@ appium driver install gecko
|
||||
appium driver install mac2
|
||||
```
|
||||
|
||||
### [Safari](https://appium.github.io/appium-safari-driver)
|
||||
### [Safari](https://appium.github.io/appium-safari-driver/)
|
||||
|
||||
- Target: Desktop and mobile Safari browsers
|
||||
- Mode: Web
|
||||
@@ -62,7 +62,7 @@ appium driver install mac2
|
||||
appium driver install safari
|
||||
```
|
||||
|
||||
### [UiAutomator2](https://appium.github.io/appium-uiautomator2-driver)
|
||||
### [UiAutomator2](https://appium.github.io/appium-uiautomator2-driver/)
|
||||
|
||||
- Target: Android applications (mobile, TV, Wear, XR, Automotive)
|
||||
- Modes: Native, Hybrid, Web
|
||||
|
||||
@@ -140,17 +140,3 @@ Supported by: `@domovou69`
|
||||
```sh title="Install This Tool"
|
||||
npm install -g xpath-to-class-chain
|
||||
```
|
||||
|
||||
### [XPath to UiSelector](https://github.com/domovou69/xpath-to-uiselector)
|
||||
|
||||
XPath to UiSelector is a command-line tool for migrating Android XPath locators in test code to
|
||||
`-android uiautomator` selectors. It converts the XPaths that have an exact `UiSelector`
|
||||
equivalent, converts with a warning those that only have a close one (such as `//A//B`), and skips
|
||||
the rest with a reason. The strategy call is rewritten together with the string, for example
|
||||
`AppiumBy.xpath` becomes `AppiumBy.androidUIAutomator`.
|
||||
|
||||
Supported by: `@domovou69`
|
||||
|
||||
```sh title="Install This Tool"
|
||||
npm install -g xpath-to-uiselector
|
||||
```
|
||||
|
||||
@@ -15,7 +15,7 @@ bundle for each test.
|
||||
## What Is Cached
|
||||
|
||||
Caching could be applied to application bundles generated by
|
||||
[`configureApp`](https://github.com/appium/appium/blob/master/packages/base-driver/lib/basedriver/helpers.js#L99) helper call.
|
||||
[`configureApp`](https://github.com/appium/appium/blob/master/packages/base-driver/lib/basedriver/helpers.ts#L99) helper call.
|
||||
Inherited drivers can customize their caching logic by providing own `onPostProcess`
|
||||
(or both `inDownload` and `onPostProcess`) property definition, but the general
|
||||
rule of thumb is that we need to cache locally all application bundles need to be downloaded and/or extracted
|
||||
|
||||
@@ -78,7 +78,7 @@ BiDi commands, so make sure to reference their documentation.
|
||||
|
||||
## `appium:options` を使用して機能をグループ化する
|
||||
|
||||
テストで `appium:` 機能を多用すると、繰り返しが多くなる可能性があります。 代わりに、すべての機能を単一の `appium:options` 機能のオブジェクト値として組み合わせることもできます。その場合、オブジェクト内の機能にプレフィックスを使用する必要はありません。 例:
|
||||
テストで `appium:` 機能を多用すると、繰り返しが多くなる可能性があります。代わりに、すべての機能を単一の `appium:options` 機能のオブジェクト値として組み合わせることもできます。その場合、オブジェクト内の機能にプレフィックスを使用する必要はありません。例:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -98,5 +98,5 @@ The above configuration corresponds to the `--driver-xcuitest-webkit-debug-proxy
|
||||
```
|
||||
|
||||
All properties are case-sensitive and will be in
|
||||
[kebab-case](https://en.wikipedia.org/wiki/Naming_convention_\(programming\)#Delimiter-separated_words).
|
||||
[kebab-case](https://en.wikipedia.org/wiki/Naming_convention_(programming)#Delimiter-separated_words).
|
||||
For example, `callback-port` is allowed, but `callbackPort` is not.
|
||||
|
||||
@@ -6,14 +6,13 @@ title: Retrieving Event Timings
|
||||
---
|
||||
|
||||
Appium comes with the ability to retrieve timing information about startup
|
||||
information and command length. This is an advanced feature that is controlled
|
||||
by the use of the `appium:eventTimings` capability (set it to `true` to log event
|
||||
timings).
|
||||
information and command length. This is an advanced feature; the server records
|
||||
event timings for every session.
|
||||
|
||||
With this capability turned on, the `POST /session/:id/appium/events` response (i.e.,
|
||||
the response to `driver.logs.events` or similar, depending on client) will be
|
||||
decorated with an `events` property. This is the structure of that `events`
|
||||
property:
|
||||
The timings can be retrieved at any point during a session via the
|
||||
`POST /session/:id/appium/events` endpoint (i.e., the response to
|
||||
`driver.logs.events` or similar, depending on client). The response body is the
|
||||
event history object itself. This is its structure:
|
||||
|
||||
```
|
||||
{
|
||||
@@ -29,7 +28,7 @@ property:
|
||||
}
|
||||
```
|
||||
|
||||
In other words, the `events` property has 2 kinds of properties of its own:
|
||||
In other words, the event history object has 2 kinds of properties of its own:
|
||||
|
||||
- Properties which are the names of event types
|
||||
- The `commands` property
|
||||
@@ -64,7 +63,9 @@ generate various kinds of reports from event timings output:
|
||||
!!! note
|
||||
|
||||
```
|
||||
In the past, events were available as a part of `GET /session/:id` response
|
||||
In the past, when the `appium:eventTimings` capability was set to `true`, the event history
|
||||
was also returned as an `events` property of the (now deprecated) `GET /session/:id`
|
||||
response
|
||||
```
|
||||
|
||||
## Add a custom event
|
||||
|
||||
@@ -10,10 +10,10 @@ defined by the W3C WebDriver spec, Appium needs a way for these "extended" comma
|
||||
by client libraries. There are two main strategies for this:
|
||||
|
||||
1. Appium drivers define new W3C-compatible API routes, and Appium clients are updated to include
|
||||
support for those new routes.
|
||||
support for those new routes.
|
||||
2. Appium drivers define so-called "Execute Methods" which provide new functionality by
|
||||
overloading the existing `Execute Script` command which is already available in any WebDriver-
|
||||
based client library (including all Selenium and Appium clients).
|
||||
overloading the existing `Execute Script` command which is already available in any WebDriver-
|
||||
based client library (including all Selenium and Appium clients).
|
||||
|
||||
There are pros and cons for each strategy, but it is ultimately up to the extension author to
|
||||
decide how they wish to implement new commands.
|
||||
@@ -134,9 +134,9 @@ Javascript execution:
|
||||
|
||||
1. The script string is just a command name; it will be provided by the driver documentation
|
||||
2. The standard way to provide parameters is as a _single_ object with keys representing parameter
|
||||
names and values representing parameter values. So in this case, we had to specify both the
|
||||
parameter name (`bundleId`) as the key of the parameters object, and the parameter value
|
||||
(`com.my.app`) as the value for that key. A driver can define parameters as _required_ or _optional_.
|
||||
names and values representing parameter values. So in this case, we had to specify both the
|
||||
parameter name (`bundleId`) as the key of the parameters object, and the parameter value
|
||||
(`com.my.app`) as the value for that key. A driver can define parameters as _required_ or _optional_.
|
||||
|
||||
Of course, always refer to the documentation for the particular Execute Method in case the author
|
||||
has made any alterations to the standard access method.
|
||||
|
||||
@@ -137,7 +137,7 @@ all parameters and descriptions see
|
||||
Once you start the Appium server it will register with the grid, and you will see your device on
|
||||
the grid console page:
|
||||
|
||||
`http://**\<grid-ip-adress\>**:**\<grid-port\>**/grid/console`
|
||||
`http://**\<grid-ip-address\>**:**\<grid-port\>**/grid/console`
|
||||
|
||||
### Example Grid Node Configuration JSON
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Appium 2 へ移行する
|
||||
---
|
||||
|
||||
このドキュメントは既にAppium 1 を利用している人がAppium 2 に移行するための手引きです。 破壊的変更の一覧や、実行環境・テストコードをAppium 2 互換にするための方法が含まれます。
|
||||
このドキュメントは既にAppium 1 を利用している人がAppium 2 に移行するための手引きです。破壊的変更の一覧や、実行環境・テストコードをAppium 2 互換にするための方法が含まれます。
|
||||
|
||||
Appium 2 is the biggest Appium release in over 5 years. It is _not_ focused on changing the
|
||||
automation behavior for any particular platform, but instead re-envisions Appium into an
|
||||
|
||||
@@ -8,8 +8,7 @@ title: Appium 3 へ移行する
|
||||
}
|
||||
</style>
|
||||
|
||||
このドキュメントは既にAppium 2 を利用している人がAppium 3 に移行するための手引きです。
|
||||
破壊的変更と、それらを処理するためのヒントが含まれています。
|
||||
このドキュメントは既にAppium 2 を利用している人がAppium 3 に移行するための手引きです。破壊的変更と、それらを処理するためのヒントが含まれています。
|
||||
|
||||
Appium 2 はAppiumアーキテクチャ全体の大きな見直しをしました。 Appium 3 は限られた破壊的変更のみの比較的小さな更新であり、移行プロセスがはるかに簡易になります。
|
||||
|
||||
@@ -150,285 +149,285 @@ Icons are used to indicate endpoint support in either certain drivers, or in the
|
||||
</div>
|
||||
|
||||
- `GET /sessions`
|
||||
- :octicons-arrow-right-24: `GET /appium/sessions` :simple-appium:
|
||||
- :octicons-arrow-right-24: `GET /appium/sessions` :simple-appium:
|
||||
- `POST /session/:sessionId/accept_alert`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/alert/accept` :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: alert` [execute method](./execute-methods.md) :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: acceptAlert` execute method :material-android:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/alert/accept` :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: alert` [execute method](./execute-methods.md) :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: acceptAlert` execute method :material-android:
|
||||
- `GET /session/:sessionId/alert_text`
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/alert/text` :simple-appium:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/alert/text` :simple-appium:
|
||||
- `POST /session/:sessionId/alert_text`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/alert/text` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/alert/text` :simple-appium:
|
||||
- `POST /session/:sessionId/appium/app/background`
|
||||
- :octicons-arrow-right-24: `mobile: backgroundApp` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: backgroundApp` execute method :material-apple: :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/app/close`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: terminateApp` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: terminateApp` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: closeApp` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: terminateApp` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: terminateApp` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: closeApp` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/appium/app/end_test_coverage`
|
||||
- :octicons-arrow-right-24: `mobile: shell` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: shell` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/app/launch`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: launchApp` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: activateApp` or `mobile: startActivity` execute methods :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: launchApp` or `macos: activateApp` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: launchApp` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: launchApp` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: activateApp` or `mobile: startActivity` execute methods :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: launchApp` or `macos: activateApp` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: launchApp` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/appium/app/reset`
|
||||
- :octicons-arrow-right-24: `mobile: clearApp` execute method :material-apple: [^sim] :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: clearApp` execute method :material-apple: [^sim] :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/app/strings`
|
||||
- :octicons-arrow-right-24: `mobile: getAppStrings` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getAppStrings` execute method :material-apple: :material-android: :material-coffee:
|
||||
- `GET /session/:sessionId/appium/device/app_state`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/appium/device/app_state` :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: queryAppState` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: queryAppState` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/appium/device/app_state` :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: queryAppState` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: queryAppState` execute method :material-apple-finder:
|
||||
- `GET /session/:sessionId/appium/device/current_activity`
|
||||
- :octicons-arrow-right-24: `mobile: getCurrentActivity` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getCurrentActivity` execute method :material-android: :material-coffee:
|
||||
- `GET /session/:sessionId/appium/device/current_package`
|
||||
- :octicons-arrow-right-24: `mobile: getCurrentPackage` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getCurrentPackage` execute method :material-android: :material-coffee:
|
||||
- `GET /session/:sessionId/appium/device/display_density`
|
||||
- :octicons-arrow-right-24: `mobile: getDisplayDensity` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getDisplayDensity` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/finger_print`
|
||||
- :octicons-arrow-right-24: `mobile: fingerPrint` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: fingerPrint` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/get_clipboard`
|
||||
- :octicons-check-24: Moved to drivers: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getClipboard` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getPasteboard` execute method :material-apple: [^sim]
|
||||
- :octicons-arrow-right-24: `windows: getClipboard` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getClipboard` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getPasteboard` execute method :material-apple: [^sim]
|
||||
- :octicons-arrow-right-24: `windows: getClipboard` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/appium/device/gsm_call`
|
||||
- :octicons-arrow-right-24: `mobile: gsmCall` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: gsmCall` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/gsm_signal`
|
||||
- :octicons-arrow-right-24: `mobile: gsmSignal` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: gsmSignal` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/gsm_voice`
|
||||
- :octicons-arrow-right-24: `mobile: gsmVoice` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: gsmVoice` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/is_locked`
|
||||
- :octicons-arrow-right-24: `mobile: isLocked` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: isLocked` execute method :material-apple: :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/keyevent`
|
||||
- :octicons-arrow-right-24: `mobile: keys` execute method :material-apple: (iPadOS only)
|
||||
- :octicons-arrow-right-24: `mobile: pressKey` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: keys` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: keys` execute method :material-apple: (iPadOS only)
|
||||
- :octicons-arrow-right-24: `mobile: pressKey` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: keys` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/appium/device/lock`
|
||||
- :octicons-arrow-right-24: `mobile: lock` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: lock` execute method :material-apple: :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/long_press_keycode`
|
||||
- :octicons-arrow-right-24: `mobile: pressKey` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: pressKey` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/network_speed`
|
||||
- :octicons-arrow-right-24: `mobile: networkSpeed` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: networkSpeed` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/open_notifications`
|
||||
- :octicons-arrow-right-24: `mobile: statusBar` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: openNotifications` execute method :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: statusBar` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: openNotifications` execute method :material-android:
|
||||
- `POST /session/:sessionId/appium/device/power_ac`
|
||||
- :octicons-arrow-right-24: `mobile: powerAC` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: powerAC` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/power_capacity`
|
||||
- :octicons-arrow-right-24: `mobile: powerCapacity` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: powerCapacity` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/press_keycode`
|
||||
- :octicons-arrow-right-24: `mobile: keys` execute method :material-apple: (iPadOS only)
|
||||
- :octicons-arrow-right-24: `mobile: pressKey` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: keys` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: keys` execute method :material-apple: (iPadOS only)
|
||||
- :octicons-arrow-right-24: `mobile: pressKey` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: keys` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/appium/device/send_sms`
|
||||
- :octicons-arrow-right-24: `mobile: sendSms` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: sendSms` execute method :material-android: [^sim] :material-coffee: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/set_clipboard`
|
||||
- :octicons-arrow-right-24: `mobile: setClipboard` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: setPasteboard` execute method :material-apple: [^sim]
|
||||
- :octicons-arrow-right-24: `windows: setClipboard` execute method :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: setClipboard` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: setPasteboard` execute method :material-apple: [^sim]
|
||||
- :octicons-arrow-right-24: `windows: setClipboard` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/appium/device/shake`
|
||||
- :octicons-arrow-right-24: `mobile: shake` execute method :material-apple: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: shake` execute method :material-apple: [^sim]
|
||||
- `POST /session/:sessionId/appium/device/start_activity`
|
||||
- :octicons-arrow-right-24: `mobile: startActivity` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: startActivity` execute method :material-android: :material-coffee:
|
||||
- `GET /session/:sessionId/appium/device/system_bars`
|
||||
- :octicons-arrow-right-24: `mobile: deviceScreenInfo` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: getSystemBars` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: deviceScreenInfo` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: getSystemBars` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/toggle_airplane_mode`
|
||||
- :octicons-arrow-right-24: `mobile: setConnectivity` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: setConnectivity` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/toggle_data`
|
||||
- :octicons-arrow-right-24: `mobile: setConnectivity` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: setConnectivity` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/toggle_location_services`
|
||||
- :octicons-arrow-right-24: `mobile: toggleGps` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: toggleGps` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/toggle_wifi`
|
||||
- :octicons-arrow-right-24: `mobile: setConnectivity` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: setConnectivity` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/device/unlock`
|
||||
- :octicons-arrow-right-24: `mobile: unlock` execute method :material-apple: :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: unlock` execute method :material-apple: :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/element/:elementId/value`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/element/:elementId/value` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/element/:elementId/value` :simple-appium:
|
||||
- `POST /session/:sessionId/appium/element/:elementId/replace_value`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/element/:elementId/value` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/element/:elementId/value` :simple-appium:
|
||||
- `POST /session/:sessionId/appium/getPerformanceData`
|
||||
- :octicons-arrow-right-24: `mobile: getPerformanceData` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getPerformanceData` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/performanceData/types`
|
||||
- :octicons-arrow-right-24: `mobile: getPerformanceDataTypes` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `mobile: getPerformanceDataTypes` execute method :material-android: :material-coffee:
|
||||
- `POST /session/:sessionId/appium/receive_async_response`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/execute/async` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/execute/async` :simple-appium:
|
||||
- `POST /session/:sessionId/appium/simulator/toggle_touch_id_enrollment`
|
||||
- :octicons-arrow-right-24: `mobile: enrollBiometric` execute method :material-apple: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: enrollBiometric` execute method :material-apple: [^sim]
|
||||
- `POST /session/:sessionId/appium/simulator/touch_id`
|
||||
- :octicons-arrow-right-24: `mobile: sendBiometricMatch` execute method :material-apple: [^sim]
|
||||
- :octicons-arrow-right-24: `mobile: sendBiometricMatch` execute method :material-apple: [^sim]
|
||||
- `POST /session/:sessionId/appium/start_recording_screen`
|
||||
- :octicons-check-24: Moved to drivers: :material-apple: :material-android: :material-coffee: :material-apple-finder: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: startXCTestScreenRecording` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: startMediaProjectionRecording` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: startRecordingScreen` or `macos: startNativeScreenRecording` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: startRecordingScreen` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-apple: :material-android: :material-coffee: :material-apple-finder: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: startXCTestScreenRecording` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: startMediaProjectionRecording` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: startRecordingScreen` or `macos: startNativeScreenRecording` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: startRecordingScreen` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/appium/stop_recording_screen`
|
||||
- :octicons-check-24: Moved to drivers: :material-apple: :material-android: :material-coffee: :material-apple-finder: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: stopXCTestScreenRecording` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: stopMediaProjectionRecording` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: stopRecordingScreen` or `macos: stopNativeScreenRecording` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: stopRecordingScreen` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-apple: :material-android: :material-coffee: :material-apple-finder: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `mobile: stopXCTestScreenRecording` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: stopMediaProjectionRecording` execute method :material-android: :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: stopRecordingScreen` or `macos: stopNativeScreenRecording` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: stopRecordingScreen` execute method :material-microsoft-windows:
|
||||
- `GET /session/:sessionId/application_cache/status`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `POST /session/:sessionId/buttondown`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: [W3C Actions API](https://www.selenium.dev/documentation/webdriver/actions_api/) (`pointerDown`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: [W3C Actions API](https://www.selenium.dev/documentation/webdriver/actions_api/) (`pointerDown`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/buttonup`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/click`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown` & `pointerUp`) :simple-appium:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown` & `pointerUp`) :simple-appium:
|
||||
- `POST /session/:sessionId/dismiss_alert`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/alert/dismiss` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/alert/dismiss` :simple-appium:
|
||||
- `POST /session/:sessionId/doubleclick`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown` & `pointerUp`) :simple-appium:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown` & `pointerUp`) :simple-appium:
|
||||
- `POST /session/:sessionId/element/active`
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/element/active` :simple-appium:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/element/active` :simple-appium:
|
||||
- `GET /session/:sessionId/element/:elementId/equals/:otherId`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- `GET /session/:sessionId/element/:elementId/location`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/element/:elementId/rect` :simple-appium:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/element/:elementId/rect` :simple-appium:
|
||||
- `GET /session/:sessionId/element/:elementId/location_in_view`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- `GET /session/:sessionId/element/:elementId/pageIndex`
|
||||
- :octicons-no-entry-24: MJSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: MJSONWP protocol command with no direct replacement
|
||||
- `GET /session/:sessionId/element/:elementId/size`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/element/:elementId/rect` :simple-appium:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/element/:elementId/rect` :simple-appium:
|
||||
- `POST /session/:sessionId/element/:elementId/submit`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `POST /session/:sessionId/execute`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/execute/sync` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/execute/sync` :simple-appium:
|
||||
- `POST /session/:sessionId/execute_async`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/execute/async` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/execute/async` :simple-appium:
|
||||
- `POST /session/:sessionId/keys`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`keyDown` & `keyUp`) :simple-appium:
|
||||
- Selenium-based clients can also use [Send Keys](https://www.selenium.dev/documentation/webdriver/actions_api/keyboard/#send-keys)
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`keyDown` & `keyUp`) :simple-appium:
|
||||
- Selenium-based clients can also use [Send Keys](https://www.selenium.dev/documentation/webdriver/actions_api/keyboard/#send-keys)
|
||||
- `GET /session/:sessionId/local_storage`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `POST /session/:sessionId/local_storage`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `DELETE /session/:sessionId/local_storage`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `GET /session/:sessionId/local_storage/key/:key`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `DELETE /session/:sessionId/local_storage/key/:key`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `GET /session/:sessionId/local_storage/size`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `POST /session/:sessionId/log`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/se/log` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/se/log` :simple-appium:
|
||||
- `GET /session/:sessionId/log/types`
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/se/log/types` :simple-appium:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/se/log/types` :simple-appium:
|
||||
- `POST /session/:sessionId/moveto`
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerMove`) :simple-appium:
|
||||
- Selenium-based clients can also use [Move by Offset](https://www.selenium.dev/documentation/webdriver/actions_api/mouse/#move-by-offset)
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerMove`) :simple-appium:
|
||||
- Selenium-based clients can also use [Move by Offset](https://www.selenium.dev/documentation/webdriver/actions_api/mouse/#move-by-offset)
|
||||
- `GET /session/:sessionId/screenshot/:elementId`
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/element/:elementId/screenshot` :simple-appium:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/element/:elementId/screenshot` :simple-appium:
|
||||
- `GET /session/:sessionId/session_storage`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `POST /session/:sessionId/session_storage`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `DELETE /session/:sessionId/session_storage`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `GET /session/:sessionId/session_storage/key/:key`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `DELETE /session/:sessionId/session_storage/key/:key`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `GET /session/:sessionId/session_storage/size`
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- :octicons-no-entry-24: JSONWP protocol command with no direct replacement
|
||||
- `POST /session/:sessionId/timeouts/async_script`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/timeouts` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/timeouts` :simple-appium:
|
||||
- `POST /session/:sessionId/timeouts/implicit_wait`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/timeouts` :simple-appium:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/timeouts` :simple-appium:
|
||||
- `POST /session/:sessionId/touch/click`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown` & `pointerUp`) :simple-appium:
|
||||
- Selenium-based clients can also use [Click and Release](https://www.selenium.dev/documentation/webdriver/actions_api/mouse/#click-and-release)
|
||||
- :octicons-arrow-right-24: `mobile: tap` or `mobile: tapWithNumberOfTaps` execute methods :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: clickGesture` execute method :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: clickAction` execute method :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: click`, `macos: rightClick`, `macos: press` or `macos: tap` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: click` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown` & `pointerUp`) :simple-appium:
|
||||
- Selenium-based clients can also use [Click and Release](https://www.selenium.dev/documentation/webdriver/actions_api/mouse/#click-and-release)
|
||||
- :octicons-arrow-right-24: `mobile: tap` or `mobile: tapWithNumberOfTaps` execute methods :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: clickGesture` execute method :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: clickAction` execute method :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: click`, `macos: rightClick`, `macos: press` or `macos: tap` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: click` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/touch/doubleclick`
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown` & `pointerUp`) :simple-appium:
|
||||
- Selenium-based clients can also use [Double Click](https://www.selenium.dev/documentation/webdriver/actions_api/mouse/#double-click)
|
||||
- :octicons-arrow-right-24: `mobile: doubleTap` or `mobile: tapWithNumberOfTaps` execute methods :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: doubleClickGesture` execute method :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: clickAction` execute method :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: doubleClick` or `macos: doubleTap` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: click` execute method :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown` & `pointerUp`) :simple-appium:
|
||||
- Selenium-based clients can also use [Double Click](https://www.selenium.dev/documentation/webdriver/actions_api/mouse/#double-click)
|
||||
- :octicons-arrow-right-24: `mobile: doubleTap` or `mobile: tapWithNumberOfTaps` execute methods :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: doubleClickGesture` execute method :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: clickAction` execute method :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: doubleClick` or `macos: doubleTap` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: click` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/touch/down`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/touch/flick`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown`, `pointerMove` & `pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: flingGesture` execute method :material-android:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown`, `pointerMove` & `pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: flingGesture` execute method :material-android:
|
||||
- `POST /session/:sessionId/touch/longclick`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown`, `pause` & `pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: touchAndHold` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: longClickGesture` execute method :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: clickAction` execute method :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: press` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: click` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown`, `pause` & `pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: touchAndHold` execute method :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: longClickGesture` execute method :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: clickAction` execute method :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: press` execute method :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: click` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/touch/multi/perform`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/actions` :simple-appium:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/actions` :simple-appium:
|
||||
- `POST /session/:sessionId/touch/move`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerMove`) :simple-appium:
|
||||
- Selenium-based clients can also use [Move by Offset](https://www.selenium.dev/documentation/webdriver/actions_api/mouse/#move-by-offset)
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerMove`) :simple-appium:
|
||||
- Selenium-based clients can also use [Move by Offset](https://www.selenium.dev/documentation/webdriver/actions_api/mouse/#move-by-offset)
|
||||
- `POST /session/:sessionId/touch/perform`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/actions` :simple-appium:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/actions` :simple-appium:
|
||||
- `POST /session/:sessionId/touch/scroll`
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown`, `pointerMove` & `pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: scroll` or `mobile: swipe` execute methods :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: scrollGesture` or `mobile: swipeGesture` execute methods :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: swipe` execute method :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: scroll` or `macos: swipe` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: scroll` execute method :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerDown`, `pointerMove` & `pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `mobile: scroll` or `mobile: swipe` execute methods :material-apple:
|
||||
- :octicons-arrow-right-24: `mobile: scrollGesture` or `mobile: swipeGesture` execute methods :material-android:
|
||||
- :octicons-arrow-right-24: `mobile: swipe` execute method :material-coffee:
|
||||
- :octicons-arrow-right-24: `macos: scroll` or `macos: swipe` execute methods :material-apple-finder:
|
||||
- :octicons-arrow-right-24: `windows: scroll` execute method :material-microsoft-windows:
|
||||
- `POST /session/:sessionId/touch/up`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: W3C Actions API (`pointerUp`) :simple-appium:
|
||||
- :octicons-arrow-right-24: `windows: keys` execute method :material-microsoft-windows:
|
||||
- `GET /session/:sessionId/window_handle`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window` :simple-appium:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window` :simple-appium:
|
||||
- `GET /session/:sessionId/window_handles`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window/handles` :simple-appium:
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window/handles` :simple-appium:
|
||||
- `GET /session/:sessionId/window/handle`
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window` :simple-appium:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window` :simple-appium:
|
||||
- `POST /session/:sessionId/window/:windowhandle/maximize`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/window/maximize` :simple-appium:
|
||||
- :fontawesome-solid-triangle-exclamation: Only supported for the current window
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/window/maximize` :simple-appium:
|
||||
- :fontawesome-solid-triangle-exclamation: Only supported for the current window
|
||||
- `GET /session/:sessionId/window/:windowhandle/position`
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window/rect` :simple-appium:
|
||||
- :fontawesome-solid-triangle-exclamation: Only supported for the current window
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window/rect` :simple-appium:
|
||||
- :fontawesome-solid-triangle-exclamation: Only supported for the current window
|
||||
- `POST /session/:sessionId/window/:windowhandle/position`
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/window/rect` :simple-appium:
|
||||
- :fontawesome-solid-triangle-exclamation: Only supported for the current window
|
||||
- :octicons-arrow-right-24: `POST /session/:sessionId/window/rect` :simple-appium:
|
||||
- :fontawesome-solid-triangle-exclamation: Only supported for the current window
|
||||
- `GET /session/:sessionId/window/:windowhandle/size`
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window/rect` :simple-appium:
|
||||
- :fontawesome-solid-triangle-exclamation: Only supported for the current window
|
||||
- :octicons-check-24: Moved to drivers: :material-microsoft-windows:
|
||||
- :octicons-arrow-right-24: `GET /session/:sessionId/window/rect` :simple-appium:
|
||||
- :fontawesome-solid-triangle-exclamation: Only supported for the current window
|
||||
|
||||
### Modified
|
||||
|
||||
@@ -437,19 +436,19 @@ parameters (note that no new parameters have been added). Each endpoint lists th
|
||||
longer accepts, as well as the parameters it continues to accept in Appium 3.
|
||||
|
||||
- `POST /session`
|
||||
- :octicons-x-24: `desiredCapabilities`, `requiredCapabilities`
|
||||
- :octicons-check-24: `capabilities`
|
||||
- :octicons-x-24: `desiredCapabilities`, `requiredCapabilities`
|
||||
- :octicons-check-24: `capabilities`
|
||||
- `POST /session/:sessionId/alert/text`
|
||||
- :octicons-x-24: `value`
|
||||
- :octicons-check-24: `text`
|
||||
- :octicons-x-24: `value`
|
||||
- :octicons-check-24: `text`
|
||||
- `GET /session/:sessionId/appium/device/system_time`
|
||||
- :octicons-x-24: `format`
|
||||
- :octicons-check-24: None
|
||||
- :octicons-x-24: `format`
|
||||
- :octicons-check-24: None
|
||||
- `POST /session/:sessionId/element/:elementId/value`
|
||||
- :octicons-x-24: `value`
|
||||
- :octicons-check-24: `text`
|
||||
- :octicons-x-24: `value`
|
||||
- :octicons-check-24: `text`
|
||||
- `POST /session/:sessionId/window`
|
||||
- :octicons-x-24: `name`
|
||||
- :octicons-check-24: `handle`
|
||||
- :octicons-x-24: `name`
|
||||
- :octicons-check-24: `handle`
|
||||
|
||||
[^sim]: Supported in emulators/simulators only
|
||||
|
||||
@@ -23,9 +23,9 @@ title: How Does Appium Work?
|
||||
|
||||
iOSとAndroidだけでなくより多くのアプリプラットフォームが存在していることを考えると、その背景には別の、より大きな疑問が潜んでいます。
|
||||
|
||||
- どのようにして_全ての_プラットフォームに対して自動化を実現するか?
|
||||
- どのようにして_全ての_プラットフォームに対して自動化を実現するか?
|
||||
|
||||
これらの疑問へのAppiumの答えを知ることは、Appiumが何かを学ぶ最短の方法ではないかもしれませんが、確かな道になります。 では、見ていきましょう。
|
||||
これらの疑問へのAppiumの答えを知ることは、Appiumが何かを学ぶ最短の方法ではないかもしれませんが、確かな道になります。では、見ていきましょう。
|
||||
|
||||
## Appium's choice of API
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: Getting Started
|
||||
---
|
||||
|
||||
さっそくAppiumを使ってみましょう! このクイックスタートをうまく使うために、[はじめに](../intro/index.md)を読み、Appiumの実行やスクリプトの記述に関わる概念を理解することをお勧めします。
|
||||
さっそくAppiumを使ってみましょう!このクイックスタートをうまく使うために、[はじめに](../intro/index.md)を読み、Appiumの実行やスクリプトの記述に関わる概念を理解することをお勧めします。
|
||||
|
||||
このクイックスタートは以下の通り進めます:
|
||||
|
||||
@@ -18,6 +18,6 @@ title: Getting Started
|
||||
|
||||
### 必要条件
|
||||
|
||||
始める前に、お使いのシステムが[要件](../quickstart/requirements.md) を満たしていることを確認してください。 追加要件については、UiAutomator2 ドライバーのインストールと合わせて説明します。 また、このガイドでは基本的なコマンド実行や環境変数の設定と保持などができることを前提としています。
|
||||
始める前に、お使いのシステムが[要件](../quickstart/requirements.md) を満たしていることを確認してください。追加要件については、UiAutomator2 ドライバーのインストールと合わせて説明します。また、このガイドでは基本的なコマンド実行や環境変数の設定と保持などができることを前提としています。
|
||||
|
||||
さあ、これで準備は整いました! [Appiumのインストール](./install.md)に進んでください。
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: 次のステップ
|
||||
---
|
||||
|
||||
Android自動化用のシステムの設定と簡単なテストの実行が完了したら、このドキュメントを引き続き参照してください。 特に初心者にとって、これらは優れたガイドと参考資料です:
|
||||
Android自動化用のシステムの設定と簡単なテストの実行が完了したら、このドキュメントを引き続き参照してください。特に初心者にとって、これらは優れたガイドと参考資料です:
|
||||
|
||||
- [エコシステム](../ecosystem/index.md) ページ: 利用可能なドライバー、クライアント、プラグイン、ツールを見る
|
||||
- [Appium ドライバーとプラグインの管理](../guides/managing-exts.md)
|
||||
|
||||
@@ -57,7 +57,7 @@ session.unsubscribe
|
||||
|
||||
> WebDriver BiDi documentation: [session.unsubscribe](https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe)
|
||||
|
||||
Unsubscribes using previously returned subscription IDs, or the legacy event/context form.
|
||||
Unsubscribes using either previously returned subscription IDs or event names.
|
||||
Removing a subscription ID preserves any overlapping subscriptions.
|
||||
|
||||
#### Parameters
|
||||
|
||||
@@ -31,7 +31,7 @@ appium
|
||||
| `--allow-insecure` | List of [insecure features](../../guides/security.md) that should be allowed in this server's sessions. Individual features can be overridden by `--deny-insecure`. Has no effect in combination with `--relaxed-security`. | array<string> | `[]` |
|
||||
| `--allow-unknown-args` | Do not exit if unrecognized command-line arguments are passed to the server; ignore them instead. Useful when the Appium CLI is wrapped by external tooling that appends extra flags. | boolean | `false` |
|
||||
| `--base-path`, `-pa` | Base path to use as the prefix for all webdriver routes running on the server | string | `""` |
|
||||
| `--callback-address`, `-ca` | Callback IP address | string | `0.0.0.0` |
|
||||
| `--callback-address`, `-ca` | Callback IP address | string | same as `--address` |
|
||||
| `--callback-port`, `-cp` | Callback port | integer | `4723` |
|
||||
| `--config` | Path to an [Appium configuration JSON file](../../guides/config.md) | string | |
|
||||
| `--debug-log-spacing` | Add exaggerated spacing in logs to help with visual inspection | boolean | `false` |
|
||||
|
||||
@@ -46,5 +46,11 @@ capabilities is optional and entirely driver-dependent.
|
||||
| --------------------------------------------------- | ------------------------------------------------------------- |
|
||||
| `platformVersion` | Must be `string` |
|
||||
| `appium:app` | Must be `string`; empty values are ignored |
|
||||
| `appium:autoLaunch` (deprecated) | Must be `boolean` |
|
||||
| `appium:autoWebview` | Must be `boolean` |
|
||||
| `appium:fullReset` | Must be `boolean`; mutually exclusive with `appium:noReset` |
|
||||
| `appium:language` | Must be `string` |
|
||||
| `appium:locale` | Must be `string` |
|
||||
| `appium:orientation` | Must be either `LANDSCAPE` or `PORTRAIT` |
|
||||
| `appium:noReset` | Must be `boolean`; mutually exclusive with `appium:fullReset` |
|
||||
| `appium:udid` | Must be `string` |
|
||||
|
||||
@@ -45,7 +45,7 @@ contributors!
|
||||
|
||||
## Gold Sponsors
|
||||
|
||||
<div class="sponsor-section"><a href="https://device.io/" target="_blank"><img src="https://images.opencollective.com/device-io/cc7e949/avatar/64.png" alt="Device.io" /></a>
|
||||
<div class="sponsor-section"><a href="https://jetify.com/" target="_blank"><img src="https://images.opencollective.com/jetify/415824c/avatar/64.png" alt="Jetify" /></a>
|
||||
</div>
|
||||
|
||||
[Become a Gold Sponsor](https://opencollective.com/appium/contribute/gold-sponsor-72877/checkout?interval=month&amount=500&contributeAs=me)
|
||||
|
||||
@@ -57,7 +57,6 @@ nav:
|
||||
- reference/api/plugins.md
|
||||
- Guides:
|
||||
- Migration:
|
||||
- guides/migrating-3-to-4.md
|
||||
- guides/migrating-2-to-3.md
|
||||
- guides/migrating-1-to-2.md
|
||||
- Server/Driver Configuration:
|
||||
@@ -74,7 +73,6 @@ nav:
|
||||
- guides/caps.md
|
||||
- guides/settings.md
|
||||
- guides/execute-methods.md
|
||||
- guides/gestures.md
|
||||
- guides/context.md
|
||||
- guides/event-timing.md
|
||||
- More Resources:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 20 KiB |
@@ -10,16 +10,18 @@
|
||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||
/* eslint-disable promise/prefer-await-to-then */
|
||||
|
||||
import {readFileSync} from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
|
||||
import {deploy, buildSite} from '@appium/docutils';
|
||||
import semver from 'semver';
|
||||
|
||||
import {log, LANGS, DOCS_DIR, DOCS_BRANCH, DOCS_PREFIX, DOCS_REMOTE, LATEST_ALIAS} from './utils.js';
|
||||
|
||||
const {version} = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
|
||||
const {
|
||||
log,
|
||||
LANGS,
|
||||
DOCS_DIR,
|
||||
DOCS_BRANCH,
|
||||
DOCS_PREFIX,
|
||||
DOCS_REMOTE,
|
||||
LATEST_ALIAS,
|
||||
} = require('./utils');
|
||||
const path = require('node:path');
|
||||
const semver = require('semver');
|
||||
const {version} = require('../../package.json');
|
||||
|
||||
const branch = process.env.APPIUM_DOCS_BRANCH ?? DOCS_BRANCH;
|
||||
const basePrefix = process.env.APPIUM_DOCS_PREFIX ?? DOCS_PREFIX;
|
||||
@@ -32,6 +34,9 @@ const push = Boolean(process.env.APPIUM_DOCS_PUBLISH);
|
||||
* Builds and optionally deploys docs for each supported language.
|
||||
*/
|
||||
async function main() {
|
||||
// @appium/docutils is ESM-only; this file is CommonJS, so it must be loaded dynamically
|
||||
const {deploy, buildSite} = await import('@appium/docutils');
|
||||
|
||||
log.info(`Building Appium docs and committing to ${DOCS_BRANCH}`);
|
||||
|
||||
const semVersion = semver.parse(version);
|
||||
@@ -64,10 +69,10 @@ async function main() {
|
||||
}
|
||||
}
|
||||
|
||||
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
||||
if (require.main === module) {
|
||||
main().catch((err) => {
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
export default main;
|
||||
module.exports = main;
|
||||
|
||||
@@ -167,14 +167,10 @@ async function main() {
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
void (async () => {
|
||||
try {
|
||||
await main();
|
||||
} catch (err) {
|
||||
console.error(err.message);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
})();
|
||||
main().catch((err) => {
|
||||
console.error(err.message);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = main;
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
// for simplicity this file is not transpiled and is run directly via an npm script
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable promise/prefer-await-to-callbacks */
|
||||
/* eslint-disable promise/prefer-await-to-then */
|
||||
|
||||
const path = require('node:path');
|
||||
const {fs} = require('@appium/support');
|
||||
const {AppiumConfigJsonSchema} = require('@appium/schema');
|
||||
|
||||
const DOC_PATH = path.resolve(__dirname, '..', 'en', 'cli', 'args.md');
|
||||
|
||||
const START_TAG = `<!-- AUTOGEN-START -->`;
|
||||
const STOP_TAG = `<!-- AUTOGEN-STOP -->`;
|
||||
|
||||
/**
|
||||
* Regenerates the CLI arguments table in docs.
|
||||
*/
|
||||
async function main() {
|
||||
console.log(`Gathering current cli doc file contents...`);
|
||||
const [preStart, postEnd] = await getDocParts();
|
||||
console.log(`Generating new cli arg table...`);
|
||||
const argTable = getCliArgTable();
|
||||
console.log(`Writing new doc file...`);
|
||||
await writeNewDoc(preStart, argTable, postEnd);
|
||||
console.log(`...done!`);
|
||||
}
|
||||
|
||||
async function getDocParts() {
|
||||
if (!(await fs.exists(DOC_PATH))) {
|
||||
throw new Error(`Cannot find args.md at ${DOC_PATH}`);
|
||||
}
|
||||
|
||||
const curContents = await fs.readFile(DOC_PATH, 'utf-8');
|
||||
|
||||
// attempt to verify the start/stop tags
|
||||
const [preStart, postStart] = curContents.split(START_TAG);
|
||||
if (!postStart) {
|
||||
throw new Error(`Could not find autogen start tag '${START_TAG}'. Make sure it's in place!`);
|
||||
}
|
||||
const [, postEnd] = postStart.split(STOP_TAG);
|
||||
if (!postEnd) {
|
||||
throw new Error(`Could not find autogen stop tag '${STOP_TAG}'. Make sure it's in place!`);
|
||||
}
|
||||
|
||||
return [preStart, postEnd];
|
||||
}
|
||||
|
||||
function getCliArgTable() {
|
||||
const pad = ' '.repeat(30);
|
||||
const header = `|Argument${pad}|Description|Type|Default|Aliases|\n` + `|--|--|--|--|--|`;
|
||||
const serverProps = AppiumConfigJsonSchema.properties.server.properties;
|
||||
const args = Object.keys(serverProps).map((arg) => {
|
||||
let {appiumCliAliases = [], description, type, items, maximum, minimum} = serverProps[arg];
|
||||
let def = serverProps[arg].default;
|
||||
let enums = serverProps[arg].enum;
|
||||
if (type === 'array' || type === 'object' || (type === 'string' && def === '')) {
|
||||
def = JSON.stringify(def);
|
||||
}
|
||||
if (type === 'array' && items.type) {
|
||||
type = `array<${items.type}>`;
|
||||
}
|
||||
if (type === 'integer' && typeof minimum !== 'undefined' && typeof maximum !== 'undefined') {
|
||||
description = `${description} (Value must be between \`${minimum}\` and \`${maximum}\`)`;
|
||||
}
|
||||
if (enums) {
|
||||
const enumsFormatted = enums.map((e) => `\`${e}\``).join(', ');
|
||||
description = `${description} (Value must be one of: ${enumsFormatted})`;
|
||||
}
|
||||
return {
|
||||
arg: `--${arg}`,
|
||||
aliases: appiumCliAliases.map((a) => `-${a}`),
|
||||
type,
|
||||
def,
|
||||
description,
|
||||
};
|
||||
});
|
||||
const body = args
|
||||
.map(({arg, aliases, type, def, description}) => {
|
||||
const aliasStr = aliases.map((a) => `\`${a}\``).join(', ');
|
||||
def = typeof def !== 'undefined' ? `\`${def}\`` : '';
|
||||
return `|\`${arg}\`|${description}|${type}|${def}|${aliasStr}|`;
|
||||
})
|
||||
.join('\n');
|
||||
return `${header}\n${body}`;
|
||||
}
|
||||
|
||||
async function writeNewDoc(preStart, argTable, postEnd) {
|
||||
const newContents = `${preStart}${START_TAG}\n${argTable}\n${STOP_TAG}${postEnd}`;
|
||||
await fs.writeFile(DOC_PATH, newContents);
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
main().catch((err) => {
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = main;
|
||||
@@ -2,19 +2,28 @@
|
||||
|
||||
// for simplicity this file is not transpiled and is run directly via an npm script
|
||||
//
|
||||
import path from 'node:path';
|
||||
|
||||
import {logger} from '@appium/support';
|
||||
const {logger} = require('@appium/support');
|
||||
const path = require('node:path');
|
||||
|
||||
const log = logger.getLogger('Docs');
|
||||
|
||||
const DOCS_REMOTE = 'origin';
|
||||
const DOCS_BRANCH = 'gh-pages';
|
||||
const DOCS_PREFIX = 'docs';
|
||||
const DOCS_DIR = path.resolve(import.meta.dirname, '..');
|
||||
const DOCS_DIR = path.resolve(__dirname, '..');
|
||||
const LATEST_ALIAS = 'latest';
|
||||
const ASSETS_DIR = path.join(DOCS_DIR, 'assets');
|
||||
const LANGS = ['en', 'ja', 'zh'];
|
||||
const DEFAULT_LANG = 'en';
|
||||
|
||||
export {log, DOCS_DIR, ASSETS_DIR, LANGS, DEFAULT_LANG, DOCS_BRANCH, DOCS_PREFIX, DOCS_REMOTE, LATEST_ALIAS};
|
||||
module.exports = {
|
||||
log,
|
||||
DOCS_DIR,
|
||||
ASSETS_DIR,
|
||||
LANGS,
|
||||
DEFAULT_LANG,
|
||||
DOCS_BRANCH,
|
||||
DOCS_PREFIX,
|
||||
DOCS_REMOTE,
|
||||
LATEST_ALIAS,
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@ date: 2024-07-13
|
||||
|
||||
# Appium Conf 2024: 现在开始征集提案
|
||||
|
||||
我们很兴奋地宣布,Appium Conf 已回归并在2024年上线! 这是官方的Appium会议,您可以在会上了解Appium 2中的所有新内容。 并探索设备自动化测试、移动应用程序和桌面应用程序的最新版本。
|
||||
我们很兴奋地宣布,Appium Conf 已回归并在2024年上线!这是官方的Appium会议,您可以在会上了解Appium 2中的所有新内容。 并探索设备自动化测试、移动应用程序和桌面应用程序的最新版本。
|
||||
|
||||
<!-- more -->
|
||||
|
||||
@@ -19,7 +19,7 @@ date: 2024-07-13
|
||||
|
||||
## 标记您的日历:2024年9月13日
|
||||
|
||||
2024年9月13日,请加入我们,参加Appium团队和世界顶级移动测试和自动化专家为期一天的鼓舞人心且实用的演讲。 随着Appium 2.0的成熟,这是您深入了解并学习如何最大限度地发挥其潜力的机会。
|
||||
2024年9月13日,请加入我们,参加Appium团队和世界顶级移动测试和自动化专家为期一天的鼓舞人心且实用的演讲。随着Appium 2.0的成熟,这是您深入了解并学习如何最大限度地发挥其潜力的机会。
|
||||
|
||||
## 为什么参加了2024年的Appium Conf ?
|
||||
|
||||
@@ -30,16 +30,16 @@ date: 2024-07-13
|
||||
|
||||
## 征集提案:分享您的知识!
|
||||
|
||||
我们正在寻找来自全球各地的各种演讲者,他们渴望分享移动测试自动化的创新想法和用例。 如果您有使用Appium的经验和见解,可以使测试从业者社区受益,我们想听听您的意见!
|
||||
我们正在寻找来自全球各地的各种演讲者,他们渴望分享移动测试自动化的创新想法和用例。如果您有使用Appium的经验和见解,可以使测试从业者社区受益,我们想听听您的意见!
|
||||
|
||||
不要错过这个机会,为Appium社区做出贡献,并在全球舞台上展示你的专业知识。
|
||||
|
||||
## 如何提交您的提案
|
||||
|
||||
访问我们的网站 [https://appiumconf.com/](https://appiumconf.com/) 并[提交提案](https://confengine.com/conferences/appium-conf-2024/proposals?utm_medium=referal&utm_source=appium.io&utm_campaign=launch)。 我们很高兴看到您在 Appium 中的创新想法和经验!
|
||||
访问我们的网站 [https://appiumconf.com/](https://appiumconf.com/) 并[提交提案](https://confengine.com/conferences/appium-conf-2024/proposals?utm_medium=referal&utm_source=appium.io&utm_campaign=launch)。我们很高兴看到您在 Appium 中的创新想法和经验!
|
||||
|
||||
## 敬请期待
|
||||
|
||||
关注我们的网站和社交媒体频道以了解会议日程安排的更新, 主旨演讲人和2024年Appium Conf 的更令人兴奋的细节。
|
||||
|
||||
加入我们来塑造移动设备测试自动化的未来。 立即提交您的提案,成为这一激动人心的活动的一部分!
|
||||
加入我们来塑造移动设备测试自动化的未来。立即提交您的提案,成为这一激动人心的活动的一部分!
|
||||
@@ -5,22 +5,21 @@ hide:
|
||||
title: 对Appium 的贡献
|
||||
---
|
||||
|
||||
Appium项目离不开来自公司和志愿者的代码、文档、维护和支持的众多贡献。 因此,我们欢迎贡献!
|
||||
Appium项目离不开来自公司和志愿者的代码、文档、维护和支持的众多贡献。因此,我们欢迎贡献!
|
||||
|
||||
有许多不同的方式可以帮助项目——请参阅下方了解您可以做的一切以及每个贡献方法的流程。 请注意,无论您如何贡献,您的参与都受我们的[行为准则](https://github.com/appium/.github/blob/master/CODE_OF_CONDUCT.md)管辖。
|
||||
有许多不同的方式可以帮助项目——请参阅下方了解您可以做的一切以及每个贡献方法的流程。请注意,无论您如何贡献,您的参与都受我们的[行为准则](https://github.com/appium/.github/blob/master/CODE_OF_CONDUCT.md)管辖。
|
||||
|
||||
## 加入讨论论坛
|
||||
|
||||
您不需要了解Appium的内部机制就能做出贡献! 如果您有使用Appium的经验,并愿意与他人分享您的知识,请考虑在Appium论坛[discuss.appium.io](https://discuss.appium.io/)上帮助用户。 快去看看是否有您能回答的问题。
|
||||
您不需要了解Appium的内部机制就能做出贡献!如果您有使用Appium的经验,并愿意与他人分享您的知识,请考虑在Appium论坛[discuss.appium.io](https://discuss.appium.io/)上帮助用户。快去看看是否有您能回答的问题。
|
||||
|
||||
## 报告错误或功能请求
|
||||
|
||||
如果您遇到了一个bug,或者有一个很酷的功能想法,认为Appium应该支持,请务必在我们的[GitHub issue tracker](https://github.com/appium/appium/issues)上告诉我们。
|
||||
请在创建issue时使用适当的issue表单模板。
|
||||
如果您遇到了一个bug,或者有一个很酷的功能想法,认为Appium应该支持,请务必在我们的[GitHub issue tracker](https://github.com/appium/appium/issues)上告诉我们。请在创建issue时使用适当的issue表单模板。
|
||||
|
||||
## 对问题分类
|
||||
|
||||
除了创建issue,您还可以帮助我们调查已报告的问题。 您只需要对Appium有足够的熟悉程度来尝试重现bug。
|
||||
除了创建issue,您还可以帮助我们调查已报告的问题。您只需要对Appium有足够的熟悉程度来尝试重现bug。
|
||||
|
||||
您可以通过检查我们的[GitHub issue tracker](https://github.com/appium/appium/issues)中带有标签如`Needs Triage`或`Needs Info`的问题开始,并留下相关评论:
|
||||
|
||||
@@ -118,8 +117,7 @@ When adding or moving class methods, follow these conventions:
|
||||
|
||||
### 文档
|
||||
|
||||
此项目的文档位于项目[仓库本身](https://github.com/appium/appium/tree/master/packages/appium/docs)中。
|
||||
它包含在Markdown文件中,这些文件由`@appium/docutils`模块中的文档系统构建。 该模块基于[MkDocs](https://www.mkdocs.org/),因此需要在您的系统上安装[Python](https://www.python.org/)。
|
||||
此项目的文档位于项目[仓库本身](https://github.com/appium/appium/tree/master/packages/appium/docs)中。它包含在Markdown文件中,这些文件由`@appium/docutils`模块中的文档系统构建。该模块基于[MkDocs](https://www.mkdocs.org/),因此需要在您的系统上安装[Python](https://www.python.org/)。
|
||||
|
||||
安装 Python 依赖:
|
||||
|
||||
@@ -137,17 +135,16 @@ npm run dev:docs
|
||||
|
||||
## 翻译Appium 文档
|
||||
|
||||
Appium文档本地化为英语以外语言的过程是自动化的,通过[Crowdin翻译管理系统](https://crowdin.com)完成。 请勿直接在GitHub Appium仓库中编辑任何翻译文档,因为它们将在即将进行的同步中被从Crowdin导出的文档替换。
|
||||
Appium文档本地化为英语以外语言的过程是自动化的,通过[Crowdin翻译管理系统](https://crowdin.com)完成。请勿直接在GitHub Appium仓库中编辑任何翻译文档,因为它们将在即将进行的同步中被从Crowdin导出的文档替换。
|
||||
|
||||
### 从哪里开始
|
||||
|
||||
如果您想为Appium文档翻译成您的语言做出贡献,只需加入[Appium Documentation](https://crowdin.com/project/appium-documentation) Crowdin项目的翻译者组,然后在那里开始翻译文档。 如果您看到您的语言在Crowdin可用语言列表中缺失,请通过创建[issue](https://github.com/appium/appium/issues)告诉我们。
|
||||
如果您想为Appium文档翻译成您的语言做出贡献,只需加入[Appium Documentation](https://crowdin.com/project/appium-documentation) Crowdin项目的翻译者组,然后在那里开始翻译文档。如果您看到您的语言在Crowdin可用语言列表中缺失,请通过创建[issue](https://github.com/appium/appium/issues)告诉我们。
|
||||
|
||||
### 源语言更新
|
||||
|
||||
文档中的更改通过 `Update Crowdin English Docs GitHub` action自动同步到Crowdin。
|
||||
一旦 `packages/appium/docs/en/**.md` 或 `packages/appium/docs/mkdocs-en.yml` 下有任何更改,此action就会自动触发。
|
||||
文档中的更改通过 `Update Crowdin English Docs GitHub` action自动同步到Crowdin。一旦 `packages/appium/docs/en/**.md` 或 `packages/appium/docs/mkdocs-en.yml` 下有任何更改,此action就会自动触发。
|
||||
|
||||
### 获取翻译文档
|
||||
|
||||
为了从Crowdin获取翻译文件到GitHub仓库,需要触发 `Sync Crowdin Docs Translations` action。 此action还会自动创建一个包含相应翻译资源的PR。
|
||||
为了从Crowdin获取翻译文件到GitHub仓库,需要触发 `Sync Crowdin Docs Translations` action。此action还会自动创建一个包含相应翻译资源的PR。
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
title: 构建文档
|
||||
---
|
||||
|
||||
一旦你为 Appium 构建了 [驱动](./build-drivers.md) 或 [插件](./build-plugins.md),通常也会希望为用户说明这个扩展是如何工作的。 最基础的方式就是编写一个简短的 `README.md`,并将它放在项目仓库的根目录中。
|
||||
不过,这样做可能会耗费不少精力。
|
||||
一旦你为 Appium 构建了 [驱动](./build-drivers.md) 或 [插件](./build-plugins.md),通常也会希望为用户说明这个扩展是如何工作的。最基础的方式就是编写一个简短的 `README.md`,并将它放在项目仓库的根目录中。不过,这样做可能会耗费不少精力。
|
||||
|
||||
Appium 项目已经提供了辅助工具,并且我们把这些工具打包好了,以便生态系统中的驱动和插件开发者也能使用。 这些工具最好的入门方式是查看一个现有的 Appium 驱动仓库,看看它是如何组织文档的,例如 [XCUITest 驱动仓库](https://github.com/appium/appium-xcuitest-driver)。 不过,本指南会先介绍基本的实现思路。
|
||||
Appium 项目已经提供了辅助工具,并且我们把这些工具打包好了,以便生态系统中的驱动和插件开发者也能使用。这些工具最好的入门方式是查看一个现有的 Appium 驱动仓库,看看它是如何组织文档的,例如 [XCUITest 驱动仓库](https://github.com/appium/appium-xcuitest-driver)。不过,本指南会先介绍基本的实现思路。
|
||||
|
||||
### 概念架构
|
||||
|
||||
Appium 采用 [MkDocs](https://www.mkdocs.org/) 作为基于 Markdown 的文档站点的生成工具。 它使用 Python 工具链(而不是 Node.js),但这恰好是我们当前需求下最合适的选择。 你可以自行调整,不过默认情况下,Appium 的工具链也会假设你使用 [mkdocs-material](https://squidfunk.github.io/mkdocs-material/) 主题与扩展来搭建 MkDocs。
|
||||
Appium 采用 [MkDocs](https://www.mkdocs.org/) 作为基于 Markdown 的文档站点的生成工具。它使用 Python 工具链(而不是 Node.js),但这恰好是我们当前需求下最合适的选择。你可以自行调整,不过默认情况下,Appium 的工具链也会假设你使用 [mkdocs-material](https://squidfunk.github.io/mkdocs-material/) 主题与扩展来搭建 MkDocs。
|
||||
|
||||
为了让你的文档能够支持不同版本(通常是每个小版本一个),我们还会捆绑 [Mike](https://github.com/jimporter/mike)。
|
||||
|
||||
@@ -37,12 +36,12 @@ npx appium-docs init
|
||||
|
||||
这一步会:
|
||||
|
||||
1. 创建一个 `tsconfig.json`(如果当前还没有的话)。 即使你的扩展并不是 TypeScript 编写的,这也是必需的。
|
||||
1. 创建一个 `tsconfig.json`(如果当前还没有的话)。即使你的扩展并不是 TypeScript 编写的,这也是必需的。
|
||||
2. 创建一个 `mkdocs.yml`,其中包含 MkDocs 所需的配置。
|
||||
|
||||
### 为你的扩展编写文档
|
||||
|
||||
此时你就可以开始为扩展编写文档了。 默认情况下,MkDocs 会在 `docs` 目录中查找 Markdown 文件。 因此,你可以创建文档文件并放入 `docs`,然后在 `mkdocs.yml` 里添加相应链接。
|
||||
此时你就可以开始为扩展编写文档了。默认情况下,MkDocs 会在 `docs` 目录中查找 Markdown 文件。因此,你可以创建文档文件并放入 `docs`,然后在 `mkdocs.yml` 里添加相应链接。
|
||||
|
||||
请参考 [MkDocs 文档](https://www.mkdocs.org/user-guide/writing-your-docs/) 来了解如何组织与构建你的文档结构。
|
||||
|
||||
@@ -75,7 +74,7 @@ that runs in CI, which you are welcome to adapt.
|
||||
|
||||
### 构建文档
|
||||
|
||||
在这个阶段,你可以使用 `appium-docs` CLI 工具。 运行这个工具时不传任何参数,可以看到完整的帮助信息,以及所有可用的子命令与参数。 下面是几个常见用法示例:
|
||||
在这个阶段,你可以使用 `appium-docs` CLI 工具。运行这个工具时不传任何参数,可以看到完整的帮助信息,以及所有可用的子命令与参数。下面是几个常见用法示例:
|
||||
|
||||
```bash
|
||||
# 生成参考文档并将 mkdocs 站点构建到 site 目录
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: 构建 Doctor Checks
|
||||
---
|
||||
|
||||
Appium Doctor 的目标,是帮助用户完成驱动或插件的前置条件配置。 有时这些前置条件可能相当复杂,需要一定的技术知识。 Doctor checks是由扩展作者编写的普通 Node.js 类实例,它可以自动完成诊断并尝试修复发现的问题。 为了提供更好的使用体验,这些检查项有时也会是交互式的。
|
||||
Appium Doctor 的目标,是帮助用户完成驱动或插件的前置条件配置。有时这些前置条件可能相当复杂,需要一定的技术知识。 Doctor checks是由扩展作者编写的普通 Node.js 类实例,它可以自动完成诊断并尝试修复发现的问题。为了提供更好的使用体验,这些检查项有时也会是交互式的。
|
||||
|
||||
本教程适用于希望帮助用户处理复杂配置或设置步骤的插件或驱动作者。
|
||||
|
||||
@@ -10,14 +10,13 @@ Appium Doctor 的目标,是帮助用户完成驱动或插件的前置条件配
|
||||
|
||||
### 类型要求
|
||||
|
||||
术语 `Doctor Check` 的字面含义,是指一个实现了 [IDoctorCheck 接口](https://github.com/appium/appium/blob/master/packages/types/lib/doctor.ts) 的 JavaScript 类实例。
|
||||
这个接口定义了以下方法和属性:
|
||||
术语 `Doctor Check` 的字面含义,是指一个实现了 [IDoctorCheck 接口](https://github.com/appium/appium/blob/master/packages/types/lib/doctor.ts) 的 JavaScript 类实例。这个接口定义了以下方法和属性:
|
||||
|
||||
- `diagnose(): Promise<DoctorCheckResult>`:包含诊断某个问题的代码
|
||||
- `fix(): Promise<string|null>`:如果 `hasAutofix()` 返回 true,则修复实际问题;否则返回一段手动修复的说明。 如果此方法抛出名为 `FixSkippedError` 的异常,并且 `hasAutofix()` 返回 true,那么该调用结果将被忽略。
|
||||
- `fix(): Promise<string|null>`:如果 `hasAutofix()` 返回 true,则修复实际问题;否则返回一段手动修复的说明。如果此方法抛出名为 `FixSkippedError` 的异常,并且 `hasAutofix()` 返回 true,那么该调用结果将被忽略。
|
||||
- `hasAutofix(): boolean`:表示调用 `fix()` 是否能解决发现的问题
|
||||
- `isOptional(): boolean`:表示发现的问题是否可以被忽略且不是阻塞性问题
|
||||
- `log: AppiumLogger`:可用于日志输出。 这个属性可以由实例自行赋值,也可以由 Appium 服务在未赋值时自动提供。
|
||||
- `log: AppiumLogger`:可用于日志输出。这个属性可以由实例自行赋值,也可以由 Appium 服务在未赋值时自动提供。
|
||||
|
||||
`diagnose()` 方法返回的 `DoctorCheckResult` 对象必须包含以下属性:
|
||||
|
||||
@@ -27,7 +26,7 @@ Appium Doctor 的目标,是帮助用户完成驱动或插件的前置条件配
|
||||
|
||||
### 清单要求
|
||||
|
||||
一个扩展可以向 Appium 导出多个 Doctor checks。 为了让这些检查项在对应扩展安装后能够被服务端 CLI 正确识别,它们需要在package .json 清单文件中列在 `appium.doctor.checks` 部分,格式类似下面这样:
|
||||
一个扩展可以向 Appium 导出多个 Doctor checks。为了让这些检查项在对应扩展安装后能够被服务端 CLI 正确识别,它们需要在package .json 清单文件中列在 `appium.doctor.checks` 部分,格式类似下面这样:
|
||||
|
||||
```json
|
||||
// ...
|
||||
|
||||
@@ -1,39 +1,62 @@
|
||||
---
|
||||
title: 开发驱动
|
||||
title: Building Drivers
|
||||
---
|
||||
|
||||
Appium 希望让任何人都能在 Appium 生态系统中开发自己的自动化驱动。本指南将介绍其中涉及的工作,以及如何使用 Appium 提供的工具完成各种驱动开发任务。阅读本指南的前提是你:(1)能熟练使用 Appium,(2)是一名合格的 Node.js 开发者,(3)已经阅读并理解了[驱动介绍](../intro/drivers.md)。
|
||||
Appium wants to make it easy for anyone to develop their own automation drivers as part of the
|
||||
Appium ecosystem. This guide will explain what's involved and how you can accomplish various driver
|
||||
development tasks using the tools Appium provides. This guide assumes you (1) are a competent user of
|
||||
Appium, (2) are a competent Node.js developer, and (3) that you have read and understood the
|
||||
[Driver Intro](../intro/drivers.md).
|
||||
|
||||
如果你符合这些描述,太好了!本指南将带你入门。
|
||||
If that describes you, great! This guide will get you started.
|
||||
|
||||
## 创建驱动之前
|
||||
## Before you create your driver
|
||||
|
||||
在动手实现你的驱动之前,先把几件事理清楚很重要。例如,你需要知道你的驱动要做什么。它为哪个平台提供 WebDriver 自动化能力。
|
||||
Before you get to work implementing your driver, it's important to have a few things sorted out.
|
||||
For example, you need to know what your driver will do. Which platform is it trying to expose
|
||||
WebDriver automation for?
|
||||
|
||||
Appium 并不会凭空赋予你自动化任何平台的能力。它所做的只是提供一套便捷的工具,帮你实现 WebDriver 协议。所以,如果你想为一个新的应用平台创建驱动,你需要先知道如何_不借助Appium_在该平台上自动化应用。
|
||||
Appium doesn't magically give you the power to automate any platform. All it does is give you a set
|
||||
of convenient tools for implementing the WebDriver Protocol. So if you want to create, for example,
|
||||
a driver for a new app platform, you'll need to know how to automate apps on that platform _without Appium_.
|
||||
|
||||
这通常意味着你必须非常熟悉某个平台的应用开发,而且往往要依赖该平台厂商提供的工具或 SDK。
|
||||
This usually means that you need to be very familiar with app development for a given platform. And
|
||||
it usually means that you will rely on tools or SDKs provided by the platform vendor.
|
||||
|
||||
如果你无法回答这个问题——**"我该如何在这个平台上启动应用、远程触发应用行为并读取应用状态?"——那么你还不太适合开始编写 Appium 驱动**。请先做好调研,确认确实_有_可行的路径再继续。一旦路径清晰,把它编码实现并做成一个 Appium 驱动就简单多了!
|
||||
Basically, if you can't answer the question **"how would I launch, remotely trigger behaviours, and
|
||||
read state from an app on this platform?" then you're not quite ready to write an Appium driver**.
|
||||
Make sure you do the research to feel comfortable that there _is_ a path forward. Once there is,
|
||||
coding it up and making it available as an Appium driver should be the easy part!
|
||||
|
||||
## 可供参考的其他驱动
|
||||
## Other drivers to reference
|
||||
|
||||
构建 Appium 驱动最棒的一点是:已经有许多开源的 Appium 驱动可供参考。其中有一个fake-driver](https://github.com/appium/appium/tree/master/packages/fake-driver) 示例驱动,它几乎不
|
||||
做任何实际事情,只用来演示本指南中提到的若干要点。
|
||||
One of the greatest things about building an Appium driver is that there are already a number of
|
||||
open source Appium drivers which you can look at for reference. There is
|
||||
a [fake-driver](https://github.com/appium/appium/tree/master/packages/fake-driver) sample driver which
|
||||
does basically nothing other than showcase some of the things described in this guide.
|
||||
|
||||
当然,Appium 的所有官方驱动都是开源的,可以在项目的 GitHub 组织的仓库中找到。所以如果你正在思考"驱动是怎么实现 X 的?",去读这些驱动的源码吧!如果你在开发中遇到卡壳的地方,也尽管向 Appium 开发者们提问,我们总是乐于提供帮助,确保你的驱动开发体验顺畅!
|
||||
And of course, all of Appium's official drivers are open source and available in repositories at
|
||||
the project's GitHub organization. So if you ever find yourself asking, "how does a driver do X?",
|
||||
read the code for these drivers! Also don't be afraid to ask questions of the Appium developers if
|
||||
you get stuck; we're always happy to help make sure the driver development experience is a good
|
||||
one!
|
||||
|
||||
## Appium 驱动的基本要求
|
||||
## Basic requirements for Appium drivers
|
||||
|
||||
如果你想让某个东西成为一个合法的 Appium 驱动,以下是它_必须_做到(或满足)的事情。
|
||||
These are the things your driver _must_ do (or be), if you want it to be a valid Appium driver.
|
||||
|
||||
### 带 Appium 扩展元数据的 Node.js 包
|
||||
### Node.js package with Appium extension metadata
|
||||
|
||||
所有 Appium 驱动本质上都是 Node.js 包,因此必须有一个合法的 `package.json`。你的驱动并不_局限_于用 Node.js 编写,但它必须提供一个用 Node.js 编写的适配器,以便 Appium 能够加载它。
|
||||
All Appium drivers are fundamentally Node.js packages, and therefore must have a valid
|
||||
`package.json`. Your driver is not _limited_ to Node.js, but it must provide an adapter written in Node.js so it can be loaded by Appium.
|
||||
|
||||
你的 `package.json` 必须将 `appium` 声明为 `peerDependency`。对依赖版本的要求应尽量宽松(除非你明确知道你的驱动只能与某些特定版本的 Appium 配合工作)。以 Appium 2 为例,写成`^2.0.0` 即可,表示你的驱动兼容所有 2.x 版本的 Appium。
|
||||
Your `package.json` must include `appium` as a `peerDependency`. The requirements for the
|
||||
dependency versions should be as loose as possible (unless you happen to know your driver will only
|
||||
work with certain versions of Appium). For Appium 2, for example, this would look something like
|
||||
`^2.0.0`, declaring that your driver works with any version of Appium that starts with 2.x.
|
||||
|
||||
你的 `package.json` 必须包含一个 `appium` 字段,如下所示(我们称之为"Appium 扩展元数据"):
|
||||
Your `package.json` must contain an `appium` field, like this (we call this the 'Appium extension
|
||||
metadata'):
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -50,16 +73,26 @@ Appium 并不会凭空赋予你自动化任何平台的能力。它所做的只
|
||||
}
|
||||
```
|
||||
|
||||
必需的子字段如下:
|
||||
The required subfields are:
|
||||
|
||||
- `driverName`:你的驱动的简短名称。
|
||||
- `automationName`:用户在 `appium:automationName` 能力中填写的字符串,用于让 Appium 使用_你的_驱动。
|
||||
- `platformNames`:一个数组,包含你的驱动认为合法的一个或多个平台名称。当用户发起会话并传入 `platformName` 能力时,该值必须在此列表中,你的驱动才会处理该会话。这些名称通常应包含你的驱动所面向的操作系统——例如,面向 iOS 的驱动应包含 `iOS`,而面向 Windows 上 Chrome 浏览器的驱动应包含 `Windows`。
|
||||
- `mainClass`:从 `main` 字段具名导出(CommonJS 风格)的类。它必须是继承自 Appium 的 `BaseDriver` 的类(见下文)。
|
||||
- `driverName`: this should be a short name for your driver.
|
||||
- `automationName`: this should be the string users will use for their `appium:automationName`
|
||||
capability to tell Appium to use _your_ driver.
|
||||
- `platformNames`: this is an array of one or more platform names considered valid for your driver.
|
||||
When a user sends in the `platformName` capability to start a session, it must be included in
|
||||
this list for your driver to handle the session. These names should generally include the
|
||||
operating systems your driver is targeting - for example, a driver targeting iOS would include
|
||||
`iOS`, while a driver targeting the Chrome browser on Windows would include `Windows`.
|
||||
- `mainClass`: this is a named export (in CommonJS style) from your `main` field. It must be a
|
||||
class which extends Appium's `BaseDriver` (see below).
|
||||
|
||||
### 继承 Appium 的 `BaseDriver` 类
|
||||
### Extend Appium's `BaseDriver` class
|
||||
|
||||
归根结底,你的驱动之所以好写,是因为实现 WebDriver 协议以及处理某些通用逻辑的繁重工作已经由 Appium 代劳了。这一切都封装在一个 Appium 导出的类中,名为 `BaseDriver`。它从 `appium/driver` 导出,你可以用下面任一方式导入它,并创建继承它的_你自己的_类:
|
||||
Ultimately, your driver is much easier to write because most of the hard work of implementing the
|
||||
WebDriver protocol and handling certain common logic is taken care of already by Appium. This is
|
||||
all encoded up as a class which Appium exports for you to use, called `BaseDriver`. It is exported
|
||||
from `appium/driver`, so you can use one of these styles to import it and create your _own_ class
|
||||
that extends it:
|
||||
|
||||
```js
|
||||
import {BaseDriver} from 'appium/driver';
|
||||
@@ -69,25 +102,32 @@ export class MyDriver extends BaseDriver {
|
||||
}
|
||||
```
|
||||
|
||||
### 让你的驱动可用
|
||||
### Make your driver available
|
||||
|
||||
基本就是这样!一个导出驱动类的 Node.js 包,再加上正确的 Appium 扩展元数据,你就拥有了一个Appium 驱动!虽然它还什么都不_做_,但你已经可以在 Appium 中加载它、用它启动和停止会话了……
|
||||
That's basically it! With a Node.js package exporting a driver class and with correct Appium
|
||||
extension metadata, you've got yourself an Appium driver! Now it doesn't _do_ anything, but you can
|
||||
load it up in Appium, start and stop sessions with it, etc...
|
||||
|
||||
要让其他用户能用你的驱动,你可以通过 NPM 发布它。发布之后,用户就可以通过 Appium CLI 安装它:
|
||||
To make it available to users, you could publish it via NPM. When you do so, your driver will be
|
||||
installable via the Appium CLI:
|
||||
|
||||
```
|
||||
appium driver install --source=npm <driver-package-on-npm>
|
||||
```
|
||||
|
||||
当然,最好先测试你的驱动。观察它在 Appium 中如何工作,一种方式是以本地方式安装它:
|
||||
It's a good idea to test your driver first, of course. One way to see how it works within Appium is
|
||||
to install it locally first:
|
||||
|
||||
```
|
||||
appium driver install --source=local /path/to/your/driver
|
||||
```
|
||||
|
||||
### 驱动的开发流程
|
||||
### Developing your driver
|
||||
|
||||
如何开发你的驱动完全由你决定。不过,如何能在 Appium 中直接运行驱动,免去反复发布和安装呢?最直接的做法是把最新版本的 Appium 作为 `devDependency`,同时把你的驱动也作为依赖引入,例如:
|
||||
How you develop your driver is up to you. It is convenient, however, to run it from within Appium
|
||||
without having to do lots of publishing and installing. The most straightforward way to do this is
|
||||
to include the most recent version of Appium as a `devDependency`, and then also your own driver,
|
||||
like this:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -100,27 +140,37 @@ appium driver install --source=local /path/to/your/driver
|
||||
}
|
||||
```
|
||||
|
||||
这样,你就可以在本地运行 Appium(`npm exec appium` 或 `npx appium`),并且由于你的驱动与它并列列为依赖,它会被自动"安装"并可用。你可以按这种方式设计你的 e2e 测试;如果用 Node.js 编写测试,你还可以直接导入 Appium 的启动服务方法,在 Node 中启停 Appium 服务器。 (TODO:待相关实现就绪后,在此引用某个开源驱动的实现。)
|
||||
Now, you can run Appium locally (`npm exec appium` or `npx appium`), and because your driver is
|
||||
listed as a dependency alongside it, it will be automatically "installed" and available. You can
|
||||
design your e2e tests this way, or if you're writing them in Node.js, you can simply import
|
||||
Appium's start server methods to handle starting and stopping the Appium server in Node. (TODO:
|
||||
reference an implementation of this in one of the open source drivers when ready).
|
||||
|
||||
在 Appium 服务器上安装并进行本地开发的另一种方式是直接把驱动以本地源安装:
|
||||
Another way to do local development with an existing Appium server install is to simply install
|
||||
your driver locally:
|
||||
|
||||
```
|
||||
appium driver install --source=local /path/to/your/driver/dev/dir
|
||||
```
|
||||
|
||||
### 开发过程中刷新驱动
|
||||
### Refreshing your driver during development
|
||||
|
||||
Appium 服务器启动时会将你的驱动加载进内存。驱动代码的修改要到下一次 Appium 服务器启动时才会生效。启动一个新会话并不会以让驱动代码重新加载。
|
||||
When the Appium server starts, it loads your driver into memory. Changes to your driver code will
|
||||
not take effect until the next time the Appium server starts. Simply starting a new session is not
|
||||
sufficient to cause your driver's code to be reloaded.
|
||||
|
||||
不过,你可以把环境变量 `APPIUM_RELOAD_EXTENSIONS` 设为 `1`,要求 Appium 在每次收到新会话请求时清除模块缓存并重新加载扩展。这样在修改驱动代码后,也许就不必重启服务器了。
|
||||
However, you can set the `APPIUM_RELOAD_EXTENSIONS` environment variable to `1` to request that
|
||||
Appium clear its module cache and reload extensions whenever a new session is requested. This may
|
||||
obviate the need to restart the server when you make code changes to your driver.
|
||||
|
||||
## 驱动实现的标准思路
|
||||
## Standard driver implementation ideas
|
||||
|
||||
以下是创建驱动时你多半会想做的事情。
|
||||
These are things you will probably find yourself wanting to do when creating a driver.
|
||||
|
||||
### 在构造函数中初始化状态
|
||||
### Set up state in a constructor
|
||||
|
||||
如果你定义了自己的构造函数,需要调用 `super`,确保所有标准状态被正确初始化:
|
||||
If you define your own constructor, you'll need to call `super` to make sure all the standard state
|
||||
is set up correctly:
|
||||
|
||||
```js
|
||||
constructor(...args) {
|
||||
@@ -129,15 +179,22 @@ constructor(...args) {
|
||||
}
|
||||
```
|
||||
|
||||
这里的 `args` 参数是包含启动 Appium 服务器所用的全部 CLI 参数的对象。
|
||||
The `args` parameter here is the object containing all the CLI args used to start the Appium
|
||||
server.
|
||||
|
||||
### 定义并校验支持的能力
|
||||
### Define and validate accepted capabilities
|
||||
|
||||
你可以定义自己的能力并为它们配置基本校验。用户可能调用你未定义的能力;但对于你已明确定义的能力,Appium 会校验其类型是否正确(并检查必填能力是否存在)。
|
||||
You can define your own capabilities and basic validation for them. Users will always be able to
|
||||
send in capabilities that you don't define, but if they send in capabilities you have explicitly
|
||||
defined, then Appium will validate that they are of the correct type (and will check for the
|
||||
presence of required capabilities).
|
||||
|
||||
如果你想关闭校验,只需在构造函数中把 `this.shouldValidateCaps` 设为 `false`。
|
||||
If you want to turn capability validation off entirely, set `this.shouldValidateCaps` to `false` in
|
||||
your constructor.
|
||||
|
||||
要把校验约束提供给 Appium,需要在构造函数中把 `this.desiredCapConstraints` 设为一个校验对象。校验对象可以写得很复杂。下面是 UiAutomator2 驱动的一个例子:
|
||||
To give Appium your validation constraints, set `this.desiredCapConstraints` to a validation object
|
||||
in your constructor. Validation objects can be somewhat complex. Here's an example from the
|
||||
UiAutomator2 driver:
|
||||
|
||||
```js
|
||||
{
|
||||
@@ -157,9 +214,13 @@ constructor(...args) {
|
||||
}
|
||||
```
|
||||
|
||||
### 启动会话并读取能力
|
||||
### Start a session and read capabilities
|
||||
|
||||
Appium 的 `BaseDriver` 已经实现了 `createSession` 命令,所以你不实现它也可以。但驱动通常需要执行自己的启动动作(启动应用、运行某些平台代码、或根据你为驱动定义的能力做不同的事情)。因此你很可能会去重写 `createSession`。你可以在驱动中定义该方法来实现:
|
||||
Appium's `BaseDriver` already implements the `createSession` command, so you don't have to. However
|
||||
it's very common to need to perform your own startup actions (launching an app, running some
|
||||
platform code, or doing different things based on capabilities you have defined for your driver).
|
||||
So you'll probably end up overriding `createSession`. You can do so by defining the method in your
|
||||
driver:
|
||||
|
||||
```js
|
||||
async createSession(w3cCaps) {
|
||||
@@ -169,19 +230,29 @@ async createSession(w3cCaps) {
|
||||
}
|
||||
```
|
||||
|
||||
!!! 警告 “已废弃”
|
||||
!!! warning "Deprecated"
|
||||
|
||||
```
|
||||
较老的驱动可能仍以最多四个参数定义 createSession,例如createSession(jwpCaps, reqCaps, w3cCaps, otherDriverData)。这种形式是已退役的 JSON Wire Protocol 的遗留产物——它要求前两个参数是期望能力和必须能力,而实际上只有第一个W3C 形式的参数被使用过。otherDriverData 参数同样已被废弃,与其他并行运行会话的协调请改用IPC(见下文"向同一会话中的插件发送消息")。新驱动应使用上面所示的单参数形式。
|
||||
Older drivers may still define `createSession` with up to four parameters, e.g.
|
||||
`createSession(jwpCaps, reqCaps, w3cCaps, otherDriverData)`. This shape is a holdover from the
|
||||
retired JSON Wire Protocol, which required desired and required caps as the first two
|
||||
arguments; only the first W3C-shaped argument was ever used. The `otherDriverData` parameter is
|
||||
likewise deprecated in favor of [IPC](#send-messages-to-plugins-running-on-the-same-session) for
|
||||
coordinating with other concurrently-running sessions. New drivers should use the single-argument
|
||||
form shown above.
|
||||
```
|
||||
|
||||
你要确保调用 `super.createSession`,以拿到会话 ID 以及处理过的能力(注意:能力同时也被设置在`this.caps` 上;此处仅修改局部变量 `caps`,这只改变用户在创建会话响应中看到的内容,没有其他效果)。
|
||||
You'll want to make sure to call `super.createSession` in order to get the session ID as well as
|
||||
the processed capabilities (note that capabilities are also set on `this.caps`; modifying `caps`
|
||||
locally here would have no effect other than changing what the user sees in the create session
|
||||
response).
|
||||
|
||||
就是这样!中间的空白部分由你的驱动所需的启动逻辑来填充。
|
||||
So that's it! You can fill out the middle section with whatever startup logic your driver requires.
|
||||
|
||||
### 结束会话
|
||||
### End a session
|
||||
|
||||
如果你的驱动需要清理或关闭逻辑,最好的方式是重写 `deleteSession` 实现:
|
||||
If your driver requires any cleanup or shutdown logic, it's best to do it as part of overriding the
|
||||
implementation of `deleteSession`:
|
||||
|
||||
```js
|
||||
async deleteSession() {
|
||||
@@ -191,21 +262,33 @@ async deleteSession() {
|
||||
}
|
||||
```
|
||||
|
||||
非常重要的一点是:尽可能不要在这里抛出错误,这样才能让会话清理的每个环节都成功执行!
|
||||
It's very important not to throw any errors here if possible so that all parts of session cleanup
|
||||
can succeed!
|
||||
|
||||
### 访问能力与 CLI 参数
|
||||
### Access capabilities and CLI args
|
||||
|
||||
你可能需要读取用户为会话设置的参数,无论它们是 CLI 参数还是能力。最简单的方式是访问 `this.opts`,它合并了来自 CLI 和能力的全部选项。例如要访问 `appium:app` 能力,直接读取 `this.opts.app` 即可。
|
||||
You'll often want to read parameters the user has set for the session, whether as CLI args or as
|
||||
capabilities. The easiest way to do this is to access `this.opts`, which is a merge of all options,
|
||||
from the CLI or from capabilities. So for example to access the `appium:app` capability, you could
|
||||
simply get the value of `this.opts.app`.
|
||||
|
||||
如果你想知道某个值究竟是以 CLI 参数_还是_能力传入的,可以显式访问 `this.cliArgs` 和 `this.caps` 对象。
|
||||
If you care about knowing whether something was sent in as a CLI arg _or_ a capability, you can
|
||||
access the `this.cliArgs` and `this.caps` objects explicitly.
|
||||
|
||||
在所有情况下,为方便起见,当你读取这些值时,`appium:` 能力前缀都已经被剥离掉了。
|
||||
In all cases, the `appium:` capability prefix will have been stripped away by the time you are
|
||||
accessing values here, for convenience.
|
||||
|
||||
### 实现 WebDriver classic 命令
|
||||
### Implement WebDriver classic commands
|
||||
|
||||
你通过在驱动类中实现函数来处理 WebDriver 命令。 WebDriver 协议的每一个成员,以及 Appium 的各种扩展,都对应一个函数——如果你想支持该命令,就实现它。要了解 Appium 支持哪些命令、每个命令需要实现哪个方法,最好的办法是查看 Appium 的 [routes/](https://github.com/appium/appium/blob/master/packages/base-driver/lib/protocol/routes.js)。该文件中的每个路由对象都会告诉你命令名称以及该命令预期接收的参数。
|
||||
You handle WebDriver commands by implementing functions in your driver class. Each member of the
|
||||
WebDriver Protocol, plus the various Appium extensions, has a corresponding function that you
|
||||
implement if you want to support that command in your driver. The best way to see which commands
|
||||
Appium supports and which method you need to implement for each command is to look at Appium's
|
||||
[routes/](https://github.com/appium/appium/tree/master/packages/base-driver/lib/protocol/routes).
|
||||
Each route object in this directory's files tells you the command name as well as the parameters you'd expect to
|
||||
receive for that command.
|
||||
|
||||
比如下面这段:
|
||||
Let's take this block for example:
|
||||
|
||||
```js
|
||||
'/session/:sessionId/url': {
|
||||
@@ -214,7 +297,10 @@ async deleteSession() {
|
||||
}
|
||||
```
|
||||
|
||||
可以看到路由 `/session/:sessionId/url` 映射到两个命令,一个对应 `GET` 请求,一个对应 `POST` 请求。如果我们想让驱动能够改变 "url",就可以实现 `setUrl` 命令,并知道它会接收 `url` 参数:
|
||||
Here we see that the route `/session/:sessionId/url` is mapped to two commands, one for a `GET`
|
||||
request and one for a `POST` request. If we want to allow our driver to change the "url" (or
|
||||
whatever that might mean for our driver), we can therefore implement the `setUrl` command, knowing
|
||||
it will take the `url` parameter:
|
||||
|
||||
```js
|
||||
async setUrl(url) {
|
||||
@@ -222,23 +308,37 @@ async setUrl(url) {
|
||||
}
|
||||
```
|
||||
|
||||
几点说明:
|
||||
A few notes:
|
||||
|
||||
- 所有命令方法都应当是 `async` 函数,或者以其他方式返回 `Promise`
|
||||
- 你不必关心协议的编解码。参数会以 JS 对象形式传入,你只需返回可 JSON 序列化的对象即可。 Appium 会自动把它们包装成 WebDriver 协议响应格式、转成 JSON 等等……
|
||||
- 所有基于会话的命令都会把 `sessionId` 参数作为最后一个参数传入
|
||||
- 所有基于元素的命令都会把 `elementId` 参数作为倒数第二个参数传入
|
||||
- 如果你的驱动没有实现某个命令,用户仍然可以尝试调用,但会收到 `501 Not Yet Implemented` 错误响应。
|
||||
- all command methods should be `async` functions or otherwise return a `Promise`
|
||||
- you don't need to worry about protocol encoding/decoding. You will get JS objects as params, and
|
||||
can return JSON-serializable objects in response. Appium will take care of wrapping it up in the
|
||||
WebDriver protocol response format, turning it into JSON, etc...
|
||||
- all session-based commands receive the `sessionId` parameter as the last parameter
|
||||
- all element-based commands receive the `elementId` parameter as the second-to-last parameter
|
||||
- if your driver doesn't implement a command, users can still try to access the command, and will
|
||||
get a `501 Not Yet Implemented` response error.
|
||||
|
||||
### 实现 WebDriver BiDi 命令
|
||||
### Implement WebDriver BiDi commands
|
||||
|
||||
[WebDriver BiDi](https://w3c.github.io/webdriver-bidi) 是 WebDriver 规范的新版本,基于 Websocket 而非 HTTP 实现。作为 Appium 驱动作者,你可以直接利用 Appium 的 BiDi 支持,而无需了解 BiDi 协议或 Websocket 的任何细节。实现 BiDi 命令的处理方法与实现 WebDriver 经典命令的处理方法完全一样(见上一节)。你只需在驱动上定义名称对应的方法,当客户端请求该 BiDi 命令时它就会被调用。要查看 BiDi 命令应使用的具体名称,请参考 [bidi-commands.ts](https://github.com/appium/appium/blob/master/packages/base-driver/lib/protocol/bidi-commands.ts)。
|
||||
[WebDriver BiDi](https://w3c.github.io/webdriver-bidi) is a newer version of the WebDriver spec
|
||||
which is implemented over Websockets instead of HTTP. As an Appium driver author you can take
|
||||
advantage of Appium's BiDi support without having to know anything about the BiDi protocol or
|
||||
Websockets. Implementing handlers for BiDi commands works just the same as implementing handlers
|
||||
for WebDriver classic commands (described in the previous section). You simply define a method on
|
||||
your driver of the appropriate name, and it will be called when the BiDi command is requested by
|
||||
the client. To see which specific names you should use for BiDi commands, have a look at
|
||||
[bidi-commands.ts](https://github.com/appium/appium/blob/master/packages/base-driver/lib/protocol/bidi-commands.ts)
|
||||
|
||||
你不必局限于官方 BiDi 规范中已定义的命令。如果你想定义新命令,也完全可以——只需要把这些新命令告知 Appium!详情请见下文 [用新的命令扩展现有协议](#用新的命令扩展现有协议)。
|
||||
You are not limited to BiDi commands that are defined in the official BiDi specification. If you
|
||||
wish to define new commands, you may do so; you just need to tell Appium about them! See
|
||||
[below](#extend-the-existing-protocol-with-new-commands) for more information.
|
||||
|
||||
### 实现元素查找
|
||||
### Implement element finding
|
||||
|
||||
元素查找是一种特殊的命令实现情形。尽管 `routes.js` 中列出的命令是 `findElement` 和 `findElements`,但实际上你不应该重写它们。如果你改为实现下面这个函数,Appium 会替你完成大量工作:
|
||||
Element finding is a special command implementation case. You don't actually want to override
|
||||
`findElement` or `findElements`, even though those are what are listed in `routes.js`. Appium does
|
||||
a lot of work for you if instead you implement this function:
|
||||
|
||||
```js
|
||||
async findElOrEls(strategy, selector, mult, context) {
|
||||
@@ -246,43 +346,55 @@ async findElOrEls(strategy, selector, mult, context) {
|
||||
}
|
||||
```
|
||||
|
||||
传入的参数含义如下:
|
||||
Here's what gets passed in:
|
||||
|
||||
- `strategy`——字符串,正在使用的定位策略
|
||||
- `selector`——字符串,选择器
|
||||
- `mult`——布尔值,表示用户是要查找单个元素还是匹配该选择器的所有元素
|
||||
- `context`——(可选)若有值,则是一个 W3C Element(即以 W3C 元素标识符为键、元素 ID 为值的 JS 对象)
|
||||
- `strategy` - a string, the locator strategy being used
|
||||
- `selector` - a string, the selector
|
||||
- `mult` - boolean, whether the user has requested one element or all elements matching the
|
||||
selector
|
||||
- `context` - (optional) if defined, will be a W3C Element (i.e., a JS object with the W3C element
|
||||
identifier as the key and the element ID as the value)
|
||||
|
||||
你需要返回以下二者之一:
|
||||
And you need to return one of the following:
|
||||
|
||||
- 单个 W3C 元素(即上面描述的对象)
|
||||
- W3C 元素数组
|
||||
- a single W3C element (an object as described above)
|
||||
- an array of W3C elements
|
||||
|
||||
注意,你可以从 `appium/support` 导入 W3C web 元素标识符:
|
||||
Note that you can import that W3C web element identifier from `appium/support`:
|
||||
|
||||
```js
|
||||
import {util} from 'appium/support';
|
||||
const { W3C_WEB_ELEMENT_IDENTIFIER } = util;
|
||||
```
|
||||
|
||||
拿到元素之后怎么用完全由你决定!通常你会维护一个从 ID 到真实元素"对象"(或你平台上等价事物)的映射。
|
||||
What you do with elements is up to you! Usually you end up keeping a cache map of IDs to actual
|
||||
element "objects" or whatever the equivalent is for your platform.
|
||||
|
||||
### 定义合法的定位策略
|
||||
### Define valid locator strategies
|
||||
|
||||
你的驱动可能只支持标准 WebDriver 定位策略的一个子集,也可能添加自己的自定义定位策略。如何告诉 Appium 你的驱动支持哪些策略呢?你需要创建一个策略数组并赋给 `this.locatorStrategies`:
|
||||
Your driver might only support a subset of the standard WebDriver locator strategies, or it might
|
||||
add its own custom locator strategies. To tell Appium which strategies are considered valid for
|
||||
your driver, create an array of strategies and assign it to `this.locatorStrategies`:
|
||||
|
||||
```js
|
||||
this.locatorStrategies = ['xpath', 'custom-strategy'];
|
||||
```
|
||||
|
||||
如果用户尝试使用允许范围之外的策略,Appium 会抛出错误,这能让你把元素查找代码保持干净,只处理你支持的策略。
|
||||
Appium will throw an error if the user attempts to use any strategies other than the allowed ones,
|
||||
which enables you to keep your element finding code clean and deal with only the strategies you
|
||||
know about.
|
||||
|
||||
默认情况下,合法策略列表为空。所以如果你的驱动不是简单地代理到另一个 WebDriver 端点,你就需要
|
||||
定义一些策略。协议标准的定位策略定义在[这里](https://www.w3.org/TR/webdriver/#locator-strategies)。
|
||||
By default, the list of valid strategies is empty, so if your driver isn't simply proxying to
|
||||
another WebDriver endpoint, you'll need to define some. The protocol-standard locator strategies
|
||||
are defined [here](https://www.w3.org/TR/webdriver/#locator-strategies).
|
||||
|
||||
### 抛出 WebDriver 错误
|
||||
### Throw WebDriver-specific errors
|
||||
|
||||
WebDriver 规范定义了一组[错误码](https://github.com/jlipps/simple-wd-spec#error-codes),用于在命令发生错误时伴随响应返回。 Appium 为每个错误码都创建了对应的错误类,因此你可以在命令内部抛出相应的错误,Appium 会按照协议规范把它正确地响应给用户。要获得这些错误类,从 `appium/driver` 导入即可:
|
||||
The WebDriver spec defines a set of error
|
||||
codes to accompany command responses if an
|
||||
error occurred. Appium has created error classes for each of these codes, so you can throw the
|
||||
appropriate error from inside a command, and it will do the right thing in terms of the protocol
|
||||
response to the user. To get access to these error classes, import them from `appium/driver`:
|
||||
|
||||
```
|
||||
import {errors} from 'appium/driver';
|
||||
@@ -290,34 +402,42 @@ import {errors} from 'appium/driver';
|
||||
throw new errors.NoSuchElementError();
|
||||
```
|
||||
|
||||
### 向 Appium 日志写消息
|
||||
### Log messages to the Appium log
|
||||
|
||||
你当然可以随时用 `console.log`,但 Appium 为你提供了一个更贴心的日志器 `this.log`(它有 `.info`、`.debug`、`.log`、`.warn`、`.error` 等不同日志级别的方法)。如果你想在驱动上下文之外(比如脚本或辅助文件中)创建 Appium 日志器,也可以自行构造:
|
||||
You can always use `console.log`, of course, but Appium provides a nice logger for you as
|
||||
`this.log` (it has `.info`, `.debug`, `.log`, `.warn`, `.error` methods on it for differing log
|
||||
levels). If you want to create an Appium logger outside of a driver context (say in a script or
|
||||
helper file), you can always construct your own too:
|
||||
|
||||
```js
|
||||
import {logging} from 'appium/support';
|
||||
const log = logging.getLogger('MyDriver');
|
||||
```
|
||||
|
||||
## Appium 驱动的进阶能力
|
||||
## Further possibilities for Appium drivers
|
||||
|
||||
以下是你的驱动_可以_做的事情,以利用更多驱动特性或更便捷地完成工作。
|
||||
These are things your driver _can_ do to take advantage of extra driver features or do its job more
|
||||
conveniently.
|
||||
|
||||
### 为自定义命令行参数添加 schema
|
||||
### Add a schema for custom command line arguments
|
||||
|
||||
如果你希望驱动在 Appium 服务器启动时从命令行接收数据,就可以添加自定义 CLI 参数(例如由服务器管理员设定的端口,这类参数不适合通过能力传入)。
|
||||
You can add custom CLI args if you want your driver to receive data from the command line when the
|
||||
Appium server is started (for example, ports that a server administrator should set that should not
|
||||
be passed in as capabilities.
|
||||
|
||||
要为 Appium 服务器定义 CLI 参数(或配置属性),你的驱动必须提供一个 _schema_。在驱动 `package.json` 的 `appium` 属性下添加一个 `schema` 属性。它可以本身就是 schema,也可以指向 schema 文件的路径。
|
||||
To define CLI arguments (or configuration properties) for the Appium server, your extension must provide a _schema_. In
|
||||
the `appium` property of your extension's `package.json`, add a `schema` property. This will either
|
||||
a) be a schema itself, or b) be a path to a schema file.
|
||||
|
||||
schema 的规则如下:
|
||||
The rules for these schemas:
|
||||
|
||||
- Schema 必须符合 [JSON Schema Draft-07](https://ajv.js.org/json-schema.html#draft-07)。
|
||||
- 如果 `schema` 属性是 schema 文件的路径,该文件必须是 JSON 或 JS(CommonJS)格式。
|
||||
- 不支持自定义 `$id` 值。要使用 `$ref`,请提供相对于 schema 根的值,例如 `/properties/foo`。
|
||||
- `format` 关键字的已知取值一般是受支持的,但其他一些关键字可能不受支持。如果你需要用到的某个关键字不受支持,请[提出支持请求](https://github.com/appium/appium/issues/new)或提交 PR!
|
||||
- Schema 的类型必须是 `object`(`{"type": "object"}`),参数放在 `properties` 关键字中。不支持嵌套属性。
|
||||
- Schemas must conform to [JSON Schema Draft-07](https://ajv.js.org/json-schema.html#draft-07).
|
||||
- If the `schema` property is a path to a schema file, the file must be in JSON or JS (CommonJS) format.
|
||||
- Custom `$id` values are unsupported. To use `$ref`, provide a value relative to the schema root, e.g., `/properties/foo`.
|
||||
- Known values of the `format` keyword are likely supported, but various other keywords may be unsupported. If you find a keyword that is unsupported which you need to use, please [ask for support](https://github.com/appium/appium/issues/new) or send a PR!
|
||||
- The schema must be of type `object` (`{"type": "object"}`), containing the arguments in a `properties` keyword. Nested properties are unsupported.
|
||||
|
||||
示例:
|
||||
Example:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -338,8 +458,10 @@ schema 的规则如下:
|
||||
}
|
||||
```
|
||||
|
||||
上面的 schema 定义了两个可通过 CLI 参数或配置文件设置的属性。如果这个扩展是一个_驱动_且名字为 "horace",那么对应的 CLI 参数分别是 `--driver-horace-test-web-server-port` 和
|
||||
`--driver-horace-test-web-server-host`。用户也可以提供如下内容的配置文件:
|
||||
The above schema defines two properties which can be set via CLI argument or configuration file. If
|
||||
this extension is a _driver_ and its name is "horace", the CLI args would be
|
||||
`--driver-horace-test-web-server-port` and `--driver-horace-test-web-server-host`, respectively.
|
||||
Alternatively, a user could provide a configuration file containing:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -354,7 +476,7 @@ schema 的规则如下:
|
||||
}
|
||||
```
|
||||
|
||||
### 添加驱动脚本
|
||||
### Add driver scripts
|
||||
|
||||
Sometimes you might want users of your driver to be able to run scripts outside the context of
|
||||
a session (for example, to run a script that pre-builds aspects of your driver). To support this,
|
||||
|
||||
@@ -50,7 +50,7 @@ _基础_ schema 是由 `lib/schema/appium-config-schema.js` 导出的一个符
|
||||
```
|
||||
|
||||
This file is _not_ a JSON file, because a) JSON is painful to work with for humans, b) is
|
||||
especially reviled by @jlipps, and c) `ajv` accepts objects, not JSON files.。
|
||||
especially reviled by @jlipps, and c) `ajv` accepts objects, not JSON files.
|
||||
|
||||
解释配置文件的校验流程更直接一些,所以我们从那里开始。
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: 开发 Appium 扩展
|
||||
---
|
||||
|
||||
Appium 采用模块化结构,这意味着 Appium 扩展(驱动和插件)与主 Appium 模块是解耦的;你只需要安装自己想要使用的扩展即可。 这种模块化结构还使得开发全新的扩展变得成为可能。
|
||||
Appium 采用模块化结构,这意味着 Appium 扩展(驱动和插件)与主 Appium 模块是解耦的;你只需要安装自己想要使用的扩展即可。这种模块化结构还使得开发全新的扩展变得成为可能。
|
||||
|
||||
Appium 文档的这一部分,旨在帮助有志于开发者创建自己的 Appium 扩展:
|
||||
|
||||
|
||||
@@ -5,18 +5,16 @@ hide:
|
||||
title: 屏蔽敏感日志数据
|
||||
---
|
||||
|
||||
自 Appium server 2.18.0 版本起,已经具备了在日志中屏蔽敏感值的能力。 下面的教程将介绍如何在第三方扩展中使用这一功能。
|
||||
自 Appium server 2.18.0 版本起,已经具备了在日志中屏蔽敏感值的能力。下面的教程将介绍如何在第三方扩展中使用这一功能。
|
||||
|
||||
## 为什么这很有用
|
||||
|
||||
将密码、令牌等敏感信息从服务器日志中隐藏起来是合理且必要的,这样即使日志落入错误的人手中,也不会意外泄露敏感数据。
|
||||
Appium server 已经提供了一种通过 [过滤](../guides/log-filters.md) 来处理日志记录的方式,不过它本身存在一些限制。
|
||||
当前这种方法则更为先进,但需要驱动/插件侧进行一些细调。
|
||||
Appium server 已经提供了一种通过 [过滤](../guides/log-filters.md) 来处理日志记录的方式,不过它本身存在一些限制。当前这种方法则更为先进,但需要驱动/插件侧进行一些细调。
|
||||
|
||||
## 使用方法
|
||||
|
||||
假设你的扩展使用的是标准内置的 [@appium/logger](https://www.npmjs.com/package/@appium/logger)。
|
||||
要让日志中的某个值被替换成通用的掩码,需要执行以下步骤:
|
||||
假设你的扩展使用的是标准内置的 [@appium/logger](https://www.npmjs.com/package/@appium/logger)。要让日志中的某个值被替换成通用的掩码,需要执行以下步骤:
|
||||
|
||||
- 将日志表达式改为包裹敏感值并进行格式化,例如:
|
||||
|
||||
@@ -34,6 +32,4 @@ Appium server 已经提供了一种通过 [过滤](../guides/log-filters.md) 来
|
||||
|
||||
格式化过程会通过标准的 Node.js [util.format](https://nodejs.org/api/util.html#utilformatformat-args) API 完成。
|
||||
|
||||
- 在发送相应的服务器请求时,如果这个日志行被使用并且应该被掩码处理,请额外添加自定义请求头 `X-Appium-Is-Sensitive`,其值为 `1` 或 `true`(大小写不敏感)。
|
||||
如果没有这个请求头,上述日志值将不会被掩码处理。
|
||||
这样就可以根据扩展处理的具体请求来有条件地屏蔽日志记录;如果日志表达式位于公共部分,就可以在这里统一控制。
|
||||
- 在发送相应的服务器请求时,如果这个日志行被使用并且应该被掩码处理,请额外添加自定义请求头 `X-Appium-Is-Sensitive`,其值为 `1` 或 `true`(大小写不敏感)。如果没有这个请求头,上述日志值将不会被掩码处理。这样就可以根据扩展处理的具体请求来有条件地屏蔽日志记录;如果日志表达式位于公共部分,就可以在这里统一控制。
|
||||
|
||||
@@ -17,7 +17,7 @@ If you maintain an Appium driver that you would like to be listed here, feel fre
|
||||
|
||||
These drivers are currently maintained by the Appium team:
|
||||
|
||||
### [Chromium](https://appium.github.io/appium-chromium-driver)
|
||||
### [Chromium](https://appium.github.io/appium-chromium-driver/)
|
||||
|
||||
- Target: Desktop Chromium-based browsers (Chrome, Microsoft Edge, etc.)
|
||||
- Mode: Web
|
||||
@@ -26,7 +26,7 @@ These drivers are currently maintained by the Appium team:
|
||||
appium driver install chromium
|
||||
```
|
||||
|
||||
### [Espresso](https://appium.github.io/appium-espresso-driver)
|
||||
### [Espresso](https://appium.github.io/appium-espresso-driver/)
|
||||
|
||||
- Target: Android applications (mobile, TV, Wear, XR, Automotive)
|
||||
- Mode: Native, Hybrid, Web
|
||||
@@ -35,7 +35,7 @@ appium driver install chromium
|
||||
appium driver install espresso
|
||||
```
|
||||
|
||||
### [Gecko](https://appium.github.io/appium-geckodriver)
|
||||
### [Gecko](https://appium.github.io/appium-geckodriver/)
|
||||
|
||||
- Target: Desktop and mobile Gecko-based browsers (Firefox, etc.)
|
||||
- Mode: Web
|
||||
@@ -44,7 +44,7 @@ appium driver install espresso
|
||||
appium driver install gecko
|
||||
```
|
||||
|
||||
### [Mac2](https://appium.github.io/appium-mac2-driver)
|
||||
### [Mac2](https://appium.github.io/appium-mac2-driver/)
|
||||
|
||||
- Target: macOS applications
|
||||
- Mode: Native
|
||||
@@ -53,7 +53,7 @@ appium driver install gecko
|
||||
appium driver install mac2
|
||||
```
|
||||
|
||||
### [Safari](https://appium.github.io/appium-safari-driver)
|
||||
### [Safari](https://appium.github.io/appium-safari-driver/)
|
||||
|
||||
- Target: Desktop and mobile Safari browsers
|
||||
- Mode: Web
|
||||
@@ -62,7 +62,7 @@ appium driver install mac2
|
||||
appium driver install safari
|
||||
```
|
||||
|
||||
### [UiAutomator2](https://appium.github.io/appium-uiautomator2-driver)
|
||||
### [UiAutomator2](https://appium.github.io/appium-uiautomator2-driver/)
|
||||
|
||||
- Target: Android applications (mobile, TV, Wear, XR, Automotive)
|
||||
- Modes: Native, Hybrid, Web
|
||||
|
||||
@@ -140,17 +140,3 @@ Supported by: `@domovou69`
|
||||
```sh title="Install This Tool"
|
||||
npm install -g xpath-to-class-chain
|
||||
```
|
||||
|
||||
### [XPath to UiSelector](https://github.com/domovou69/xpath-to-uiselector)
|
||||
|
||||
XPath to UiSelector is a command-line tool for migrating Android XPath locators in test code to
|
||||
`-android uiautomator` selectors. It converts the XPaths that have an exact `UiSelector`
|
||||
equivalent, converts with a warning those that only have a close one (such as `//A//B`), and skips
|
||||
the rest with a reason. The strategy call is rewritten together with the string, for example
|
||||
`AppiumBy.xpath` becomes `AppiumBy.androidUIAutomator`.
|
||||
|
||||
Supported by: `@domovou69`
|
||||
|
||||
```sh title="Install This Tool"
|
||||
npm install -g xpath-to-uiselector
|
||||
```
|
||||
|
||||
@@ -15,7 +15,7 @@ bundle for each test.
|
||||
## What Is Cached
|
||||
|
||||
Caching could be applied to application bundles generated by
|
||||
[`configureApp`](https://github.com/appium/appium/blob/master/packages/base-driver/lib/basedriver/helpers.js#L99) helper call.
|
||||
[`configureApp`](https://github.com/appium/appium/blob/master/packages/base-driver/lib/basedriver/helpers.ts#L99) helper call.
|
||||
Inherited drivers can customize their caching logic by providing own `onPostProcess`
|
||||
(or both `inDownload` and `onPostProcess`) property definition, but the general
|
||||
rule of thumb is that we need to cache locally all application bundles need to be downloaded and/or extracted
|
||||
|
||||
@@ -6,14 +6,13 @@ title: Retrieving Event Timings
|
||||
---
|
||||
|
||||
Appium comes with the ability to retrieve timing information about startup
|
||||
information and command length. This is an advanced feature that is controlled
|
||||
by the use of the `appium:eventTimings` capability (set it to `true` to log event
|
||||
timings).
|
||||
information and command length. This is an advanced feature; the server records
|
||||
event timings for every session.
|
||||
|
||||
With this capability turned on, the `POST /session/:id/appium/events` response (i.e.,
|
||||
the response to `driver.logs.events` or similar, depending on client) will be
|
||||
decorated with an `events` property. This is the structure of that `events`
|
||||
property:
|
||||
The timings can be retrieved at any point during a session via the
|
||||
`POST /session/:id/appium/events` endpoint (i.e., the response to
|
||||
`driver.logs.events` or similar, depending on client). The response body is the
|
||||
event history object itself. This is its structure:
|
||||
|
||||
```
|
||||
{
|
||||
@@ -29,7 +28,7 @@ property:
|
||||
}
|
||||
```
|
||||
|
||||
In other words, the `events` property has 2 kinds of properties of its own:
|
||||
In other words, the event history object has 2 kinds of properties of its own:
|
||||
|
||||
- Properties which are the names of event types
|
||||
- The `commands` property
|
||||
@@ -64,7 +63,9 @@ generate various kinds of reports from event timings output:
|
||||
!!! note
|
||||
|
||||
```
|
||||
In the past, events were available as a part of `GET /session/:id` response
|
||||
In the past, when the `appium:eventTimings` capability was set to `true`, the event history
|
||||
was also returned as an `events` property of the (now deprecated) `GET /session/:id`
|
||||
response
|
||||
```
|
||||
|
||||
## Add a custom event
|
||||
|
||||
@@ -137,7 +137,7 @@ all parameters and descriptions see
|
||||
Once you start the Appium server it will register with the grid, and you will see your device on
|
||||
the grid console page:
|
||||
|
||||
`http://**\<grid-ip-adress\>**:**\<grid-port\>**/grid/console`
|
||||
`http://**\<grid-ip-address\>**:**\<grid-port\>**/grid/console`
|
||||
|
||||
### Example Grid Node Configuration JSON
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ title: 欢迎使用
|
||||
欢迎来到 Appium 文档! Appium是一个开源项目和相关软件生态系统,旨在促进多种应用平台的用户界面自动化,包括移动端(iOS、Android、Tizen)、浏览器端(Chrome、Firefox、Safari)、桌面端(macOS、Windows)、电视端(Roku、tvOS、Android TV、三星)等!
|
||||
|
||||
<div style="text-align: center; margin-top: 2rem; font-style: italic;">
|
||||
Appium 非常感谢主要合作伙伴的支持! (了解更多关于我们的赞助计划和贡献者补偿计划信息请<a
|
||||
Appium 非常感谢主要合作伙伴的支持!(了解更多关于我们的赞助计划和贡献者补偿计划信息请<a
|
||||
href="https://github.com/appium/appium/blob/master/GOVERNANCE.md#sponsorship">点击此处</a>)
|
||||
<div class="homepageSponsors">
|
||||
<div class="homepageSponsor">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Appium 如何工作?
|
||||
---
|
||||
|
||||
正如主页所述,Appium 是一个开源项目和相关软件生态系统,旨在促进多种应用平台的 UI 自动化。 随着 Appium 2 的发布,Appium 具有以下主要目标:[^1]
|
||||
正如主页所述,Appium 是一个开源项目和相关软件生态系统,旨在促进多种应用平台的 UI 自动化。随着 Appium 2 的发布,Appium 具有以下主要目标:[^1]
|
||||
|
||||
- 在跨平台标准 API 下提供特定于平台的自动化功能
|
||||
- 允许从任何编程语言轻松访问此 API
|
||||
@@ -15,7 +15,7 @@ title: Appium 如何工作?
|
||||
- 尽可能依赖不修改应用就能实现自动化(最好不要要求用户构建额外的 SDK 或软件,从而在测试版本和生产版本之间引入差异)的自动化工具
|
||||
- 尽可能依赖现有标准而不是创建新标准
|
||||
|
||||
所以,以您了解的任何应用平台为例,如 iOS 或 Android。 Appium 希望开发者测试人员能够为该平台编写 UI 自动化代码,根据单一的统一 API。 根据 Appium 的目标,我们有很多问题需要回答以使其全部工作:
|
||||
所以,以您了解的任何应用平台为例,如 iOS 或 Android。 Appium 希望开发者测试人员能够为该平台编写 UI 自动化代码,根据单一的统一 API。根据 Appium 的目标,我们有很多问题需要回答以使其全部工作:
|
||||
|
||||
- “单一统一”的 API 应该是什么?
|
||||
- 我们如何将此 API 映射到特定平台的自动化行为?
|
||||
@@ -25,70 +25,68 @@ title: Appium 如何工作?
|
||||
|
||||
- 我们如何为_所有_平台启用自动化?
|
||||
|
||||
探索 Appium 对这些问题的答案可能不是学习 Appium 是什么的最快方式,但它肯定是一个好方法! 所以让我们深入了解。
|
||||
探索 Appium 对这些问题的答案可能不是学习 Appium 是什么的最快方式,但它肯定是一个好方法!所以让我们深入了解。
|
||||
|
||||
## Appium 的 API 选择
|
||||
|
||||
Appium 非常幸运地继承了一个在 UI 自动化领域长期领先的技术,即 [Selenium](https://selenium.dev)。 Selenium 项目的目标是支持 Web 浏览器的 UI 自动化,因此我们可以将其视为占据 Appium 目标子集的一部分。 在此过程中,Selenium(以及后来合并的另一个名为 WebDriver 的项目)开发了一个相对稳定的浏览器自动化 API。
|
||||
Appium 非常幸运地继承了一个在 UI 自动化领域长期领先的技术,即 [Selenium](https://selenium.dev)。 Selenium 项目的目标是支持 Web 浏览器的 UI 自动化,因此我们可以将其视为占据 Appium 目标子集的一部分。在此过程中,Selenium(以及后来合并的另一个名为 WebDriver 的项目)开发了一个相对稳定的浏览器自动化 API。
|
||||
|
||||
多年来,Selenium 与各种 Web 浏览器供应商和 [W3C](https://w3.org) 标准小组合作,将其 API 转变为官方 Web 浏览器标准,称为 [WebDriver 规范](https://w3c.github.io/webdriver/)。
|
||||
所有主要浏览器现在都实现了符合 WebDriver 规范的自动化功能,而无需 Selenium 团队维护任何执行实际自动化的软件;标准获胜!
|
||||
|
||||
Appium 的最初目标是为移动应用(iOS 和 Android)开发自动化标准。 我们本可以发明一些新的东西,但为了团结力量并保持标准的标准化,我们决定采用 WebDriver 规范作为 Appium 的 API。[^2] 虽然网站和移动原生应用的用户交互并不完全相同(一旦我们开始考虑例如由简单遥控器控制的电视平台,差异会更大),但事实是大多数软件 UI 都非常相似。 这意味着 WebDriver 规范提供了自动化 API 原语(查找元素、与元素交互、加载页面或屏幕等) 这些原语或多或少映射到任何平台。
|
||||
Appium 的最初目标是为移动应用(iOS 和 Android)开发自动化标准。我们本可以发明一些新的东西,但为了团结力量并保持标准的标准化,我们决定采用 WebDriver 规范作为 Appium 的 API。[^2] 虽然网站和移动原生应用的用户交互并不完全相同(一旦我们开始考虑例如由简单遥控器控制的电视平台,差异会更大),但事实是大多数软件 UI 都非常相似。这意味着 WebDriver 规范提供了自动化 API 原语(查找元素、与元素交互、加载页面或屏幕等)这些原语或多或少映射到任何平台。
|
||||
|
||||
[^2]: 从技术上讲,当 Appium 首次编写时,我们处理的是比 WebDriver 规范更古老的东西,称为 JSON Wire Protocol。 从那时起,Appium 继续与 W3C 规范一起演化,并完全符合 W3C 规范。
|
||||
[^2]: 从技术上讲,当 Appium 首次编写时,我们处理的是比 WebDriver 规范更古老的东西,称为 JSON Wire Protocol。从那时起,Appium 继续与 W3C 规范一起演化,并完全符合 W3C 规范。
|
||||
|
||||
当然,Appium 希望支持用户交互从 Web 到移动或 Web 到电视确实不同的情况,因此 Appium 还利用 WebDriver 规范的内置_可扩展性_。 结果是,无论您想要自动化哪个平台,当您使用 Appium 时,您将使用标准 WebDriver 规范,但有两个注意事项:
|
||||
当然,Appium 希望支持用户交互从 Web 到移动或 Web 到电视确实不同的情况,因此 Appium 还利用 WebDriver 规范的内置_可扩展性_。结果是,无论您想要自动化哪个平台,当您使用 Appium 时,您将使用标准 WebDriver 规范,但有两个注意事项:
|
||||
|
||||
- 我们可能无法在给定平台上支持特定的 WebDriver API 命令,因此某些命令可能不受支持(例如,在原生移动应用自动化世界中,获取或设置 cookie 是不可能的)。
|
||||
- 我们可能支持超出 WebDriver API 命令列表的自动化行为,尽管任何此类命令将是有效的、符合规范的 WebDriver API 扩展。
|
||||
|
||||
您实际上如何_使用_ WebDriver API,特别是 Appium 的背景下? 我们将在下面的[部分](#universal-programming-language-access)中介绍 Appium 如何提供通用编程语言访问。 您现在只需要知道 Appium 通过实现 WebDriver 协议来引入通用 UI 自动化接口。
|
||||
您实际上如何_使用_ WebDriver API,特别是 Appium 的背景下?我们将在下面的[部分](#universal-programming-language-access)中介绍 Appium 如何提供通用编程语言访问。您现在只需要知道 Appium 通过实现 WebDriver 协议来引入通用 UI 自动化接口。
|
||||
|
||||
## 平台自动化行为
|
||||
|
||||
下一个问题是,Appium 如何将此协议映射到广泛平台的自动化行为? 严格来说,Appium 没有! 它将此责任留给一种称为 Appium _驱动程序_ 的软件模块。 您可以阅读整个[驱动程序](./drivers.md)的介绍,所以我们现在不会深入细节。
|
||||
下一个问题是,Appium 如何将此协议映射到广泛平台的自动化行为?严格来说,Appium 没有!它将此责任留给一种称为 Appium _驱动程序_ 的软件模块。您可以阅读整个[驱动程序](./drivers.md)的介绍,所以我们现在不会深入细节。
|
||||
|
||||
目前重要的是要理解驱动程序有点像 Appium 的可插拔模块,它赋予 Appium 自动化特定平台(或平台集,取决于驱动程序的目标)的能力。最终,驱动程序的责任只是实现代表 WebDriver 协议的 Appium 内部接口。它如何实现此接口完全取决于驱动程序,基于其在特定平台上实现自动化的策略。通常,在细节上具有更多复杂性和难度,驱动程序通过依赖特定于平台的自动化技术来实现这一点。例如,Apple 维护一种称为 [XCUITest](https://developer.apple.com/documentation/xctest/user_interface_tests) 的 iOS 自动化技术。 The Appium
|
||||
driver that supports iOS app automation is called the XCUITest
|
||||
Driver because ultimately what it does is
|
||||
convert the WebDriver protocol to XCUITest library calls.
|
||||
|
||||
驱动程序是独立、可插拔模块的原因之一是它们彼此完全不同。 构建和使用不同平台的驱动程序的工具和要求完全不同。 因此,Appium 让您只使用您自动化任务所需的驱动程序。 选择驱动程序并安装它们以便与您的 Appium 实例一起使用非常重要,以至于 Appium 有自己的 [CLI 来管理驱动程序](../reference/cli/extensions.md)。
|
||||
驱动程序是独立、可插拔模块的原因之一是它们彼此完全不同。构建和使用不同平台的驱动程序的工具和要求完全不同。因此,Appium 让您只使用您自动化任务所需的驱动程序。选择驱动程序并安装它们以便与您的 Appium 实例一起使用非常重要,以至于 Appium 有自己的 [CLI 来管理驱动程序](../reference/cli/extensions.md)。
|
||||
|
||||
因此,为了回答我们最初的问题,Appium 为给定平台提供自动化功能访问的方式是 Appium 团队(或任何人[^3])为该平台编写一个_驱动程序_,实现 WebDriver 协议的尽可能多或少的部分。 然后,任何使用 Appium 的人都可以安装驱动程序。
|
||||
因此,为了回答我们最初的问题,Appium 为给定平台提供自动化功能访问的方式是 Appium 团队(或任何人[^3])为该平台编写一个_驱动程序_,实现 WebDriver 协议的尽可能多或少的部分。然后,任何使用 Appium 的人都可以安装驱动程序。
|
||||
|
||||
[^3]: 您可以构建和分享自己的驱动程序! 查看[构建驱动程序](../developing/build-drivers.md)以了解更多关于如何在 Node.js 中开发可与 Appium 一起使用的驱动程序的信息。
|
||||
[^3]: 您可以构建和分享自己的驱动程序!查看[构建驱动程序](../developing/build-drivers.md)以了解更多关于如何在 Node.js 中开发可与 Appium 一起使用的驱动程序的信息。
|
||||
|
||||
## 通用编程语言访问
|
||||
|
||||
但使用 Appium 意味着什么,或者看起来像什么? 由于 Appium 最终是一个 Node.js 程序,它_可以_看起来像将 Appium 及其驱动程序作为库导入到您自己的 Node.js 程序中。 但这不会满足 Appium 的目标,即为使用任何流行编程语言的人提供自动化功能。
|
||||
但使用 Appium 意味着什么,或者看起来像什么?由于 Appium 最终是一个 Node.js 程序,它_可以_看起来像将 Appium 及其驱动程序作为库导入到您自己的 Node.js 程序中。但这不会满足 Appium 的目标,即为使用任何流行编程语言的人提供自动化功能。
|
||||
|
||||
幸运的是,Appium 继承 Selenium 的遗产意味着我们从一开始就有了这个问题的解决方案。 您看,WebDriver 规范实际上是一个基于 HTTP 的协议,这意味着它被设计为通过网络而不是单个程序的内存使用。
|
||||
幸运的是,Appium 继承 Selenium 的遗产意味着我们从一开始就有了这个问题的解决方案。您看,WebDriver 规范实际上是一个基于 HTTP 的协议,这意味着它被设计为通过网络而不是单个程序的内存使用。
|
||||
|
||||
这种“客户端-服务器”架构的主要好处之一是,它允许自动化实现者(执行自动化的事物,在这种情况下是“服务器”)与自动化运行者(定义应该做什么自动化、以什么步骤等的事物,在这种情况下是“客户端”)完全不同。 基本上,所有“困难的东西”(弄清楚如何在给定平台上实现自动化)可以在服务器的一个地方处理,“瘦”客户端库可以在任何编程语言中编写,这些库只需以适合语言的方式编码对服务器的 HTTP 请求。 换句话说,假设存在高级 HTTP 库,只需在该语言中编写基本的 HTTP 客户端,就可以相对容易地将基本的 Appium / WebDriver 功能引入新的编程语言。
|
||||
这种“客户端-服务器”架构的主要好处之一是,它允许自动化实现者(执行自动化的事物,在这种情况下是“服务器”)与自动化运行者(定义应该做什么自动化、以什么步骤等的事物,在这种情况下是“客户端”)完全不同。基本上,所有“困难的东西”(弄清楚如何在给定平台上实现自动化)可以在服务器的一个地方处理,“瘦”客户端库可以在任何编程语言中编写,这些库只需以适合语言的方式编码对服务器的 HTTP 请求。换句话说,假设存在高级 HTTP 库,只需在该语言中编写基本的 HTTP 客户端,就可以相对容易地将基本的 Appium / WebDriver 功能引入新的编程语言。
|
||||
|
||||
这里有几个重要的点供 Appium 用户了解:
|
||||
|
||||
- Appium 是一个_HTTP 服务器_。 只要您想使用它进行自动化,它必须在某台计算机上作为进程运行。 它必须在网络上可访问,以方便您想要运行自动化的任何计算机访问(无论是同一台机器还是世界另一端的机器)。
|
||||
- 除非您想编写原始 HTTP 调用或使用 cURL,否则请使用您选择的语言的 [Appium 客户端](clients.md)进行自动化。 每个客户端的目标是将 WebDriver 协议封装,以便您不必担心协议本身,而是可以使用感觉适合您语言的对象和方法。
|
||||
- Appium 服务器和 Appium 客户端_不需要_在同一台计算机上运行。 您只需能够通过某个网络从客户端向服务器发送 HTTP 请求。
|
||||
这大大促进了云提供商对 Appium 的使用,因为他们可以托管 Appium 服务器以及任何相关驱动程序和设备,您只需将客户端脚本指向他们的安全端点。
|
||||
- Appium 是一个_HTTP 服务器_。只要您想使用它进行自动化,它必须在某台计算机上作为进程运行。它必须在网络上可访问,以方便您想要运行自动化的任何计算机访问(无论是同一台机器还是世界另一端的机器)。
|
||||
- 除非您想编写原始 HTTP 调用或使用 cURL,否则请使用您选择的语言的 [Appium 客户端](clients.md)进行自动化。每个客户端的目标是将 WebDriver 协议封装,以便您不必担心协议本身,而是可以使用感觉适合您语言的对象和方法。
|
||||
- Appium 服务器和 Appium 客户端_不需要_在同一台计算机上运行。您只需能够通过某个网络从客户端向服务器发送 HTTP 请求。这大大促进了云提供商对 Appium 的使用,因为他们可以托管 Appium 服务器以及任何相关驱动程序和设备,您只需将客户端脚本指向他们的安全端点。
|
||||
|
||||
当然,这一切都不是关于“测试”本身,只是出于自动化目的使用 Appium 及其客户端库。 如果您想出于“测试”目的进行自动化,您可能希望利用测试运行器、测试框架等的帮助,这些都不需要与 Appium 相关;Appium“通用可访问性”的好处之一是它与您发现最适合您情况的任何工具集配合良好。
|
||||
当然,这一切都不是关于“测试”本身,只是出于自动化目的使用 Appium 及其客户端库。如果您想出于“测试”目的进行自动化,您可能希望利用测试运行器、测试框架等的帮助,这些都不需要与 Appium 相关;Appium“通用可访问性”的好处之一是它与您发现最适合您情况的任何工具集配合良好。
|
||||
|
||||
## Appium 的巨大范围
|
||||
|
||||
Appium 的愿景(在单一 API 下自动化一切)是巨大的! 当然,比开源项目的核心维护者团队大得多。 那么 Appium 如何希望实现这一目标? 基本上,通过授权社区在 Appium 之上作为_平台_开发功能。 这就是我们所谓的 Appium“生态系统”。
|
||||
Appium 的愿景(在单一 API 下自动化一切)是巨大的!当然,比开源项目的核心维护者团队大得多。那么 Appium 如何希望实现这一目标?基本上,通过授权社区在 Appium 之上作为_平台_开发功能。这就是我们所谓的 Appium“生态系统”。
|
||||
|
||||
Appium 团队确实自己维护了一些驱动程序(例如,我们之前讨论的 XCUITest 驱动程序)。 但它无法拥有特定于平台的专业知识或维护许多不同平台的驱动程序的能力。 但我们所做的,特别是从 Appium 2 开始,是提供工具来授权社区加入我们的愿景:
|
||||
Appium 团队确实自己维护了一些驱动程序(例如,我们之前讨论的 XCUITest 驱动程序)。但它无法拥有特定于平台的专业知识或维护许多不同平台的驱动程序的能力。但我们所做的,特别是从 Appium 2 开始,是提供工具来授权社区加入我们的愿景:
|
||||
|
||||
- 任何人都可以通过创建一个符合适当约定并实现 WebDriver 协议的任何(子|超)集的 Node.js 模块来创建驱动程序。 创建驱动程序通常涉及最少的代码,因为 WebDriver 协议细节被抽象化,许多帮助库可用---这些库为 Appium 团队自己的驱动程序提供动力。
|
||||
- 使用 Appium 驱动程序 CLI 与他人分享驱动程序很容易。 没有中央权威。
|
||||
任何人都可以公开或私下分享驱动程序,免费或收费。 驱动程序可以是开源或闭源的(尽管我们欣赏开源!)。
|
||||
- 任何人都可以通过创建一个符合适当约定并实现 WebDriver 协议的任何(子|超)集的 Node.js 模块来创建驱动程序。创建驱动程序通常涉及最少的代码,因为 WebDriver 协议细节被抽象化,许多帮助库可用---这些库为 Appium 团队自己的驱动程序提供动力。
|
||||
- 使用 Appium 驱动程序 CLI 与他人分享驱动程序很容易。没有中央权威。任何人都可以公开或私下分享驱动程序,免费或收费。驱动程序可以是开源或闭源的(尽管我们欣赏开源!)。
|
||||
|
||||
Appium 作为开发平台的愿景超越了对所有应用平台自动化支持。 作为一个流行的自动化工具,有许多机会将 Appium 与各种其他工具和服务集成。 此外,Appium 有许多功能想法,要么作为核心服务器,要么在其各种驱动程序中的化身,核心团队没有足够的时间构建。 因此,Appium 2 发布了一个插件系统,使任何人都可以构建和分享改变 Appium 工作方式的模块!
|
||||
Appium 作为开发平台的愿景超越了对所有应用平台自动化支持。作为一个流行的自动化工具,有许多机会将 Appium 与各种其他工具和服务集成。此外,Appium 有许多功能想法,要么作为核心服务器,要么在其各种驱动程序中的化身,核心团队没有足够的时间构建。因此,Appium 2 发布了一个插件系统,使任何人都可以构建和分享改变 Appium 工作方式的模块!
|
||||
|
||||
就像驱动程序可以通过 Appium 驱动程序 CLI 轻松分享和消费一样,插件可以通过[插件 CLI](../reference/cli/extensions.md)发布和消费。 插件可以做各种事情,例如添加 Appium 根据模板图像查找和与屏幕区域交互的能力(例如[图像插件](https://github.com/appium/appium/tree/master/packages/images-plugin))。 插件几乎没有限制,所以您可能也对学习如何在 Node.js 中[构建插件](../developing/build-plugins.md)以与 Appium 一起使用感兴趣。
|
||||
就像驱动程序可以通过 Appium 驱动程序 CLI 轻松分享和消费一样,插件可以通过[插件 CLI](../reference/cli/extensions.md)发布和消费。插件可以做各种事情,例如添加 Appium 根据模板图像查找和与屏幕区域交互的能力(例如[图像插件](https://github.com/appium/appium/tree/master/packages/images-plugin))。插件几乎没有限制,所以您可能也对学习如何在 Node.js 中[构建插件](../developing/build-plugins.md)以与 Appium 一起使用感兴趣。
|
||||
|
||||
所以这就是 Appium:一个可扩展的、潜在一切的 UI 自动化通用接口! 继续阅读一些具体的介绍文档以获取更多细节,或查看各种指南以深入了解 Appium 的一些更一般概念和功能。
|
||||
所以这就是 Appium:一个可扩展的、潜在一切的 UI 自动化通用接口!继续阅读一些具体的介绍文档以获取更多细节,或查看各种指南以深入了解 Appium 的一些更一般概念和功能。
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: Appium 客户端简介
|
||||
---
|
||||
|
||||
出于[概述](./appium.md)中讨论的所有原因,Appium 基于 [W3C WebDriver 规范](https://w3c.github.io/webdriver/)。 这意味着 Appium 实现了客户端-服务器架构。 服务器(由 Appium 本身以及您用于自动化的任何驱动程序或插件组成)连接到测试设备,并实际负责在这些设备上实现自动化。 客户端(由_您_驱动,Appium 测试作者)负责通过网络向服务器发送命令,并接收来自服务器的响应。 这些响应可用于判断自动化命令是否成功,或可能包含您查询的关于应用程序状态的信息。 本文档是对客户端方面的概念性介绍。
|
||||
出于[概述](./appium.md)中讨论的所有原因,Appium 基于 [W3C WebDriver 规范](https://w3c.github.io/webdriver/)。这意味着 Appium 实现了客户端-服务器架构。服务器(由 Appium 本身以及您用于自动化的任何驱动程序或插件组成)连接到测试设备,并实际负责在这些设备上实现自动化。客户端(由_您_驱动,Appium 测试作者)负责通过网络向服务器发送命令,并接收来自服务器的响应。这些响应可用于判断自动化命令是否成功,或可能包含您查询的关于应用程序状态的信息。本文档是对客户端方面的概念性介绍。
|
||||
|
||||
!!! info
|
||||
|
||||
@@ -13,18 +13,18 @@ title: Appium 客户端简介
|
||||
有关服务器端的信息(即 Appium 如何实际控制设备?),请查看我们的 [Appium 驱动程序简介](./drivers.md)。要跳转到 Appium 客户端库链接列表,请查看[客户端列表](../ecosystem/clients.md)。
|
||||
```
|
||||
|
||||
有哪些自动化命令可用? 那取决于您在任何给定会话中使用的特定驱动程序和插件。 一组标准命令可能包括以下内容:
|
||||
有哪些自动化命令可用?那取决于您在任何给定会话中使用的特定驱动程序和插件。一组标准命令可能包括以下内容:
|
||||
|
||||
- 查找元素
|
||||
- 点击元素
|
||||
- 获取页面源代码
|
||||
- 截取屏幕截图
|
||||
|
||||
如果您查看 WebDriver 规范中的这些命令,您会注意到它们不是以任何特定编程语言定义的。 它们不是 Java 命令、JavaScript 命令或 Python 命令。 相反,它们形成了可以通过_任何_编程语言访问的 HTTP API( 如果您愿意,您可以只使用 cURL)。
|
||||
如果您查看 WebDriver 规范中的这些命令,您会注意到它们不是以任何特定编程语言定义的。它们不是 Java 命令、JavaScript 命令或 Python 命令。相反,它们形成了可以通过_任何_编程语言访问的 HTTP API(如果您愿意,您可以只使用 cURL)。
|
||||
|
||||
例如,`查找元素`命令对应于发送到 HTTP 端点 `/session/:sessionid/element` 的 HTTP `POST` 请求(其中`:sessionid` 是服务器在之前 `创建会话` 调用中生成的唯一会话 ID 的占位符)。
|
||||
|
||||
此信息主要对开发与 WebDriver 规范一起工作的技术的人有用。 它对试图编写 Appium 或 Selenium 测试的人不是特别有用。 当您编写 Appium 测试时,您希望使用您熟悉的编程语言。 幸运的是,存在一组 [Appium 客户端库](../ecosystem/clients.md)[^1],它们负责向 Appium 服务器发起HTTP 的请求。 它们为特定编程语言公开了一组“原生”命令,以便对测试作者来说,它就像您在编写 Python、JavaScript 或 Java。
|
||||
此信息主要对开发与 WebDriver 规范一起工作的技术的人有用。它对试图编写 Appium 或 Selenium 测试的人不是特别有用。当您编写 Appium 测试时,您希望使用您熟悉的编程语言。幸运的是,存在一组 [Appium 客户端库](../ecosystem/clients.md)[^1],它们负责向 Appium 服务器发起HTTP 的请求。它们为特定编程语言公开了一组“原生”命令,以便对测试作者来说,它就像您在编写 Python、JavaScript 或 Java。
|
||||
|
||||
以下是使用 Appium 客户端在五种不同编程语言中实现相同的 Appium 命令集的示例(注意,这不是包含所有导入的工作示例代码;请参阅每个客户端库的设置和命令参考说明):
|
||||
|
||||
@@ -85,16 +85,15 @@ System.Console.WriteLine(driver.PageSource);
|
||||
|
||||
尽管这些脚本使用不同的编程语言,但它们在底层做的事情是相同的:
|
||||
|
||||
1. 调用 `Find Element`,使用 `using` 参数值为 `xpath`,以及 `value` 参数表达用于查找元素的 XPath 查询。 (如果你对这些术语感到困惑,可以参考 Appium 或 Selenium 的入门介绍)
|
||||
1. 调用 `Find Element`,使用 `using` 参数值为 `xpath`,以及 `value` 参数表达用于查找元素的 XPath 查询。(如果你对这些术语感到困惑,可以参考 Appium 或 Selenium 的入门介绍)
|
||||
2. 使用在上一次调用中找到的元素 ID 调用 `Click Element`。
|
||||
3. 使用同一元素的 ID 调用 `Get Element Text`,并将其打印到控制台。
|
||||
4. 调用 `Get Page Source` 来检索页面/应用程序源代码并将其打印到控制台。
|
||||
|
||||
在选择或使用客户端之前,需要记住的另一件事是每个客户端都是独立维护的。 仅仅因为某个功能在一个客户端中可用,并不意味着它在另一个客户端中也可用(尽管所有客户端至少支持标准的 W3C 协议以及任何常见的 Appium 扩展)。 仅仅因为一个客户端有一套很好的辅助函数,并不意味着另一个客户端也会有。 有些客户端更新非常频繁,而其他客户端则不然! 因此,在考虑选择一个库时,首要考虑的是你想使用的语言,第二个考虑因素是该库的功能完善程度和维护情况!
|
||||
在选择或使用客户端之前,需要记住的另一件事是每个客户端都是独立维护的。仅仅因为某个功能在一个客户端中可用,并不意味着它在另一个客户端中也可用(尽管所有客户端至少支持标准的 W3C 协议以及任何常见的 Appium 扩展)。仅仅因为一个客户端有一套很好的辅助函数,并不意味着另一个客户端也会有。有些客户端更新非常频繁,而其他客户端则不然! 因此,在考虑选择一个库时,首要考虑的是你想使用的语言,第二个考虑因素是该库的功能完善程度和维护情况!
|
||||
|
||||
要学习如何使用 Appium 客户端,请访问该客户端的主页以了解更多信息。 在许多情况下,特定语言的 Appium 客户端是在该语言的 _Selenium_ 客户端之上构建的,因此某些 Appium 客户端可能只记录 Appium 客户端在 Selenium 客户端基础上添加的功能。 也就是说,要获得完整的参考,你可能需要访问 Appium 客户端文档以及 Selenium 客户端文档。
|
||||
要学习如何使用 Appium 客户端,请访问该客户端的主页以了解更多信息。在许多情况下,特定语言的 Appium 客户端是在该语言的 _Selenium_ 客户端之上构建的,因此某些 Appium 客户端可能只记录 Appium 客户端在 Selenium 客户端基础上添加的功能。也就是说,要获得完整的参考,你可能需要访问 Appium 客户端文档以及 Selenium 客户端文档。
|
||||
|
||||
这就是你需要了解的关于 Appium 客户端的全部内容! 前往 [客户端](../ecosystem/clients.md) 页面查看当前的客户端列表。
|
||||
这就是你需要了解的关于 Appium 客户端的全部内容!前往 [客户端](../ecosystem/clients.md) 页面查看当前的客户端列表。
|
||||
|
||||
[^1]: 这些库也被称为"客户端"、"客户端库"或"客户端绑定"。
|
||||
它们的意思都是一样的!
|
||||
[^1]: 这些库也被称为"客户端"、"客户端库"或"客户端绑定"。它们的意思都是一样的!
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
title: Appium 驱动程序介绍
|
||||
---
|
||||
|
||||
正如[概览](./appium.md)所阐明的那样,"驱动程序"基本上是 Appium 对"我们如何支持多个不相关平台的自动化?"这一问题的答案。 在本文档中,我们将更详细地了解驱动程序的工作原理。 驱动程序工作的具体细节对你来说可能并不那么重要,除非你打算编写自己的驱动程序或为现有驱动程序做贡献(我们希望你这样做!)。
|
||||
正如[概览](./appium.md)所阐明的那样,"驱动程序"基本上是 Appium 对"我们如何支持多个不相关平台的自动化?"这一问题的答案。在本文档中,我们将更详细地了解驱动程序的工作原理。驱动程序工作的具体细节对你来说可能并不那么重要,除非你打算编写自己的驱动程序或为现有驱动程序做贡献(我们希望你这样做!)。
|
||||
|
||||
了解更多驱动程序工作原理的主要好处是,了解典型的复杂性或典型的驱动程序架构将有助于你在测试中遇到问题时进行调试。
|
||||
|
||||
## 接口实现
|
||||
|
||||
在最基本的层面上,驱动程序只是扩展了 Appium 中包含的一个特殊类的 Node.js 类,这个类叫做 `BaseDriver`。 你可以用以下非常简单的几行代码就拥有一个非常接近"可工作"的驱动程序:
|
||||
在最基本的层面上,驱动程序只是扩展了 Appium 中包含的一个特殊类的 Node.js 类,这个类叫做 `BaseDriver`。你可以用以下非常简单的几行代码就拥有一个非常接近"可工作"的驱动程序:
|
||||
|
||||
```js
|
||||
import BaseDriver from '@appium/base-driver'
|
||||
@@ -19,9 +19,9 @@ class MyNewDriver extends BaseDriver {
|
||||
|
||||
这个空驱动程序不会_做_任何事情,但你可以将它打包成一个 Node.js 模块,在模块的清单文件(`package.json`)中添加一些与 Appium 相关的字段,然后使用 `appium driver install` 安装它。
|
||||
|
||||
因此,从技术角度来看,Appium 驱动程序只是一些继承自其他 Appium 代码的代码。 就是这样! 现在,继承自 `BaseDriver` 实际上给了我们很多东西,因为 `BaseDriver` 本质上是整个 WebDriver 协议的封装。 所以驱动程序要做一些有用的事情,只需要_实现_名称与其 WebDriver 协议等效的 Node.js 方法。
|
||||
因此,从技术角度来看,Appium 驱动程序只是一些继承自其他 Appium 代码的代码。就是这样!现在,继承自 `BaseDriver` 实际上给了我们很多东西,因为 `BaseDriver` 本质上是整个 WebDriver 协议的封装。所以驱动程序要做一些有用的事情,只需要_实现_名称与其 WebDriver 协议等效的 Node.js 方法。
|
||||
|
||||
假设我想用这个空驱动程序做点什么;首先我必须决定要实现哪个 WebDriver 命令。 对于我们的例子,让我们选择[Navigate To](https://w3c.github.io/webdriver/#navigate-to) WebDriver 命令。 暂时不考虑当这个命令执行时我想让驱动程序_做_什么。 要告诉 Appium 驱动程序可以处理这个命令,我们所要做的就是在驱动程序类中定义一个像这样的方法:[^1]
|
||||
假设我想用这个空驱动程序做点什么;首先我必须决定要实现哪个 WebDriver 命令。对于我们的例子,让我们选择[Navigate To](https://w3c.github.io/webdriver/#navigate-to) WebDriver 命令。暂时不考虑当这个命令执行时我想让驱动程序_做_什么。要告诉 Appium 驱动程序可以处理这个命令,我们所要做的就是在驱动程序类中定义一个像这样的方法:[^1]
|
||||
|
||||
```js
|
||||
async setUrl(url) {
|
||||
@@ -34,7 +34,7 @@ async setUrl(url) {
|
||||
[routes/](https://github.com/appium/appium/tree/master/packages/base-driver/lib/protocol/routes) directory.
|
||||
所以如果你正在编写驱动程序,这就是你要去找出要使用什么方法名和期望什么参数的地方。或者你可以查看任何主要 Appium 驱动程序的源代码!
|
||||
|
||||
就是这样! 我们如何实际实现该命令完全取决于我们自己,并取决于我们想要支持的平台。 以下是针对不同平台的此命令的一些不同示例实现:
|
||||
就是这样!我们如何实际实现该命令完全取决于我们自己,并取决于我们想要支持的平台。以下是针对不同平台的此命令的一些不同示例实现:
|
||||
|
||||
- 浏览器:执行一些 JavaScript 来设置 `window.location.href`
|
||||
- iOS 应用:使用深度链接启动应用
|
||||
@@ -46,7 +46,7 @@ async setUrl(url) {
|
||||
|
||||
[^2]: 当然,我们希望保持语义尽可能相似,但在 iOS 的世界里,例如,通过深度链接(具有特殊应用特定方案的 URL)启动应用是我们最接近导航到 Web URL 的方式。
|
||||
|
||||
我们之所以如此详细地讨论(顺便说一下,你不需要记住这些),是因为重要的是要强调一点,Appium 驱动程序本质上不是任何特定的东西,只是一些可以处理 WebDriver 协议命令的 JS 代码。 从那里去哪里取决于你,驱动程序作者!
|
||||
我们之所以如此详细地讨论(顺便说一下,你不需要记住这些),是因为重要的是要强调一点,Appium 驱动程序本质上不是任何特定的东西,只是一些可以处理 WebDriver 协议命令的 JS 代码。从那里去哪里取决于你,驱动程序作者!
|
||||
|
||||
## 自动化映射
|
||||
|
||||
@@ -54,24 +54,24 @@ But _typically_ what driver authors want to do is to provide automation behaviou
|
||||
platform(s) that are semantically very similar to the WebDriver spec implementations for
|
||||
browsers. 当你想查找一个元素时,你应该得到一个 UI 元素的引用。当你想点击或轻触该元素时,产生的行为应该与人点击或轻触该元素相同。等等。
|
||||
|
||||
因此,驱动程序作者面临的真正挑战不是如何使用 WebDriver 协议(因为 `BaseDriver` 为你封装了所有这些),而是如何在目标平台上实现实际的自动化。 每个驱动程序都依赖于自己的一套底层技术。 正如[概览](index.md)中提到的,iOS 驱动程序使用 Apple 的一项名为 [XCUITest](https://developer.apple.com/documentation/xctest/xcuielement) 的技术。 这些底层自动化技术通常都有自己专有或特殊的 API。 编写驱动程序就是将 WebDriver 协议映射到这个底层 API 的任务(有时是一组不同的底层 API——例如,UiAutomator2 驱动程序不仅依赖于 Google 的 [UiAutomator2](https://developer.android.com/training/testing/other-components/ui-automator) 技术,还依赖于只能通过 [ADB](https://developer.android.com/tools/adb) 获得的功能,以及只能通过辅助应用内的 Android SDK 获得的功能)。 将所有这些整合到一个单一、可用的 WebDriver 接口中,是驱动程序开发这项非常有用(但极具挑战性)的艺术!
|
||||
因此,驱动程序作者面临的真正挑战不是如何使用 WebDriver 协议(因为 `BaseDriver` 为你封装了所有这些),而是如何在目标平台上实现实际的自动化。每个驱动程序都依赖于自己的一套底层技术。正如[概览](index.md)中提到的,iOS 驱动程序使用 Apple 的一项名为 [XCUITest](https://developer.apple.com/documentation/xctest/xcuielement) 的技术。这些底层自动化技术通常都有自己专有或特殊的 API。编写驱动程序就是将 WebDriver 协议映射到这个底层 API 的任务(有时是一组不同的底层 API——例如,UiAutomator2 驱动程序不仅依赖于 Google 的 [UiAutomator2](https://developer.android.com/training/testing/other-components/ui-automator) 技术,还依赖于只能通过 [ADB](https://developer.android.com/tools/adb) 获得的功能,以及只能通过辅助应用内的 Android SDK 获得的功能)。将所有这些整合到一个单一、可用的 WebDriver 接口中,是驱动程序开发这项非常有用(但极具挑战性)的艺术!
|
||||
|
||||
## 多层架构
|
||||
|
||||
在实践中,这通常会导致相当复杂的架构。 让我们再次以 iOS 为例。
|
||||
XCUITest 框架(Appium 驱动程序使用的框架)期望调用它的代码用 Objective-C 或 Swift 编写。 此外,XCUITest 代码只能在由 Xcode(以及直接或间接的 Xcode 命令行工具)触发的特殊模式下运行。 换句话说,没有直接的方法从 Node.js 函数实现(如上面的 `setUrl()`)到 XCUITest API 调用。
|
||||
在实践中,这通常会导致相当复杂的架构。让我们再次以 iOS 为例。
|
||||
XCUITest 框架(Appium 驱动程序使用的框架)期望调用它的代码用 Objective-C 或 Swift 编写。此外,XCUITest 代码只能在由 Xcode(以及直接或间接的 Xcode 命令行工具)触发的特殊模式下运行。换句话说,没有直接的方法从 Node.js 函数实现(如上面的 `setUrl()`)到 XCUITest API 调用。
|
||||
|
||||
XCUITest 驱动程序作者所做的是将驱动程序分成两部分:一部分用 Node.js 编写(这部分被整合到 Appium 中并最初处理 WebDriver 命令),另一部分用 Objective-C 编写(这部分实际在 iOS 设备上运行并进行 XCUITest API 调用)。 这使得与 XCUITest 的接口成为可能,但引入了两部分之间协调的新问题。
|
||||
XCUITest 驱动程序作者所做的是将驱动程序分成两部分:一部分用 Node.js 编写(这部分被整合到 Appium 中并最初处理 WebDriver 命令),另一部分用 Objective-C 编写(这部分实际在 iOS 设备上运行并进行 XCUITest API 调用)。这使得与 XCUITest 的接口成为可能,但引入了两部分之间协调的新问题。
|
||||
|
||||
驱动程序作者本可以选择许多非常不同的策略来建模 Node.js 端和 Objective-C 端之间的通信,但最终决定使用……
|
||||
WebDriver 协议! 没错,XCUITest 驱动程序的 Objective-C 端本身就是一个 WebDriver 实现,称为 [WebDriverAgent](https://github.com/appium/webdriveragent)。[^3]
|
||||
WebDriver 协议!没错,XCUITest 驱动程序的 Objective-C 端本身就是一个 WebDriver 实现,称为 [WebDriverAgent](https://github.com/appium/webdriveragent)。[^3]
|
||||
|
||||
[^3]: 因此,理论上你可以将你的 WebDriver 客户端直接指向 WebDriverAgent 并完全绕过 Appium。 然而,这通常不方便,原因如下:
|
||||
[^3]: 因此,理论上你可以将你的 WebDriver 客户端直接指向 WebDriverAgent 并完全绕过 Appium。然而,这通常不方便,原因如下:
|
||||
|
||||
- Appium XCUITest 驱动程序会为你构建和管理 WebDriverAgent,这可能很麻烦并涉及使用 Xcode。
|
||||
- XCUITest 驱动程序做的事情远不止 WebDriverAgent 所能做的,例如使用模拟器或设备、安装应用等。
|
||||
|
||||
这个故事的寓意是,由于我们试图解决的问题的性质,驱动程序架构可能会变得相当复杂和多层。 这也意味着,如果你在特定测试中遇到问题,有时很难判断这一系列技术中的哪个环节出了问题。 再以 XCUITest 为例,我们同时使用以下一组技术:
|
||||
这个故事的寓意是,由于我们试图解决的问题的性质,驱动程序架构可能会变得相当复杂和多层。这也意味着,如果你在特定测试中遇到问题,有时很难判断这一系列技术中的哪个环节出了问题。再以 XCUITest 为例,我们同时使用以下一组技术:
|
||||
|
||||
- 你的测试代码(使用其编程语言)- 由你拥有
|
||||
- Appium 客户端库 - 由 Appium 拥有
|
||||
@@ -89,20 +89,20 @@ WebDriver 协议! 没错,XCUITest 驱动程序的 Objective-C 端本身就
|
||||
|
||||
## 代理模式
|
||||
|
||||
还有一个关于驱动程序的重要架构方面需要了解。 可以再次用 XCUITest 驱动程序来举例说明。 回想一下我们刚才讨论的 XCUITest 驱动程序的两个"部分"是如何都使用 WebDriver 协议的——Node.js 部分直接连接到 Appium 的 WebDriver 服务器,而 Objective-C 部分(WebDriverAgent)本身就是一个 WebDriver 实现。
|
||||
还有一个关于驱动程序的重要架构方面需要了解。可以再次用 XCUITest 驱动程序来举例说明。回想一下我们刚才讨论的 XCUITest 驱动程序的两个"部分"是如何都使用 WebDriver 协议的——Node.js 部分直接连接到 Appium 的 WebDriver 服务器,而 Objective-C 部分(WebDriverAgent)本身就是一个 WebDriver 实现。
|
||||
|
||||
这为 Appium 在某些情况下走捷径开辟了可能性。
|
||||
让我们想象一下 XCUITest 驱动程序需要实现 `Click Element` 命令。 这个实现的内部代码看起来就像是获取适当的参数并构造一个到 WebDriverAgent 服务器的 HTTP 请求。 在这种情况下,我们基本上只是在重建客户端对 Appium 服务器的原始调用![^4] 所以实际上没有必要编写一个函数来实现 `Click Element` 命令。 相反,XCUITest 驱动程序可以让 Appium 知道这个命令应该直接代理到其他 WebDriver 服务器。
|
||||
让我们想象一下 XCUITest 驱动程序需要实现 `Click Element` 命令。这个实现的内部代码看起来就像是获取适当的参数并构造一个到 WebDriverAgent 服务器的 HTTP 请求。在这种情况下,我们基本上只是在重建客户端对 Appium 服务器的原始调用![^4] 所以实际上没有必要编写一个函数来实现 `Click Element` 命令。相反,XCUITest 驱动程序可以让 Appium 知道这个命令应该直接代理到其他 WebDriver 服务器。
|
||||
|
||||
[^4]: 这不是_完全_相同的调用,因为 Appium 服务器和 WebDriverAgent 服务器会生成不同的会话 ID,但这些差异会被透明地处理。
|
||||
|
||||
如果你不熟悉"代理"的概念,在这种情况下,它只是意味着 XCUITest 驱动程序根本不会参与处理该命令。 相反,它只会在协议级别被重新打包并转发到 WebDriverAgent,WebDriverAgent 的响应同样会直接传回客户端,而不会有任何 XCUITest 驱动程序代码看到或修改它。
|
||||
如果你不熟悉"代理"的概念,在这种情况下,它只是意味着 XCUITest 驱动程序根本不会参与处理该命令。相反,它只会在协议级别被重新打包并转发到 WebDriverAgent,WebDriverAgent 的响应同样会直接传回客户端,而不会有任何 XCUITest 驱动程序代码看到或修改它。
|
||||
|
||||
这种架构模式为选择在各处使用 WebDriver 协议而不是构建定制协议的驱动程序作者提供了一个很好的额外好处。这也意味着 Appium 可以非常轻松地为任何其他现有的 WebDriver 实现创建包装驱动程序。 If
|
||||
you look at the [Appium Safari driver](https://appium.github.io/appium-safari-driver/) code, for
|
||||
example, you'll see that it implements basically no standard commands, because all of these are
|
||||
proxied directly to an underlying SafariDriver process.
|
||||
|
||||
了解这种代理机制有时在幕后发生是很重要的,因为如果你曾经深入研究一些开源驱动程序代码试图找出命令的实现位置,你可能会惊讶地发现 Node.js 驱动程序代码本身根本没有任何实现! 在这种情况下,你需要找出命令被代理到哪里,以便你可以在那里查找相应的实现。
|
||||
了解这种代理机制有时在幕后发生是很重要的,因为如果你曾经深入研究一些开源驱动程序代码试图找出命令的实现位置,你可能会惊讶地发现 Node.js 驱动程序代码本身根本没有任何实现!在这种情况下,你需要找出命令被代理到哪里,以便你可以在那里查找相应的实现。
|
||||
|
||||
好了,对于这个非常详细的驱动程序介绍来说,这就足够了!
|
||||
|
||||
@@ -2,71 +2,70 @@
|
||||
title: Appium 项目历史
|
||||
---
|
||||
|
||||
Appium 自 2012 年以来以某种形式存在。 它由不同的个人和组织指导,甚至用 3 种不同的编程语言实现过! 欢迎了解关于 Appium 如何发展到今天这个样子的更多信息……
|
||||
Appium 自 2012 年以来以某种形式存在。它由不同的个人和组织指导,甚至用 3 种不同的编程语言实现过!欢迎了解关于 Appium 如何发展到今天这个样子的更多信息……
|
||||
|
||||
## 早期灵感
|
||||
|
||||
[Dan Cuellar](https://twitter.com/thedancuellar) 在 2011 年担任 Zoosk 的测试经理时遇到了一个问题。 iOS 产品的测试通过时间变得越来越长,难以控制。 减少测试是一个选择,但会带来额外的风险,特别是在通过 iOS App Store 审核流程获得补丁需要几天时间的情况下。 他回想起自己在网站上工作的日子,意识到自动化是答案。
|
||||
[Dan Cuellar](https://twitter.com/thedancuellar) 在 2011 年担任 Zoosk 的测试经理时遇到了一个问题。 iOS 产品的测试通过时间变得越来越长,难以控制。减少测试是一个选择,但会带来额外的风险,特别是在通过 iOS App Store 审核流程获得补丁需要几天时间的情况下。他回想起自己在网站上工作的日子,意识到自动化是答案。
|
||||
|
||||
Dan 调查了现有的工具格局,却发现它们都有重大缺陷。 Apple 提供的工具 UIAutomation 要求测试必须用 JavaScript 编写,并且不允许实时调试或解释。 它还必须在 Xcode 的性能分析工具 Instruments 中执行。 其他第三方工具使用私有 API,并要求将 SDK 和 HTTP 服务器嵌入到应用程序中。 这看起来非常不可取。
|
||||
Dan 调查了现有的工具格局,却发现它们都有重大缺陷。 Apple 提供的工具 UIAutomation 要求测试必须用 JavaScript 编写,并且不允许实时调试或解释。它还必须在 Xcode 的性能分析工具 Instruments 中执行。其他第三方工具使用私有 API,并要求将 SDK 和 HTTP 服务器嵌入到应用程序中。这看起来非常不可取。
|
||||
|
||||
对现有选项不满意,Dan 向他的经理要求一些额外的时间,看看他能否找到更好的方法。 他花了 2 周时间探索和试验,看看是否有办法使用 Apple 批准的技术来自动化 iOS 应用程序。 他尝试的第一个实现使用 AppleScript 通过 OS X 辅助功能 API 向 Mac UI 元素发送消息。 这在一定程度上有效,但永远无法在真实设备上工作,更不用说其他缺点了。
|
||||
对现有选项不满意,Dan 向他的经理要求一些额外的时间,看看他能否找到更好的方法。他花了 2 周时间探索和试验,看看是否有办法使用 Apple 批准的技术来自动化 iOS 应用程序。他尝试的第一个实现使用 AppleScript 通过 OS X 辅助功能 API 向 Mac UI 元素发送消息。这在一定程度上有效,但永远无法在真实设备上工作,更不用说其他缺点了。
|
||||
|
||||
所以他想,如果我能让 UIAutomation 框架像解释器一样实时运行会怎样? 他研究了一下,确定他所需要做的就是找到一种方法在 UIAutomation JavaScript 程序中接收、执行和回复命令。 使用 Apple 提供的用于执行 shell 命令的实用程序,他能够 `cat` 顺序排列的文本文件来接收命令,`eval()` 输出以执行它们,并用 `python` 将它们写回磁盘。 然后他用 C# 准备了实现 Selenium 样式语法的代码来编写顺序排列的 JavaScript 命令。
|
||||
所以他想,如果我能让 UIAutomation 框架像解释器一样实时运行会怎样?他研究了一下,确定他所需要做的就是找到一种方法在 UIAutomation JavaScript 程序中接收、执行和回复命令。使用 Apple 提供的用于执行 shell 命令的实用程序,他能够 `cat` 顺序排列的文本文件来接收命令,`eval()` 输出以执行它们,并用 `python` 将它们写回磁盘。然后他用 C# 准备了实现 Selenium 样式语法的代码来编写顺序排列的 JavaScript 命令。
|
||||
iOSAuto 诞生了。
|
||||
|
||||
## 2012 年 Selenium 大会
|
||||
|
||||
Dan 被选中在 2012 年伦敦 Selenium 大会上就一个完全不同的主题发表演讲。 作为他演讲的一部分,他展示了使用 Selenium 语法的 iOS 自动化,以演示编写平台无关的测试,这些测试使用具有通用接口的独立平台特定页面对象。 令他惊讶的是,酷炫的测试架构让 iOS 测试像 WebDriver 测试一样运行。 有几个人建议他稍后在会议上做一个闪电演讲来解释它是如何工作的。
|
||||
Dan 被选中在 2012 年伦敦 Selenium 大会上就一个完全不同的主题发表演讲。作为他演讲的一部分,他展示了使用 Selenium 语法的 iOS 自动化,以演示编写平台无关的测试,这些测试使用具有通用接口的独立平台特定页面对象。令他惊讶的是,酷炫的测试架构让 iOS 测试像 WebDriver 测试一样运行。有几个人建议他稍后在会议上做一个闪电演讲来解释它是如何工作的。
|
||||
|
||||
在会议的第二天,Dan 走上舞台做闪电演讲。 Jason Huggins,Selenium 的共同创建者,主持了闪电演讲。 Dan 在加载演示文稿时遇到了技术困难,Jason 几乎不得不继续下一个闪电演讲。 在最后一刻,屏幕亮了,Dan 开始了他的演讲。 他解释了他的实现细节和工作原理,恳求贡献者,五分钟后就结束了。 观众礼貌地鼓掌,他离开了舞台。
|
||||
在会议的第二天,Dan 走上舞台做闪电演讲。 Jason Huggins,Selenium 的共同创建者,主持了闪电演讲。 Dan 在加载演示文稿时遇到了技术困难,Jason 几乎不得不继续下一个闪电演讲。在最后一刻,屏幕亮了,Dan 开始了他的演讲。他解释了他的实现细节和工作原理,恳求贡献者,五分钟后就结束了。观众礼貌地鼓掌,他离开了舞台。
|
||||
|
||||
## 电话响起
|
||||
|
||||
Selenium 大会四个月后,Jason 打电话给 Dan。 Jason 一直在 Sauce Labs 为客户开发 iOS 测试支持。 Jason 记得 Dan 的闪电演讲,认为这个项目可能对 Jason 的工作有用,但 Dan 的源代码没有公开。 Jason 要求 Dan 见面。 那周晚些时候,Dan 在旧金山的一家酒吧见到了 Jason,并向他展示了 iOS Auto 的源代码。
|
||||
Selenium 大会四个月后,Jason 打电话给 Dan。 Jason 一直在 Sauce Labs 为客户开发 iOS 测试支持。 Jason 记得 Dan 的闪电演讲,认为这个项目可能对 Jason 的工作有用,但 Dan 的源代码没有公开。 Jason 要求 Dan 见面。那周晚些时候,Dan 在旧金山的一家酒吧见到了 Jason,并向他展示了 iOS Auto 的源代码。
|
||||
|
||||
作为一个长期的开源倡导者,Jason 鼓励 Dan 在开源许可下发布他的代码。 8 月,Dan 在 GitHub 上发布了 [C# 的源代码](https://github.com/penguinho/appium-old/commit/3ab56d3a5601897b2790b5256351f9b5af3f9e90)。 Jason 鼓励 Dan 更改语言以使项目对潜在贡献者更具吸引力。 Dan 上传了 [Python 的新版本]](https://github.com/penguinho/appium-old/commit/9b891207be0957bf209a77242750da17d3eb8eda)。
|
||||
9 月,Jason 添加了一个 Web 服务器并开始通过 HTTP 实现 [WebDriver 协议](https://github.com/hugs/appium-old/commit/ae8fe4578640d9af9137d0546190fa29317d1499),使 iOS Auto 可以从任何语言的任何 Selenium WebDriver 客户端库编写脚本。
|
||||
|
||||
## 移动测试峰会
|
||||
|
||||
Jason 决定该项目应该在 11 月的[移动测试峰会](https://twitter.com/mobtestsummit)上展示,但建议项目首先改个新名字。 人们提出了许多想法,他们最终选定了 AppleCart。 一天后,当 Jason 浏览 Apple 关于版权和商标的一些指导时,他注意到在 Apple 会保护其商标的名称示例部分下,第一个例子是"AppleCart"。 他打电话给 Dan 并告知了情况,他们集思广益了一会儿,然后 Jason 中了大奖。 Appium…… 应用程序的 Selenium。
|
||||
Jason 决定该项目应该在 11 月的[移动测试峰会](https://twitter.com/mobtestsummit)上展示,但建议项目首先改个新名字。人们提出了许多想法,他们最终选定了 AppleCart。一天后,当 Jason 浏览 Apple 关于版权和商标的一些指导时,他注意到在 Apple 会保护其商标的名称示例部分下,第一个例子是"AppleCart"。他打电话给 Dan 并告知了情况,他们集思广益了一会儿,然后 Jason 中了大奖。 Appium……应用程序的 Selenium。
|
||||
|
||||
## Sauce Labs 和 Node.js
|
||||
|
||||
2013 年 1 月,也就是移动测试峰会后不久,Sauce Labs 决定全力支持 Appium 并提供更多开发人员力量。 创建了一个工作组来评估当前状态以及如何最好地推进该项目。
|
||||
该团队包括 Jonathan Lipps(现任项目负责人),他们决定 Appium 需要重生,并最终选择 Node.js 作为使用的框架。 Node 以快速高效的 Web 服务器后端而闻名,而归根结底,Appium 只是一个高度专业化的 Web 服务器。 还决定将 JavaScript 作为一种语言足够易于访问,使得 Appium 能够发展成为一个比其他选项更大的开源开发者社区。
|
||||
2013 年 1 月,也就是移动测试峰会后不久,Sauce Labs 决定全力支持 Appium 并提供更多开发人员力量。创建了一个工作组来评估当前状态以及如何最好地推进该项目。该团队包括 Jonathan Lipps(现任项目负责人),他们决定 Appium 需要重生,并最终选择 Node.js 作为使用的框架。 Node 以快速高效的 Web 服务器后端而闻名,而归根结底,Appium 只是一个高度专业化的 Web 服务器。还决定将 JavaScript 作为一种语言足够易于访问,使得 Appium 能够发展成为一个比其他选项更大的开源开发者社区。
|
||||
|
||||
仅仅几天之内,团队就利用 Appium 的现有工作,创建了一个与之前 Python 版本功能相当的新版本 Appium。 为 Appium 的基本架构奠定了基础,从那时起我们一直在成功地构建它。 在这次冲刺开始几周后,Jonathan Lipps 被正式指定为项目负责人,他开始制定战略,如何让更多来自社区的人参与 Appium 的开发。
|
||||
仅仅几天之内,团队就利用 Appium 的现有工作,创建了一个与之前 Python 版本功能相当的新版本 Appium。为 Appium 的基本架构奠定了基础,从那时起我们一直在成功地构建它。在这次冲刺开始几周后,Jonathan Lipps 被正式指定为项目负责人,他开始制定战略,如何让更多来自社区的人参与 Appium 的开发。
|
||||
|
||||
## Appium 走向世界
|
||||
|
||||
最终,Jonathan 决定在会议和聚会上让尽可能多的开发者了解 Appium 是吸引用户和贡献的最佳方式。
|
||||
Appium 的新版本在 [2013 年谷歌测试自动化大会](https://www.youtube.com/watch?v=1J0aXDbjiUE)上首次亮相。 2013 年晚些时候,Appium 在美国各地以及英国、波兰、葡萄牙和澳大利亚的会议和聚会上展示。 值得注意的是,Jonathan 让 Appium [作为乐队中的乐器表演](https://www.youtube.com/watch?v=zsbNVkayYRQ),Dan Cuellar 为 Selenium 大会制作了一个有趣的 [Appium 视频集锦](https://www.youtube.com/watch?v=xkzrEn0v0II)。
|
||||
Appium 的新版本在 [2013 年谷歌测试自动化大会](https://www.youtube.com/watch?v=1J0aXDbjiUE)上首次亮相。 2013 年晚些时候,Appium 在美国各地以及英国、波兰、葡萄牙和澳大利亚的会议和聚会上展示。值得注意的是,Jonathan 让 Appium [作为乐队中的乐器表演](https://www.youtube.com/watch?v=zsbNVkayYRQ),Dan Cuellar 为 Selenium 大会制作了一个有趣的 [Appium 视频集锦](https://www.youtube.com/watch?v=xkzrEn0v0II)。
|
||||
|
||||
在所有这些演讲和会议期间,项目继续发展。 2013 年初,我们发布了 Android 和 Selendroid 支持,使 Appium 成为第一个真正的跨平台自动化框架。 该项目还继续吸引用户和贡献者,到 2013 年底,我们已经有超过 1,000 次提交。
|
||||
在所有这些演讲和会议期间,项目继续发展。 2013 年初,我们发布了 Android 和 Selendroid 支持,使 Appium 成为第一个真正的跨平台自动化框架。该项目还继续吸引用户和贡献者,到 2013 年底,我们已经有超过 1,000 次提交。
|
||||
|
||||
## 通往 Appium 1.0 之路
|
||||
|
||||
Appium 开始显著增长和成熟。 2014 年 5 月,我们发布了 Appium 1.0,这是 Appium 发展的一个里程碑。
|
||||
Appium 获得了[各种](https://www.prnewswire.com/news-releases/black-duck-announces-black-duck-open-source-rookies-of-the-year-winners-242383341.html)[奖项](https://www.infoworld.com/article/2241247/164642-bossie-awards-2014-the-best-open-source-application-development-tools.html),并成为最受欢迎的开源跨平台移动自动化框架。 稳定性得到改善,错误得到优先处理和修复,功能得到添加。 Sauce Labs 增加了捐赠给 Appium 工作的开发者数量,但整个社区继续参与指导项目并为其做出贡献,项目治理继续在公开的邮件列表和 GitHub 的问题跟踪器上进行。
|
||||
Appium 获得了[各种](https://www.prnewswire.com/news-releases/black-duck-announces-black-duck-open-source-rookies-of-the-year-winners-242383341.html)[奖项](https://www.infoworld.com/article/2241247/164642-bossie-awards-2014-the-best-open-source-application-development-tools.html),并成为最受欢迎的开源跨平台移动自动化框架。稳定性得到改善,错误得到优先处理和修复,功能得到添加。 Sauce Labs 增加了捐赠给 Appium 工作的开发者数量,但整个社区继续参与指导项目并为其做出贡献,项目治理继续在公开的邮件列表和 GitHub 的问题跟踪器上进行。
|
||||
|
||||
## Appium 扩大
|
||||
|
||||
最终,很明显 Appium 代码库没有针对大型分布式团队的兼职贡献者进行优化。 作为提交者团队,我们借此机会从头开始重写 Appium,使用更现代的 JavaScript 语言版本,并重做 Appium 的架构,使用户或第三方开发者可以轻松构建自己的 Appium"驱动程序"。 我们希望新贡献者更容易熟悉 Appium 代码库,并看到核心团队以外的团队为 Appium 添加对新平台的支持。 这一愿景已经开始实现,微软和 Youi.tv 等团体分别为 Windows 桌面应用程序自动化和 Youi.tv 应用程序自动化向 Appium 添加了驱动程序。
|
||||
最终,很明显 Appium 代码库没有针对大型分布式团队的兼职贡献者进行优化。作为提交者团队,我们借此机会从头开始重写 Appium,使用更现代的 JavaScript 语言版本,并重做 Appium 的架构,使用户或第三方开发者可以轻松构建自己的 Appium"驱动程序"。我们希望新贡献者更容易熟悉 Appium 代码库,并看到核心团队以外的团队为 Appium 添加对新平台的支持。这一愿景已经开始实现,微软和 Youi.tv 等团体分别为 Windows 桌面应用程序自动化和 Youi.tv 应用程序自动化向 Appium 添加了驱动程序。
|
||||
|
||||
## Appium 献给人民
|
||||
|
||||
2016 年底,Sauce Labs 将 Appium 作为一个项目捐赠给 [JS 基金会](https://js.foundation),以便向世界证明 Sauce 承诺 Appium 保持开源。 JS 基金会是一个非营利性开源管理组织,负责持有开源项目的版权,并确保它们在社区中拥有长久和成功的任期。 由于我们转移到非营利基金会,我们希望新贡献者的大门会更加敞开,无论是作为个人还是代表现在对 Appium 前进有兴趣的众多公司之一。
|
||||
2016 年底,Sauce Labs 将 Appium 作为一个项目捐赠给 [JS 基金会](https://js.foundation),以便向世界证明 Sauce 承诺 Appium 保持开源。 JS 基金会是一个非营利性开源管理组织,负责持有开源项目的版权,并确保它们在社区中拥有长久和成功的任期。由于我们转移到非营利基金会,我们希望新贡献者的大门会更加敞开,无论是作为个人还是代表现在对 Appium 前进有兴趣的众多公司之一。
|
||||
|
||||
最终,JS 基金会并入了 [OpenJS 基金会](https://openjsf.org),Appium 成为该基金会的影响力项目。
|
||||
|
||||
## Appium 2.0
|
||||
|
||||
Appium 2 于 2023 年发布,引入了一个全新的架构,将重点从一体化项目转移到作为生态系统的 Appium。 这为任何人开发和共享自己的 Appium 扩展(驱动程序和插件)开辟了可能性,为远超 iOS 和 Android 的平台的自动化相关开发打开了一个充满可能性的世界! 因此,创建了许多第三方扩展,例如用于 Flutter 和 Windows 的新驱动程序、用于模拟 API 和管理设备农场的插件、基于 Rust 和 Swift 的新 Appium 客户端等等。
|
||||
Appium 2 于 2023 年发布,引入了一个全新的架构,将重点从一体化项目转移到作为生态系统的 Appium。这为任何人开发和共享自己的 Appium 扩展(驱动程序和插件)开辟了可能性,为远超 iOS 和 Android 的平台的自动化相关开发打开了一个充满可能性的世界!因此,创建了许多第三方扩展,例如用于 Flutter 和 Windows 的新驱动程序、用于模拟 API 和管理设备农场的插件、基于 Rust 和 Swift 的新 Appium 客户端等等。
|
||||
|
||||
大约在这个时候,我们还启动了 Appium 的赞助计划,吸引了各种大小赞助商。 这使我们能够回馈 Appium 社区,为贡献者在项目上的志愿工作提供补偿。
|
||||
大约在这个时候,我们还启动了 Appium 的赞助计划,吸引了各种大小赞助商。这使我们能够回馈 Appium 社区,为贡献者在项目上的志愿工作提供补偿。
|
||||
|
||||
## Appium 3.0
|
||||
|
||||
2025 年看到了 Appium 3 的发布。 这次更新比 Appium 2 小得多,只包括一些行为变化,而是专注于删除已弃用的代码并更新对更现代生态系统的兼容性。 尽管如此,这种缩小的范围也是意料之中的:自 Appium 2 以来,主要功能开发工作已转移到各个驱动程序和插件,其中许多在 Appium 2 时代经历了多次重大更新。
|
||||
2025 年看到了 Appium 3 的发布。这次更新比 Appium 2 小得多,只包括一些行为变化,而是专注于删除已弃用的代码并更新对更现代生态系统的兼容性。尽管如此,这种缩小的范围也是意料之中的:自 Appium 2 以来,主要功能开发工作已转移到各个驱动程序和插件,其中许多在 Appium 2 时代经历了多次重大更新。
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: Appium 概览
|
||||
---
|
||||
|
||||
如主页所述,Appium 旨在支持_多个不同平台_(移动端、Web、桌面等)的 UI 自动化。 不仅如此,它还旨在支持用_不同语言_(JS、Java、Python 等)编写的自动化代码。 将所有这些功能整合到一个程序中是一项非常艰巨的任务,甚至可以说是不可能完成的任务!
|
||||
如主页所述,Appium 旨在支持_多个不同平台_(移动端、Web、桌面等)的 UI 自动化。不仅如此,它还旨在支持用_不同语言_(JS、Java、Python 等)编写的自动化代码。将所有这些功能整合到一个程序中是一项非常艰巨的任务,甚至可以说是不可能完成的任务!
|
||||
|
||||
为了实现这一目标,Appium 实际上被分为四个部分:
|
||||
|
||||
@@ -25,7 +25,7 @@ title: Appium 概览
|
||||
- 为你的目标编程语言安装客户端库
|
||||
- (可选)安装一个或多个插件
|
||||
|
||||
这些就是基础知识! 如果你已经准备好开始,请继续阅读[快速入门](../quickstart/index.md)!
|
||||
这些就是基础知识!如果你已经准备好开始,请继续阅读[快速入门](../quickstart/index.md)!
|
||||
|
||||
如果你想了解更多关于其工作原理的详细信息,请参阅以下页面的背景材料:
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: 入门指南
|
||||
---
|
||||
|
||||
让我们开始使用Appium! 为了成功使用此快速入门,建议您首先阅读[介绍](../intro/index.md),以便了解运行Appium和编写Appium脚本的概念。
|
||||
让我们开始使用Appium!为了成功使用此快速入门,建议您首先阅读[介绍](../intro/index.md),以便了解运行Appium和编写Appium脚本的概念。
|
||||
|
||||
此快速入门的基本计划如下:
|
||||
|
||||
@@ -18,6 +18,6 @@ title: 入门指南
|
||||
|
||||
### 系统需求
|
||||
|
||||
在开始之前,请确保您的系统满足运行Appium服务器的[要求](../quickstart/requirements.md)。 其他要求将在安装UiAutomator2驱动程序时讨论。 本指南还假设您在平台上具有基本的命令行熟练度,例如能够运行命令、设置和持久化环境变量等...
|
||||
在开始之前,请确保您的系统满足运行Appium服务器的[要求](../quickstart/requirements.md)。其他要求将在安装UiAutomator2驱动程序时讨论。本指南还假设您在平台上具有基本的命令行熟练度,例如能够运行命令、设置和持久化环境变量等...
|
||||
|
||||
现在您准备开始了! 前往安装[Appium](./install.md)。
|
||||
现在您准备开始了!前往安装[Appium](./install.md)。
|
||||
|
||||
@@ -31,8 +31,7 @@ Appium 可以使用 [命令行](../reference/cli/index.md) 启动:
|
||||
appium
|
||||
```
|
||||
|
||||
这会启动Appium服务器进程,该进程加载所有已安装的Appium驱动程序,并开始等待来自客户端连接(如测试自动化脚本)的新会话请求。
|
||||
由于服务器进程独立于其客户端,因此必须在尝试启动新会话之前明确启动它。
|
||||
这会启动Appium服务器进程,该进程加载所有已安装的Appium驱动程序,并开始等待来自客户端连接(如测试自动化脚本)的新会话请求。由于服务器进程独立于其客户端,因此必须在尝试启动新会话之前明确启动它。
|
||||
|
||||
当服务器启动时,控制台日志将列出客户端可以用来连接到此服务器的所有有效URL:
|
||||
|
||||
@@ -42,6 +41,6 @@ appium
|
||||
(... any other URLs ...)
|
||||
```
|
||||
|
||||
一旦客户端请求新会话,Appium服务器进程将开始记录此会话的所有详细信息,直到其终止。 请记住这一点——如果您遇到Appium测试的问题,您可以随时检查服务器日志以获取更多详细信息。
|
||||
一旦客户端请求新会话,Appium服务器进程将开始记录此会话的所有详细信息,直到其终止。请记住这一点——如果您遇到Appium测试的问题,您可以随时检查服务器日志以获取更多详细信息。
|
||||
|
||||
接下来是什么? 即使Appium已安装并运行,它也不捆绑任何驱动程序,这意味着它还不能自动化任何东西。 因此,我们将为Android设置自动化——继续[安装UiAutomator2驱动程序](./uiauto2-driver.md)。
|
||||
接下来是什么?即使Appium已安装并运行,它也不捆绑任何驱动程序,这意味着它还不能自动化任何东西。因此,我们将为Android设置自动化——继续[安装UiAutomator2驱动程序](./uiauto2-driver.md)。
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: 下一步
|
||||
---
|
||||
|
||||
现在您已成功为Android自动化设置了系统并运行了一个简单的测试,您将希望继续探索此文档。 特别是,这些是适合初学者的优秀指南和参考资料: 特别是,这些是适合初学者的优秀指南和参考资料:
|
||||
现在您已成功为Android自动化设置了系统并运行了一个简单的测试,您将希望继续探索此文档。 特别是,这些是适合初学者的优秀指南和参考资料:特别是,这些是适合初学者的优秀指南和参考资料:
|
||||
|
||||
- [生态系统](../ecosystem/index.md) 页面:浏览可用的驱动程序、客户端、插件和工具
|
||||
- [管理Appium驱动程序和插件](../guides/managing-exts.md)
|
||||
|
||||
@@ -12,10 +12,10 @@ Appium 服务器的基本要求如下:
|
||||
- 推荐使用 LTS 版本
|
||||
- [`npm`](https://npmjs.com) 版本 `>=10`(`npm` 通常与 Node.js 捆绑,但可以独立升级)
|
||||
|
||||
Appium 本身相对轻量,没有显著的磁盘空间或 RAM 要求。 即使在资源受限的环境如 Raspberry Pi 中,只要有 Node.js 就可以运行。
|
||||
Appium 本身相对轻量,没有显著的磁盘空间或 RAM 要求。即使在资源受限的环境如 Raspberry Pi 中,只要有 Node.js 就可以运行。
|
||||
|
||||
### 驱动程序要求
|
||||
|
||||
用于自动化特定平台的驱动程序可能有其他要求。 请参考该平台的 [Appium 驱动程序](../ecosystem/drivers.md) 文档以获取其他依赖项。 普遍的情况是,给定平台的 Appium 驱动程序需要安装该平台的开发者工具链和 SDK。
|
||||
用于自动化特定平台的驱动程序可能有其他要求。请参考该平台的 [Appium 驱动程序](../ecosystem/drivers.md) 文档以获取其他依赖项。普遍的情况是,给定平台的 Appium 驱动程序需要安装该平台的开发者工具链和 SDK。
|
||||
|
||||
为了帮助处理驱动程序要求,每个(官方)驱动程序都附带 Appium Doctor 工具,它允许验证是否已设置所有要求。 了解如何使用此工具的更多信息,请参阅 [命令行使用文档](../reference/cli/extensions.md#doctor)。
|
||||
为了帮助处理驱动程序要求,每个(官方)驱动程序都附带 Appium Doctor 工具,它允许验证是否已设置所有要求。了解如何使用此工具的更多信息,请参阅 [命令行使用文档](../reference/cli/extensions.md#doctor)。
|
||||
|
||||
@@ -6,9 +6,9 @@ title: 编写测试 (.NET)
|
||||
---
|
||||
|
||||
[Appium .NET Client](https://github.com/appium/dotnet-client/) 是
|
||||
官方的 Appium C# 客户端。 这个驱动程序是 Selenium C# 客户端的扩展。 它具有常规驱动程序的所有功能,但在之上添加了 Appium 特定的方法。 该驱动程序在公共 NuGet Gallery 上作为 [Appium.WebDriver](https://www.nuget.org/packages/Appium.WebDriver/) 提供。
|
||||
官方的 Appium C# 客户端。这个驱动程序是 Selenium C# 客户端的扩展。它具有常规驱动程序的所有功能,但在之上添加了 Appium 特定的方法。该驱动程序在公共 NuGet Gallery 上作为 [Appium.WebDriver](https://www.nuget.org/packages/Appium.WebDriver/) 提供。
|
||||
|
||||
现在,我们进入目录并创建一个新的 [NUnit](https://nunit.org/) 项目。 我们还将添加对 Appium.Net 驱动程序和其他依赖项的引用。
|
||||
现在,我们进入目录并创建一个新的 [NUnit](https://nunit.org/) 项目。我们还将添加对 Appium.Net 驱动程序和其他依赖项的引用。
|
||||
|
||||
```bash
|
||||
cd dotnet-client
|
||||
@@ -21,7 +21,7 @@ dotnet add package Appium.WebDriver --prerelease
|
||||
dotnet add package Newtonsoft.Json --version 13.0.3
|
||||
```
|
||||
|
||||
完成后,您的项目应该有一个占位符文件 `UnitTest1.cs`。 我们将替换代码以包含 OpenQA 命名空间、驱动程序的初始化以及实际测试。
|
||||
完成后,您的项目应该有一个占位符文件 `UnitTest1.cs`。我们将替换代码以包含 OpenQA 命名空间、驱动程序的初始化以及实际测试。
|
||||
|
||||
```C# title="UnitTest1.cs"
|
||||
using OpenQA.Selenium;
|
||||
@@ -77,12 +77,12 @@ public class Tests
|
||||
|
||||
基本上,此代码执行以下操作:
|
||||
|
||||
1. 定义一组"Capabilities"(参数)发送到 Appium 服务器,以便 Appium 知道您想要自动化什么。 有些参数可以使用环境变量覆盖。
|
||||
1. 定义一组"Capabilities"(参数)发送到 Appium 服务器,以便 Appium 知道您想要自动化什么。有些参数可以使用环境变量覆盖。
|
||||
2. 在内置的 Android 设置应用上启动 Appium 会话。
|
||||
3. 查找"Apps"列表项并点击它。
|
||||
4. 结束 Appium 会话。
|
||||
|
||||
就是这样! 让我们试试。 在运行测试之前,请确保在另一个终端会话中运行 Appium 服务器,否则您会收到无法连接的错误。 然后,您可以执行脚本:
|
||||
就是这样!让我们试试。在运行测试之前,请确保在另一个终端会话中运行 Appium 服务器,否则您会收到无法连接的错误。然后,您可以执行脚本:
|
||||
|
||||
```bash
|
||||
dotnet test
|
||||
@@ -96,4 +96,4 @@ dotnet test
|
||||
|
||||
如果一切顺利,您将看到设置应用打开并在模拟器中导航到"Apps"视图,然后应用再次关闭。
|
||||
|
||||
恭喜,您已经开始了 Appium 之旅! 继续阅读一些 [后续步骤](./next-steps.md) 以进行探索。
|
||||
恭喜,您已经开始了 Appium 之旅!继续阅读一些 [后续步骤](./next-steps.md) 以进行探索。
|
||||
|
||||
@@ -5,14 +5,12 @@ hide:
|
||||
title: 编写测试 (Java)
|
||||
---
|
||||
|
||||
Appium 团队维护了一个官方的 [客户端](https://github.com/appium/java-client) 用于 Java 编程语言。
|
||||
它建立在 [Selenium](https://github.com/SeleniumHQ/selenium) 之上。
|
||||
您也可以在 Kotlin 项目中使用此客户端。
|
||||
Appium 团队维护了一个官方的 [客户端](https://github.com/appium/java-client) 用于 Java 编程语言。它建立在 [Selenium](https://github.com/SeleniumHQ/selenium) 之上。您也可以在 Kotlin 项目中使用此客户端。
|
||||
|
||||
按照 [将 Appium Java 客户端添加到您的测试框架](https://github.com/appium/java-client#add-appium-java-client-to-your-test-framework) 教程将库连接到您的测试框架源代码。
|
||||
|
||||
Appium Java 客户端具有专用类来支持大多数官方 Appium 驱动程序。 对于其他驱动程序,您可以简单地使用 [AppiumDriver](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/AppiumDriver.java) 类
|
||||
或从中构建自定义派生类。 查看 [驱动程序支持](https://github.com/appium/java-client#drivers-support) 文章以了解当前驱动程序类实现的更多信息。
|
||||
Appium Java 客户端具有专用类来支持大多数官方 Appium 驱动程序。对于其他驱动程序,您可以简单地使用 [AppiumDriver](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/AppiumDriver.java) 类
|
||||
或从中构建自定义派生类。查看 [驱动程序支持](https://github.com/appium/java-client#drivers-support) 文章以了解当前驱动程序类实现的更多信息。
|
||||
|
||||
按照 [使用示例](https://github.com/appium/java-client#usage-examples) 文章以了解
|
||||
如何从您的测试框架调用 Java 客户端功能。
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: 编写测试 (JS)
|
||||
---
|
||||
|
||||
要在 JavaScript (Node.js) 中编写 Appium 测试,我们需要选择一个与 Appium 兼容的客户端库。 维护最好的库,也是 Appium 团队推荐使用的,是 [WebdriverIO](https://webdriver.io),所以让我们使用它。 由于我们已经安装了 Appium,我们知道我们的 Node 和 NPM 已经满足要求。 所以在您的计算机上某个地方创建一个新的项目目录,然后在其中初始化一个新的 Node.js 项目:
|
||||
要在 JavaScript (Node.js) 中编写 Appium 测试,我们需要选择一个与 Appium 兼容的客户端库。维护最好的库,也是 Appium 团队推荐使用的,是 [WebdriverIO](https://webdriver.io),所以让我们使用它。由于我们已经安装了 Appium,我们知道我们的 Node 和 NPM 已经满足要求。所以在您的计算机上某个地方创建一个新的项目目录,然后在其中初始化一个新的 Node.js 项目:
|
||||
|
||||
```bash
|
||||
npm init
|
||||
@@ -25,7 +25,7 @@ npm i --save-dev webdriverio
|
||||
--8<-- "./sample-code/quickstarts/js/package.json"
|
||||
```
|
||||
|
||||
现在是编写测试本身的时候了。 创建一个名为 `test.js` 的新文件,内容如下:
|
||||
现在是编写测试本身的时候了。创建一个名为 `test.js` 的新文件,内容如下:
|
||||
|
||||
```js title="test.js"
|
||||
--8<-- "./sample-code/quickstarts/js/test.js"
|
||||
@@ -51,7 +51,7 @@ npm i --save-dev webdriverio
|
||||
4. 暂停片刻纯粹为了视觉效果。
|
||||
5. 结束 Appium 会话。
|
||||
|
||||
就是这样! 让我们试试。 在运行测试之前,请确保在另一个终端会话中运行 Appium 服务器,否则您会收到无法连接的错误。 然后,您可以执行脚本:
|
||||
就是这样!让我们试试。在运行测试之前,请确保在另一个终端会话中运行 Appium 服务器,否则您会收到无法连接的错误。然后,您可以执行脚本:
|
||||
|
||||
```bash
|
||||
node test.js
|
||||
@@ -59,4 +59,4 @@ node test.js
|
||||
|
||||
如果一切顺利,您将看到设置应用打开并导航到"Apps"视图,然后应用再次关闭。
|
||||
|
||||
恭喜,您已经开始了 Appium 之旅! 继续阅读一些 [后续步骤](./next-steps.md) 以进行探索。
|
||||
恭喜,您已经开始了 Appium 之旅!继续阅读一些 [后续步骤](./next-steps.md) 以进行探索。
|
||||
|
||||
@@ -6,8 +6,7 @@ title: 编写测试 (Python)
|
||||
---
|
||||
|
||||
[Appium Python Client](https://github.com/appium/python-client) 是
|
||||
官方的 Python Appium 客户端,可通过 pypi 以 [Appium-Python-Client](https://pypi.org/project/Appium-Python-Client/) 包名获取。
|
||||
它继承自 [Selenium Python Binding](https://pypi.org/project/selenium/),
|
||||
官方的 Python Appium 客户端,可通过 pypi 以 [Appium-Python-Client](https://pypi.org/project/Appium-Python-Client/) 包名获取。它继承自 [Selenium Python Binding](https://pypi.org/project/selenium/),
|
||||
因此安装 Appium Python Client 包括 selenium 绑定。
|
||||
|
||||
```bash
|
||||
@@ -15,8 +14,7 @@ pip install Appium-Python-Client
|
||||
```
|
||||
|
||||
此示例使用 Python 的内置 `unittest` 模块,您也可以使用任何您想要的 Python 测试框架。
|
||||
Appium Python 客户端自动添加 `appium:` 前缀。
|
||||
您通常不需要担心前缀。
|
||||
Appium Python 客户端自动添加 `appium:` 前缀。您通常不需要担心前缀。
|
||||
|
||||
```python title="test.py"
|
||||
--8<-- "./sample-code/quickstarts/py/test.py"
|
||||
@@ -46,7 +44,7 @@ Appium Python 客户端自动添加 `appium:` 前缀。
|
||||
4. 暂停片刻纯粹为了视觉效果。
|
||||
5. 结束 Appium 会话。
|
||||
|
||||
就是这样! 让我们试试。 在运行测试之前,请确保在另一个终端会话中运行 Appium 服务器,否则您会收到无法连接的错误。 然后,您可以执行脚本:
|
||||
就是这样!让我们试试。在运行测试之前,请确保在另一个终端会话中运行 Appium 服务器,否则您会收到无法连接的错误。然后,您可以执行脚本:
|
||||
|
||||
```bash
|
||||
python test.py
|
||||
@@ -54,4 +52,4 @@ python test.py
|
||||
|
||||
如果一切顺利,您将看到设置应用打开并导航到"Apps"视图,然后应用再次关闭。
|
||||
|
||||
恭喜,您已经开始了 Appium 之旅! 继续阅读一些 [后续步骤](./next-steps.md) 以进行探索。
|
||||
恭喜,您已经开始了 Appium 之旅!继续阅读一些 [后续步骤](./next-steps.md) 以进行探索。
|
||||
|
||||
@@ -5,7 +5,7 @@ hide:
|
||||
title: 编写测试 (Ruby)
|
||||
---
|
||||
|
||||
[AppiumLib](https://github.com/appium/ruby_lib) 和 [AppiumLibCore](https://github.com/appium/ruby_lib_core)(**推荐**)是 Ruby 中的官方 Appium 客户端库,可通过 gem 以 [appium_lib](https://rubygems.org/gems/appium_lib) 和 [appium_lib_core](https://rubygems.org/gems/appium_lib_core) 包名获取。 appium_lib_core 继承自 Selenium Ruby Binding,而 appium_lib 继承自 appium_lib_core,因此安装这些库包括 selenium 绑定。 如果您需要一个不太复杂的客户端解决方案,我们推荐 `appium_lib_core`。 `appium_lib` 有一些核心没有的有用方法,但代价是更大的复杂性和可能在最新环境中不工作的历史方法。
|
||||
[AppiumLib](https://github.com/appium/ruby_lib) 和 [AppiumLibCore](https://github.com/appium/ruby_lib_core)(**推荐**)是 Ruby 中的官方 Appium 客户端库,可通过 gem 以 [appium_lib](https://rubygems.org/gems/appium_lib) 和 [appium_lib_core](https://rubygems.org/gems/appium_lib_core) 包名获取。 appium_lib_core 继承自 Selenium Ruby Binding,而 appium_lib 继承自 appium_lib_core,因此安装这些库包括 selenium 绑定。如果您需要一个不太复杂的客户端解决方案,我们推荐 `appium_lib_core`。 `appium_lib` 有一些核心没有的有用方法,但代价是更大的复杂性和可能在最新环境中不工作的历史方法。
|
||||
|
||||
作为第一步,让我们初始化一个 Gemfile 来管理依赖项:
|
||||
|
||||
@@ -34,7 +34,7 @@ bundle add test-unit
|
||||
```
|
||||
|
||||
`appium_lib_core` 是作为 Appium 客户端的主要部分。
|
||||
`appium_lib` 有各种辅助方法,但驱动程序实例通常被设计为全局变量使用。 它可能导致处理实例的问题。
|
||||
`appium_lib` 有各种辅助方法,但驱动程序实例通常被设计为全局变量使用。它可能导致处理实例的问题。
|
||||
`appium_lib_core` 没有这样的全局变量。
|
||||
|
||||
此示例使用 `appium_lib_core` 和 `test-unit` gem 模块。
|
||||
@@ -68,7 +68,7 @@ Test code in `appium_lib` should be similar.
|
||||
4. 暂停片刻纯粹为了视觉效果。
|
||||
5. 结束 Appium 会话。
|
||||
|
||||
就是这样! 让我们试试。 在运行测试之前,请确保在另一个终端会话中运行 Appium 服务器,否则您会收到无法连接的错误。 然后,您可以执行脚本:
|
||||
就是这样!让我们试试。在运行测试之前,请确保在另一个终端会话中运行 Appium 服务器,否则您会收到无法连接的错误。然后,您可以执行脚本:
|
||||
|
||||
```bash
|
||||
# 如果您的环境尚未运行安装命令,请先运行 "bundle install"。
|
||||
@@ -77,4 +77,4 @@ bundle exec ruby test.rb
|
||||
|
||||
如果一切顺利,您将看到设置应用打开并导航到"Apps"视图,然后应用再次关闭。
|
||||
|
||||
恭喜,您已经开始了 Appium 之旅! 继续阅读一些 [后续步骤](./next-steps.md) 以进行探索。
|
||||
恭喜,您已经开始了 Appium 之旅!继续阅读一些 [后续步骤](./next-steps.md) 以进行探索。
|
||||
|
||||
@@ -19,29 +19,26 @@ Driver. 请访问该驱动程序的文档并将其加入书签,因为它将成
|
||||
|
||||
### Android SDK
|
||||
|
||||
- 设置 Android SDK 的最简单方法是下载 [Android Studio](https://developer.android.com/studio)。
|
||||
我们需要使用其 SDK 管理器(_设置 -> 语言和框架 -> Android SDK_)下载以下项目:
|
||||
- 设置 Android SDK 的最简单方法是下载 [Android Studio](https://developer.android.com/studio)。我们需要使用其 SDK 管理器(_设置 -> 语言和框架 -> Android SDK_)下载以下项目:
|
||||
- Android SDK 平台(选择我们想要自动化的任何 Android 平台,例如 API 级别 30)
|
||||
- Android SDK 平台工具
|
||||
- 如果您愿意,您也可以在没有 Android Studio 的情况下下载这些项目:
|
||||
- Android SDK 平台可以使用包含在 [Android 命令行工具](https://developer.android.com/studio#command-line-tools-only) 中的 `sdkmanager` 下载
|
||||
- [Android SDK 平台工具](https://developer.android.com/tools/releases/platform-tools)
|
||||
- 设置 `ANDROID_HOME` 环境变量指向安装 Android SDK 的目录。 您通常可以在 Android Studio SDK 管理器中找到此目录的路径。 它将包含 `platform-tools` 和其他目录。
|
||||
- 设置 `ANDROID_HOME` 环境变量指向安装 Android SDK 的目录。您通常可以在 Android Studio SDK 管理器中找到此目录的路径。它将包含 `platform-tools` 和其他目录。
|
||||
|
||||
### Java JDK
|
||||
|
||||
- 安装 Java JDK(对于最新的 Android API 级别,需要 JDK 9,否则请用 JDK 8)。 您可以从 [Oracle](https://jdk.java.net/) 或 [Adoptium](https://adoptium.net/en-GB/temurin/releases/) 下载此软件。
|
||||
确保您获得 JDK 而不是 JRE。
|
||||
- 设置 `JAVA_HOME` 环境变量指向 JDK 主目录。 它将包含 `bin`、`include` 和其他目录。
|
||||
- 安装 Java JDK(对于最新的 Android API 级别,需要 JDK 9,否则请用 JDK 8)。您可以从 [Oracle](https://jdk.java.net/) 或 [Adoptium](https://adoptium.net/en-GB/temurin/releases/) 下载此软件。确保您获得 JDK 而不是 JRE。
|
||||
- 设置 `JAVA_HOME` 环境变量指向 JDK 主目录。它将包含 `bin`、`include` 和其他目录。
|
||||
|
||||
### 准备设备
|
||||
|
||||
- 如果使用模拟器,使用 Android Studio 创建和启动 Android 虚拟设备 (AVD)。
|
||||
您可能需要下载要创建的模拟器的 API 级别的系统映像。 使用 Android Studio 中的 AVD 创建向导通常是完成所有这些的最简单方法。
|
||||
- 如果使用模拟器,使用 Android Studio 创建和启动 Android 虚拟设备 (AVD)。您可能需要下载要创建的模拟器的 API 级别的系统映像。使用 Android Studio 中的 AVD 创建向导通常是完成所有这些的最简单方法。
|
||||
- 如果使用真实设备,您应该为其设置[开发者模式并启用 USB 调试](https://developer.android.com/studio/debug/dev-options)。
|
||||
- 连接模拟器或设备后,您可以运行 `adb devices`(adb位于 `$ANDROID_HOME/platform-tools/adb`)来验证您的设备是否显示为已连接。
|
||||
|
||||
一旦您的设备在 `adb` 中显示为已连接,并且您验证了环境变量设置正确,您应该准备好了! 如果您在这些步骤中的任何一个遇到问题,请参考驱动程序文档,或根据需要参考各种 Android 或 Java 文档站点。
|
||||
一旦您的设备在 `adb` 中显示为已连接,并且您验证了环境变量设置正确,您应该准备好了!如果您在这些步骤中的任何一个遇到问题,请参考驱动程序文档,或根据需要参考各种 Android 或 Java 文档站点。
|
||||
|
||||
恭喜:无论您是否打算这样做,您现在已经在系统上设置了 Android 开发者工具链,所以如果您愿意,可以开始制作 Android 应用!
|
||||
|
||||
@@ -49,11 +46,9 @@ Driver. 请访问该驱动程序的文档并将其加入书签,因为它将成
|
||||
|
||||
### 标准安装
|
||||
|
||||
像所有 Appium 驱动程序一样,UiAutomator 2 驱动程序通过 [Appium 扩展 CLI](../reference/cli/extensions.md) 安装。
|
||||
由于 UiAutomator 2 由核心 Appium 团队维护,它有一个“官方”驱动程序名称(`uiautomator2`),这使得安装更简单。
|
||||
像所有 Appium 驱动程序一样,UiAutomator 2 驱动程序通过 [Appium 扩展 CLI](../reference/cli/extensions.md) 安装。由于 UiAutomator 2 由核心 Appium 团队维护,它有一个“官方”驱动程序名称(`uiautomator2`),这使得安装更简单。
|
||||
|
||||
在安装之前,确保您的 Appium 服务器_未_运行(如果正在运行,请用 _Ctrl-C_ 退出)。
|
||||
然后运行以下命令:
|
||||
在安装之前,确保您的 Appium 服务器_未_运行(如果正在运行,请用 _Ctrl-C_ 退出)。然后运行以下命令:
|
||||
|
||||
```bash
|
||||
appium driver install uiautomator2
|
||||
@@ -79,7 +74,7 @@ Driver uiautomator2@2.0.5 successfully installed
|
||||
|
||||
### 批量安装
|
||||
|
||||
您可能希望将 Appium 与多个驱动程序一起使用。 一种方法是为每个单独的驱动程序运行 `appium driver install <driver-name>`,但您也可以一次性安装多个驱动程序:
|
||||
您可能希望将 Appium 与多个驱动程序一起使用。一种方法是为每个单独的驱动程序运行 `appium driver install <driver-name>`,但您也可以一次性安装多个驱动程序:
|
||||
|
||||
```
|
||||
appium setup
|
||||
@@ -88,8 +83,7 @@ appium setup
|
||||
Running this will install Appium's mobile-specific drivers: UiAutomator2, [XCUITest](https://appium.github.io/appium-xcuitest-driver/)
|
||||
(only if running macOS), and [Espresso](https://appium.github.io/appium-espresso-driver/).
|
||||
|
||||
您也可以使用此命令批量安装桌面应用程序或桌面浏览器的驱动程序。
|
||||
有关更多详细信息,请参考[设置命令文档](../reference/cli/setup.md)。
|
||||
您也可以使用此命令批量安装桌面应用程序或桌面浏览器的驱动程序。有关更多详细信息,请参考[设置命令文档](../reference/cli/setup.md)。
|
||||
|
||||
### 验证安装
|
||||
|
||||
@@ -99,7 +93,7 @@ UiAutomator2 驱动程序,像所有官方 Appium 驱动程序一样,带有 A
|
||||
appium driver doctor uiautomator2
|
||||
```
|
||||
|
||||
本指南专注于基本要求,因此 Appium Doctor 可能建议一个或多个可选修复。 但如果您看到 `0 required fixes needed`,那意味着一切都设置好了!
|
||||
本指南专注于基本要求,因此 Appium Doctor 可能建议一个或多个可选修复。但如果您看到 `0 required fixes needed`,那意味着一切都设置好了!
|
||||
|
||||
现在,再次启动 Appium 服务器(运行 `appium`),您应该看到新安装的驱动程序列为可用:
|
||||
|
||||
@@ -108,7 +102,7 @@ appium driver doctor uiautomator2
|
||||
[Appium] - uiautomator2@2.0.5 (automationName 'UiAutomator2')
|
||||
```
|
||||
|
||||
Android 设置完成并安装了 UiAutomator2 驱动程序,准备编写第一个测试吧! 现在选择您喜欢的语言并试试:
|
||||
Android 设置完成并安装了 UiAutomator2 驱动程序,准备编写第一个测试吧!现在选择您喜欢的语言并试试:
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user