mirror of
https://github.com/appium/appium.git
synced 2026-01-24 19:28:59 -06:00
docs: Added example code of execute driver (#14676)
* docs: add examples of execute_driver in Python and Ruby * docs: fix spaces
This commit is contained in:
@@ -44,7 +44,12 @@ example_usage:
|
||||
driver.executeDriverScript(script, new ScriptOptions().withTimeout(200));
|
||||
python:
|
||||
|
|
||||
# TODO fill out once client code is written
|
||||
import textwrap
|
||||
script = """
|
||||
const el = await driver.$('~foo');
|
||||
await el.click();
|
||||
"""
|
||||
response = driver.execute_driver(script=textwrap.dedent(script))
|
||||
javascript_wd:
|
||||
|
|
||||
const script = `
|
||||
@@ -61,10 +66,18 @@ example_usage:
|
||||
await driver.executeDriver(script);
|
||||
ruby:
|
||||
|
|
||||
# TODO fill out once client code is written
|
||||
script = <<-SCRIPT
|
||||
const status = await driver.status();
|
||||
return status;
|
||||
SCRIPT
|
||||
driver.execute_driver script: script
|
||||
ruby_core:
|
||||
|
|
||||
# TODO fill out once client code is written
|
||||
script = <<-SCRIPT
|
||||
const status = await driver.status();
|
||||
return status;
|
||||
SCRIPT
|
||||
@driver.execute_driver script: script
|
||||
php:
|
||||
|
|
||||
// TODO PHP sample
|
||||
@@ -74,11 +87,11 @@ example_usage:
|
||||
|
||||
client_docs:
|
||||
java: "https://javadoc.io/page/io.appium/java-client/latest/io/appium/java_client/ExecutesDriverScript.html#executeDriverScript-java.lang.String-io.appium.java_client.driverscripts.ScriptOptions-"
|
||||
python: ""
|
||||
python: "https://appium.github.io/python-client-sphinx/webdriver.extensions.html#module-webdriver.extensions.execute_driver"
|
||||
javascript_wdio: "https://webdriver.io/docs/api/appium.html#driverscript"
|
||||
javascript_wd: ""
|
||||
ruby: ""
|
||||
ruby_core: ""
|
||||
ruby: "https://www.rubydoc.info/github/appium/ruby_lib/master/Appium/Driver#execute_driver-instance_method"
|
||||
ruby_core: "https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Base/Driver#execute_driver-instance_method"
|
||||
php: "" # TODO PHP documentation link
|
||||
csharp: "" # TODO Dotnet documentation link
|
||||
|
||||
|
||||
Reference in New Issue
Block a user