36.active_ime_engine

Returns the activity and package of the currently active IME engine (e.g.,

‘com.android.inputmethod.latin/.LatinIME’).

Android only.

Return the package name of the current input method

Usage driver.active_ime_engine

37. toggle_location_services

toggle_location_services(self):

Toggle the location services on the device. Android only.

Open the location setting on the Android device

Use driver.toggle_location_services ()

38.set_location

set_location(self, latitude, longitude, altitude):

Set the location of the device

Setting up the latitude and longitude of the equipment

:Args:

– latitudeLatitude String or numeric value between -90.0 and 90

– longitudeLongitude String or numeric value between -180.0 and 180

– altitudeAltitude – String or numeric value

Usage driver.set_location (latitude, longitude, height)

39.tag_name

tag_name(self):

This element’s “tagName“ property.

Return the tagName attribute of the element

Class name is returned by practice

Use element.tag_name ()

40.text

text(self):

The text of the element.

Return the text value of the element

Use element.text ()

41.click

click(self):

Clicks the element.

Click the element

Use element.click ()

42.submit

submit(self):

Submits a form.

Submit Form

No use

43.clear

clear(self):

Clears the text if it’s a text entry element.

Clear the content of the input

Use element.clear ()

44.get_attribute

get_attribute(self, name):

See @chenhengjie123 hyperlinks in detail

Gets the given attribute or property of the element.

1、The way to get content-desc is get_attribute (“name”), and it does not guarantee that the return must be content-desc (content-desc will return to the text property value when the content-desc is empty. “)

2、get_attribute The method is not available for all the attributes we see in uiautomatorviewer (the name here is the name of the attribute used when get_attribute):

Available:

String type:

name(Return to content-desc or text)

text(Return to text)

className(Return to class, only API=> 18 can be supported)

resourceId(Return to resource-id, only API=> 18 to support)

This method will first try to return the value of a property with the

given name. If a property with that name doesn’t exist, it returns the

value of the attribute with the same name. If there’s no attribute with

that name, “None“ is returned.

Values which are considered truthy, that is equals “true” or “false”,

are returned as booleans. All other non-“None“ values are returned

as strings. For attributes or properties which do not exist, “None“

is returned.

:Args:

– name – Name of the attribute/property to retrieve.

Example::

# Check if the “active” CSS class is applied to an element.

is_active = “active” in target_element.get_attribute(“class”)

No use

45.is_selected

is_selected(self):

Returns whether the element is selected.

Can be used to check if a checkbox or radio button is selected.

Whether or not the element is selected.

It can be used to check a check box or radio buttons to be selected.

Use element.is_slected ()

46.is_enabled

is_enabled(self):

Returns whether the element is enabled.

Whether the return element is available with True of False

Use element.is_enabled ()

47.find_element_by_id

find_element_by_id(self, id_):

Finds element within this element’s children by ID.

ID positioning elements through the element

:Args:

– id_ – ID of child element to locate.

Use driver. find_element_by_id (“Id”)

48. find_elements_by_id

find_elements_by_id(self, id_):

Finds a list of elements within this element’s children by ID.

Locate all elements containing the attribute by element ID.

:Args:

– id_ – Id of child element to find.

Use driver. find_elements_by_id (“Id”)

49. find_element_by_name

find_element_by_name(self, name):

Finds element within this element’s children by name.

Locate by element Name (element name attribute text)

:Args:

– name – name property of the element to find.

Use driver.find_element_by_name (“name”)

50. find_elements_by_name

find_elements_by_name(self, name):

Finds a list of elements within this element’s children by name.

Locate all elements containing the attribute through element Name positioning (element name attribute text).

:Args:

– name – name property to search for.

Use driver.find_element_by_name (“name”)

51. find_element_by_link_text

find_element_by_link_text(self, link_text):

Finds element within this element’s children by visible link text.

Text location by element visible link

:Args:

– link_text – Link text string to search for.

Usage driver.find_element_by_link_text (“text”)

52. find_elements_by_link_text

find_element_by_link_text(self, link_text):

Finds a list of elements within this element’s children by visible link text

Locate all elements that contain this attribute by element visible link text location.

:Args:

– link_text – Link text string to search for.

Usage driver.find_elements_by_link_text (“text”)

53. find_element_by_partial_link_text

find_element_by_partial_link_text(self, link_text):

Finds element within this element’s children by partially visible link text.

Visible link text location through the element part

:Args:

– link_text – Link text string to search for.

driver. find_element_by_partial_link_text(“text”)

54. find_elements_by_partial_link_text

find_elements_by_partial_link_text(self, link_text):

Finds a list of elements within this element’s children by link text.

Localize all elements containing the attribute through the visible link text of the element part.

:Args:

– link_text – Link text string to search for.

driver. find_elements_by_partial_link_text(“text”)

55. find_element_by_tag_name

find_element_by_tag_name(self, name):

Finds element within this element’s children by tag name.

Locate the element by finding the name of the HTML’s label

:Args:

– name – name of html tag (eg: h1, a, span)

Usage: driver.find_element_by_tag_name (“name”)

56. find_elements_by_tag_name

find_elements_by_tag_name(self, name):

Finds a list of elements within this element’s children by tag name.

Locate all the elements by finding the name of the HTML’s label

:Args:

– name – name of html tag (eg: h1, a, span)

Use driver.find_elements_by_tag_name (“name”)

57. find_element_by_xpath

find_element_by_xpath(self, xpath):

Finds element by xpath.

Through Xpath positioning elements, detailed methods can be seen in http://www.w3school.com.cn/xpath/

62.send_keys

Analog input in the element (open the appium input method and configure the appium input method, you can type in Chinese and English).

:Args:

– value – A string for typing, or setting form fields. For setting

file inputs, this could be a local file path.

Use this to send simple key events or to fill out form fields::

form_textfield = driver.find_element_by_name(‘username’)

form_textfield.send_keys(“admin”)

This can also be used to set file inputs.

::

file_input = driver.find_element_by_name(‘profilePic’)

file_input.send_keys(“path/to/profilepic.gif”)

# Generally it’s better to wrap the file path in one of the methods

# in os.path to return the actual path to support cross OS testing.

# file_input.send_keys(os.path.abspath(“path/to/profilepic.gif”))

driver.element.send_keys(“Chinese and English “)

63. is_displayed

is_displayed(self):

Whether the element is visible to a user.

Whether this element is visible to the user. Simply that it’s the hidden element and the control that blocks the inoperable elements (only Selenium, whether appium implements a similar function is not too sure) and this one will return to False

Use driver.element.is_displayed ()

64. location_once_scrolled_into_view

location_once_scrolled_into_view(self):

“””THIS PROPERTY MAY CHANGE WITHOUT WARNING. Use this to discover

where on the screen an element is so that we can click it. This method

should cause the element to be scrolled into view.

Returns the top lefthand corner location on the screen, or “None“ if

the element is not visible.

I don’t know how to use it for the time being

“””

65.size

size(self):

The size of the element.

Get the size of the element (Gao Hekuan)

new_size[“height”] = size[“height”]

new_size[“width”] = size[“width”]

Usage driver.element.size

66. value_of_css_property

value_of_css_property(self, property_name):

The value of a CSS property.

CSSattribute

Usage for the time being

67.location

location(self):

The location of the element in the renderable canvas.

Get the coordinates of the upper left corner of the element

Usage driver.element.location

”’Return to the X coordinates of element, int type ”

driver.element.location.get(‘x’)

”’Return to the Y coordinates of element, int type ”

driver.element.location.get(‘y’)

68.rect

rect(self):

A dictionary with the size and location of the element.

A dictionary of the size and position of an element

69. screenshot_as_base64

screenshot_as_base64(self):

Gets the screenshot of the current element as a base64 encoded string.

Gets the screenshot of the current element encoded by Base64 string.

:Usage:

img_b64 = element.screenshot_as_base64

70.execute_script

execute_script(self, script, *args):

Synchronously Executes JavaScript in the current window/frame.

Synchronously execute JavaScript code in the current window / framework (specifically referred to as iframe of Html). You can understand that if the code is sleeping for 5 seconds, the JavaScript of the main thread will not be executed in five seconds.

:Args:

– script: The JavaScript to execute.

– \*args: Any applicable arguments for your JavaScript.

:Usage:

driver.execute_script(‘document.title’)

71.execute_async_script

execute_async_script(self, script, *args):

Asynchronously Executes JavaScript in the current window/frame.

Insert the JavaScript code, but this is asynchronous, that is if your code is sleeping for 5 seconds, then you’re sleeping by yourself, and the other JavaScript code of the page is executed as usual.

:Args:

– script: The JavaScript to execute.

– \*args: Any applicable arguments for your JavaScript.

:Usage:

driver.execute_async_script(‘document.title’)

72.current_url

current_url(self):

Gets the URL of the current page.

Get the URL of the current page.

:Usage:

driver.current_url

Usage driver.current_url

73. page_source

page_source(self):

Gets the source of the current page.

Get the source of the current page.

:Usage:

driver.page_source

74.close

close(self):

Closes the current window.

Close the current window

:Usage:

driver.close()

75.quit

quit(self):

Quits the driver and closes every associated window.

Exit script to run and close each associated window connection.

:Usage:

driver.quit()

In the process of learning, there are questions, you can add appium (python+java) QQ group communication: 512200893