Giter Site home page Giter Site logo

appium / appium Goto Github PK

View Code? Open in Web Editor NEW
17.9K 880.0 5.9K 170 MB

Cross-platform automation framework for all kinds of your apps built on top of W3C WebDriver protocol

Home Page: http://appium.io/

License: Apache License 2.0

JavaScript 81.72% Python 0.05% Shell 0.68% CSS 0.01% TypeScript 16.66% HTML 0.84% Ruby 0.04%
appium webdriver android ios windows automation macos test-automation

appium's Introduction

Stand With Ukraine

Appium

Cross-platform test automation for native, hybrid, mobile web and desktop apps.

NPM version Monthly Downloads FOSSA Status StandWithUkraine


Documentation | Get Started | Ecosystem | Changelog | Roadmap | Discussion Forum


Appium is an open-source automation framework that provides WebDriver-based automation possibilities for a wide range of different mobile, desktop and IoT platforms. Appium is modular and extensible, and supports multiple programming languages, which means there is an entire ecosystem of related software:

  • Drivers add support for automating specific platforms
  • Clients allow writing Appium tests in your programming language of choice
  • Plugins allow to further extend Appium functionality

Migrating From Appium 1 to Appium 2

As of January 1st, 2022, the Appium team no longer maintains or supports Appium 1. All officially supported platform drivers are only compatible with Appium 2.

Please read the Migration Guide if you are still using Appium 1.

Warning

If you use Appium Desktop or Appium Server GUI, you will not be able to upgrade to Appium 2, as both of these tools have been deprecated. Please use Appium Inspector in combination with a standalone Appium 2 server.

Installation

Appium can be installed using npm (other package managers are not currently supported). Please check the installation docs for the system requirements and further information.

If upgrading from Appium 1, make sure Appium 1 is fully uninstalled (npm uninstall -g appium). Unexpected errors might appear if this has not been done.

npm i -g appium

Note that this will only install the core Appium server, which cannot automate anything on its own. Please install drivers for your target platforms in order to automate them.

Drivers

Appium supports app automation across a variety of platforms, like iOS, Android, macOS, Windows, and more. Each platform is supported by one or more "drivers", which know how to automate that particular platform. You can find a full list of officially-supported and third-party drivers in Appium Ecosystem's Drivers page.

Driver management is done using Appium's Extension command-line interface:

# Install an official driver from npm (see documentation for a list of such drivers)
appium driver install <driver-name>
# Install any driver from npm
appium driver install --source=npm <driver-name>
# See documentation for installation from other sources

# List already installed drivers
appium driver list --installed
# Update a driver (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium driver update <driver-name>
# Update a driver to the most recent version (may include breaking changes)
appium driver update <driver-name> --unsafe
# Uninstall a driver (it won't last forever, will it?)
appium driver uninstall <driver-name>

Clients

Client libraries enable writing Appium tests in different programming languages. There are officially-supported clients for Java, Python, Ruby, and .NET C#, as well as third-party clients for other languages. You can find a full list of clients in Appium Ecosystem's Clients page.

Plugins

Plugins allow you to extend server functionality without changing the server code. The main difference between drivers and plugins is that the latter must be explicitly enabled on Appium server startup (all installed drivers are enabled by default):

appium --use-plugins=<plugin-name>

You can find a full list of officially-supported and third-party plugins in Appium Ecosystem's Plugins page.

Similarly to drivers, plugin management is also done using Appium's Extension command-line interface:

# Install an official plugin from npm (see documentation for a list of such plugins)
appium plugin install <plugin-name>
# Install any plugin from npm
appium plugin install --source=npm <plugin-name>
# See documentation for installation from other sources

# List already installed plugins
appium plugin list --installed
# Update a plugin (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium plugin update <plugin-name>
# Update a plugin to the most recent version (may include breaking changes)
appium plugin update <plugin-name> --unsafe
# Uninstall a plugin
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 is used to launch and configure the server:

# Start the server on the default host (0.0.0.0) and port (4723)
appium server
# You can also omit the 'server' subcommand
appium
# Start the server on the given host, port and use a custom base path prefix (the default prefix is '/')
appium --address 127.0.0.1 --port 9000 --base-path /wd/hub

Appium supports execution of parallel server processes, as well as parallel driver sessions within a single server process. Refer the corresponding driver documentations regarding which mode is optimal for the particular driver or whether it supports parallel sessions.

Why Appium?

  1. You usually don't have to recompile your app or modify it in any way, due to the use of standard automation APIs on all platforms.
  2. You can write tests with your favorite dev tools using any WebDriver-compatible language such as Java, Python, Ruby and C#. There are also third party client implementations for other languages.
  3. You can use any testing framework.
  4. Some drivers like xcuitest and uiautomator2 have built-in mobile web and hybrid app support. Within the same script, you can switch seamlessly between native app automation and webview automation, all using the WebDriver model that's already the standard for web automation.
  5. You can run your automated tests locally and in a cloud. There are multiple cloud providers that support various Appium drivers (mostly targeting iOS and Android mobile automation).
  6. Appium Inspector can be used to visually inspect the page source of applications across different platforms, facilitating easier test development.

Investing in the WebDriver protocol means you are betting on a single, free, and open protocol for testing that has become a web standard. Don't lock yourself into a proprietary stack.

For example, if you use Apple's XCUITest library without Appium, you can only write tests using Obj-C/Swift, and you can only run tests through Xcode. Similarly, with Google's UiAutomator or Espresso, you can only write tests in Java/Kotlin. Appium opens up the possibility of true cross-platform native app automation, for mobile and beyond!

If you are looking for a more comprehensive description of what this is all about, please read our documentation on How Does Appium Work?.

License

Apache-2.0

FOSSA Status

appium's People

Contributors

admc avatar bernii avatar boneskull avatar bootstraponline avatar christian-bromann avatar dependabot-preview[bot] avatar dor-bl avatar dpgraham avatar dylanlacey avatar eglitise avatar greenkeeper[bot] avatar imurchie avatar jlipps avatar jonahss avatar kazucocoa avatar maudineormsby avatar moizjv avatar mykola-mokhnach avatar onioni avatar penguinho avatar renovate-bot avatar renovate[bot] avatar rgonalo avatar santiycr avatar scottdixon avatar sebv avatar snevesbarros avatar sourishkrout avatar srinivasantarget avatar triager avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appium's Issues

Android button text vs name issue

I have a button called 'Sign In'. On iOS I find it using .name. Android errors with IndexOutOfBoundsError when finding name. The name is instead in .text.

> b = e_buttons
post
session/9c9468c4-5f79-418c-947d-d811653a17aa/elements
{"using":"tag name","value":"button"}

> b.first.text
get
session/9c9468c4-5f79-418c-947d-d811653a17aa/element/4/text
null
=> "Sign In"

> b.first.name
get
session/9c9468c4-5f79-418c-947d-d811653a17aa/element/4/attribute/name
null
Selenium::WebDriver::Error::IndexOutOfBoundsError: 

Appium is slow

I have a simple seven line test that logs in and then out of an app. It takes 53 seconds to run. One step iterates through almost 36 elements to find the appropriate value.

Is the best practice to discover elements via text and then save index numbers so subsequent runs are not slow?

Android secure textfield not found

I have a secure textfield in android and there are no elements found when searching using the secure tag name.

> e_secures
post
session/9c9468c4-5f79-418c-947d-d811653a17aa/elements
{"using":"tag name","value":"secure"}
=> []

au.getElementsByName is undefined

Why doesn't @driver.find_elements :name, 'Sign In' work?

> @driver.find_elements :name, 'Sign In'
post
session/842b0ebc-f720-4a0a-a991-5aaada06c7b0/elements
{"using":"name","value":"Sign In"}
Selenium::WebDriver::Error::JavascriptError: 'undefined' is not a function (evaluating 'au.getElementsByName('Sign In')')

debug: Appium request received with params: {"using":"name","value":"Sign In"}
info: [INSTSERVER] Sending command to instruments: au.getElementsByName('Sign In')
info: Pushed command to appium work queue: au.getElementsByName('Sign In')
info: [INST] 2013-02-12 17:03:12 +0000 Default: Got new command from instruments: au.getElementsByName('Sign In')
info: [INSTSERVER] Socket data received (125 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":17,"value":"'undefined' is not a function (evaluating 'au.getElementsByName('Sign In')')"}
info: Responding to client with error: {"status":17,"value":"'undefined' is not a function (evaluating 'au.getElementsByName('Sign In')')","sessionId":"842b0ebc-f720-4a0a-a991-5aaada06c7b0"}
POST /wd/hub/session/842b0ebc-f720-4a0a-a991-5aaada06c7b0/elements 500 472ms - 164

It appears that au.getElementByName(... is defined and au.getElementsByName(... isn't.

XPath case insensitive contains

How do I use contains in XPath to match without case sensitivity?

Matches:

{"using":"xpath","value":"text[contains(@name, 'account')]"}

Fails:

{"using":"xpath","value":"text[contains(@name, 'accounT')]"}

Functional test only tests elementsByName

If I knew my way around the mocha framework better, I'd probably locate this, but doing

grunt functional

will cause only a single test (elementsByName) to happen in master.

New Arg Parsing Doesn't like -p Argument for server.js

error: uncaughtException date=Wed Mar 06 2013 09:14:26 GMT-0800 (PST), pid=29435, uid=2200, gid=20, cwd=/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium, execPath=/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node/bin/node, version=v0.8.21, argv=[/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node/bin/node, /Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js, -a, 10.200.128.116, -p, 4723, --verbose], rss=26464256, heapTotal=18586752, heapUsed=10105988, loadavg=[0.5322265625, 0.49609375, 0.484375], uptime=1892730, trace=[column=13, file=net.js, function=Server.listen, line=975, method=listen, native=false, column=14, file=/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js, function=next, line=74, method=null, native=false, column=7, file=/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js, function=main, line=89, method=null, native=false, column=5, file=/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js, function=doWarpCheck, line=22, method=null, native=false, column=3, file=/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js, function=main, line=71, method=null, native=false, column=3, file=/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js, function=, line=100, method=null, native=false, column=26, file=module.js, function=Module._compile, line=449, method=_compile, native=false, column=10, file=module.js, function=Object.Module._extensions..js, line=467, method=Module._extensions..js, native=false, column=32, file=module.js, function=Module.load, line=356, method=load, native=false, column=12, file=module.js, function=Function.Module._load, line=312, method=Module._load, native=false], stack=[Error: Invalid listen argument: 4723, at Server.listen (net.js:975:13), at next (/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js:74:14), at main (/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js:89:7), at doWarpCheck (/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js:22:5), at main (/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js:71:3), at Object. (/Users/danc/Library/Developer/Xcode/DerivedData/Appium-fywxsjnaovisfmbkpifbkmwiwdaq/Build/Products/Debug/Appium.app/Contents/Resources/node_modules/appium/server.js:100:3), at Module._compile (module.js:449:26), at Object.Module._extensions..js (module.js:467:10), at Module.load (module.js:356:32), at Function.Module._load (module.js:312:12)]

Perform a flick with Java

Hi again!

I'm trying to perform a flick from left to right so that a hidden navigationbar is shown.

Currently I'm using the iPhone Simulator and Java. This is what I've done:

TouchActions swipe = new TouchActions(driver).flick(0,20);
swipe.perform();

However, I'm always getting the following error in my console:

java.lang.ClassCastException: org.openqa.selenium.remote.RemoteWebDriver cannot be cast to org.openqa.selenium.HasTouchScreen

Has anyone ever experienced this issue? I'm initializing the driver the same was as mentioned in the examples.

Kind regards,

Raf Theunis

instrument_client.js hardcoded node path breaks when using nvm

Hi,

On instruments_client.js:13 the path to node is hardcoded:

    res = system.performTaskWithPathArgumentsTimeout('/usr/local/bin/node', args, 30);

When using nvm (node version manager), node is in a different path:

Machaos:appium knorrium$ which node
/Users/knorrium/.nvm/v0.8.8/bin/node

which causes a problem when creating a new session:

Running "appium:TestApp" (appium) task
info: Appium REST http interface listener started on 127.0.0.1:4723
info: Creating new appium session cd631669-824c-4441-9834-df061f0cf1d0
info: [INSTSERVER] Instruments socket server started at /tmp/instruments_sock
info: [INST] 2013-01-23 14:18:28 +0000 Default: Socket timed out waiting for a new command, why wasn't there one?
info: [INST] 2013-01-23 14:18:28 +0000 Default: Error getting next command, shutting down :-(
info: [INST] Instruments Trace Complete (Duration : 21.509132s; Output : /Users/knorrium/dev/repos/appium/instrumentscli7.trace)

info: [INSTSERVER] Instruments exited with code 0

I couldn't find the best place to change the path to use process.execPath or grab the output of which node.

Thanks,

FK

textFields IndexOutOfBoundsError

Why does UIATarget.localTarget().frontMostApp().mainWindow().textFields() fail? I'm trying to get an UIAElementArray to use firstWithPredicate.

> @driver.execute_script 'UIATarget.localTarget().frontMostApp().mainWindow().rect()'
=> {"origin"=>{"x"=>0, "y"=>0}, "size"=>{"width"=>768, "height"=>1024}}

> @driver.execute_script 'UIATarget.localTarget().frontMostApp().mainWindow().textFields()'
Selenium::WebDriver::Error::IndexOutOfBoundsError:

Android missing project.properties

$ grunt buildAndroidBootstrap
BUILD FAILED
/appium/android/appium/uiautomator/bootstrap/build.xml:49: Source resource does not exist: /appium/android/appium/uiautomator/bootstrap/project.properties

https://github.com/jlipps/appium/blob/master/uiautomator/bootstrap/build.xml#L49

This file is an integral part of the build system for your
application and should be checked into Version Control Systems.

There's no AndroidManifest.xml so android update project doesn't work.

textField.sendKeys issue

Hi,

I'm experiencing an issue with the sendKeys method on a textfield. I'm using selenium webdriver in Java.

This is the piece of code:

WebElement helloButton = driver.findElement(By.name("Hello"));
WebElement textField = driver.findElement(By.tagName("textField"));

textField.sendKeys("Testuser");
helloButton.click();

When the sendKeys method is called, the keyboard appears on my iPhone simulator. But then it wants to press the helloButton, which is hidden underneath the keyboard and is gives an error (and a failing test ofcourse).

Is there a way to hide the keyboard before clicking the button?

Kind regards,

Raf Theunis

window/current/size Not yet implemented

window/current/size is not yet implemented. This works though.

@driver.execute_script "UIATarget.localTarget().frontMostApp().mainWindow().rect()"

> @driver.manage.window.size
get
session/da3b3676-61c1-4db9-b1cb-cf1a92787dc2/window/current/size

Android textfield not found

Android can't find textfield when searching with tag name.

> e_textfields
post
session/9c9468c4-5f79-418c-947d-d811653a17aa/elements
{"using":"tag name","value":"textfield"}
=> []

Android name always returns success

> $driver.find_elements :name, 'does_not_exist'
post
session/9c9468c4-5f79-418c-947d-d811653a17aa/elements
{"using":"name","value":"does_not_exist"}
=> []
debug: Appium request received with params: {"using":"name","value":"does_not_exist"}
info: [ADB] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"name","selector":"does_not_exist","context":"","multiple":true}}
info: Pushed command to appium work queue: ["find",{"strategy":"name","selector":"does_not_exist","context":"","multiple":true}]
info: [ANDROID] [info] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"name","selector":"does_not_exist","context":"","multiple":true}}
info: [ANDROID] [info] Got command of type ACTION
info: [ANDROID] [info] Returning result: {"value":[],"status":0}
info: [ADB] Received command result from bootstrap
info: Responding to client with success: {"status":0,"value":[],"sessionId":"9c9468c4-5f79-418c-947d-d811653a17aa"}
POST /wd/hub/session/9c9468c4-5f79-418c-947d-d811653a17aa/elements 200 51ms - 87

find_tags_attr

# Returns an array of attribute values from elements matching the tag name.
def find_tags_attr tag_name, attribute
  js = %Q(
    var b = $('#{tag_name}');
    var r = [];
    for (var a = 0; a < b.length; a++) {
      r.push(b[a].#{attribute}());
    }
    r
  )

  $driver.execute_script js
end

Is there a better way to accomplish this task without using UI Automation directly? An example use case is listing the names of all buttons.

Getting the text (instead of title) in an alert

Currently the "getAlertText" returns the title of the alert instead of the message (staticText elements) inside the alert.

  • This may reflect a mapping issue between the webdriver APIs and the UIAutomation APIs.
  • So, I wonder if there's a way that appium can make alert a full featured element that supports accessing elements (such as staticText) inside of an alert.
  • if an alert can also show up under "driver.page_source" that would be great too.

Local zip support broken?

I get this error when using a local zip. Manually decompressing works.

stack=[Error: ENOENT, open '/Users/appium/cucumber/My.app.zip']

setValue for textFields doesn't generate full event stream

I'm not sure how many other people are affected by this, but in our case, we have filters and actions based on the generation of the
-textField:shouldChangeCharactersInRange:replacementString:
delegate method being called. Unfortunately, sending a post on .../value to set the value of a field results in the value of that field being set with UIAutomation, which works great for basically everything except a text field.

According to the JsonWireProtocol document for selenium,
POST /session/:sessionId/element/:id/value
is supposed to
Send a sequence of key strokes to an element.

Which is exactly what we need for UITextField and similar.

I understand that we're using the .../value POST to set other values as well (buttons, sliders, etc.) which is great and useful, but would there be any way to detect that the destination field is a text field and us the equivalent of sendKeysToElement instead of setValue? This would retain all of the other benefits and reduce surprise for new users.

It's unfortunate that the POST .../value was defined by wire protocol for keystroke generation, as it's a bit confusing in that manner.

I'm using python to control selenium and it's pretty insistent on sending the /value setting for anything other than pure modifiers, which is fair given the specification, but I did find that I could use the following to send the .../keys POST instead if necessary:

self.driver.execute(Command.SEND_KEYS_TO_ACTIVE_ELEMENT, { "value":["TopLayer"]})

This requires that the active element already be set (I usually use a .clear() on the preceding line), but the keyboard handling works great if I do this.

I would have experimentally done this change myself and submitted a pull request, but I'm a bit weak on node.js and it's not clear to me where this could be introduced such that the knowledge exists of the element type and we can still change the dispatch before it goes to the internal server.

Cheers,
-Gaige

Android static text name IndexOutOfBoundsError

.name works on iOS and instead on Android it's under .text.

> first_text.name
post
session/9c9468c4-5f79-418c-947d-d811653a17aa/elements
{"using":"tag name","value":"text"}
get
session/9c9468c4-5f79-418c-947d-d811653a17aa/element/35/attribute/name
null
Selenium::WebDriver::Error::IndexOutOfBoundsError:

> first_text.text
post
session/9c9468c4-5f79-418c-947d-d811653a17aa/elements
{"using":"tag name","value":"text"}
get
session/9c9468c4-5f79-418c-947d-d811653a17aa/element/49/text
null
=> "Settings"

Remote debugger throws error message even though tests pass

I keep seeing the "[REMOTE] Debugger" error when running the functional test suite. If this doesn't cause problems it should probably use warning instead of error for logging.

execute
    ✓ should do UIAutomation commands if not in web frame (932ms)
    ✓ should not fail if UIAutomation command blows up (923ms)
    ✓ should not fail with quotes (925ms)

  execute
    ✓ should bubble up javascript errors (2658ms)

  execute
    ✓ should eval javascript (2351ms)

  execute
    ✓ should not be returning hardcoded results (2325ms)

  execute
    ◦ should return nothing when you don't explicitly return: error: [REMOTE] Debugger returned data for message undefinedbut we weren't waiting for that message!
    ✓ should return nothing when you don't explicitly return (2412ms)

  execute
    ◦ should execute code inside the web view: error: [REMOTE] Debugger returned data for message undefinedbut we weren't waiting for that message!
    ✓ should execute code inside the web view (11224ms)

Instruments Trace Complete

Is there some way to stop the instrumentscli.trace files from being created? After testing for a bit, there are quite a few .trace files.

Appium XPath infinite escaping

Using XPath with implicit wait set causes Appium to crash.

> $driver.manage.timeouts.implicit_wait = 30
> secure 'Password'
post
session/4f908934-a2e7-4551-b2ee-0e83faf73b75/element
{"using":"xpath","value":"secure[@value='Password']"}
EOFError: end of file reached
from /lib/ruby/1.9.1/net/protocol.rb:141:in 'read_nonblock'

info: [INSTSERVER] Instruments exited with code 0
error: uncaughtException

stack=[TypeError: Cannot read property 'status' of null, at IOS.findUIElementOrElements.doFind as cbForCurrentCmd, at IOS.start.onExit as exitHandler, at ChildProcess.Instruments.launch (/Users/appium/Desktop/appium/appium/instruments/instruments.js:146:14), at ChildProcess.EventEmitter.emit (events.js:99:17), at Process._handle.onexit (child_process.js:678:10)]

Elements get invalidated in UIATableView

Tables seem to be kinda specific in iOS apps. They get invalidated very fast making Appium element-interaction process fail. This is due the fact that for example 'tap on element' takes two requests to perform it:

  1. Find an element
  2. Tap on the element

This two-step process of clicking is just not working (cause elements get wiped between two requests: getElement and click). To make it work, there should be a feature available to execute instructions in one step. Same goes with getting attributes of elements... (they might be not there when you request for attribute of an element).

The only workaround (for tapping) it performing tap on screen coordinates. But there are no workarounds for other scenarios (like getting an attribute of an element).

Find element by text

Is there a way to find elements by text or should I just use XPath?

$driver.find_element :text, 'Sign In'
ArgumentError: cannot find element by :text

XPath OR support

> $driver.find_elements :xpath, "textfield | secure"
post
session/3d2dbc2d-acac-4dc2-8d3f-67559da20567/elements
{"using":"xpath","value":"textfield | secure"}
EOFError: end of file reached
)> $driver.find_elements :xpath, "//textfield | //secure" 
post
session/dd60c223-84ff-4767-a61c-776a15c0623f/elements
{"using":"xpath","value":"//textfield | //secure"}
EOFError: end of file reached

For Android compatability, I need to get all the textfields and all the secure textfields from iOS. It doesn't look like Appium's XPath implementation supports |?

Android page_source

I think it should respond with NYI instead of IndexOutOfBoundsError.

> $driver.page_source
get
session/9c9468c4-5f79-418c-947d-d811653a17aa/source
null
Selenium::WebDriver::Error::IndexOutOfBoundsError:

firstWithPredicate

As mentioned on #174. It'd be nice to have feature party with UI Automation when it comes to arrays.

length
firstWithName
firstWithPredicate
firstWithValueForKey
toArray
withName
withPredicate
withValueForKey

XPath text fallback

By default in iOS, a button named Sign In has:

  1. b.name = Sign In
  2. b.text = Sign In
  3. $driver.find_element :xpath, "button[@text='Sign In']" = found
  4. $driver.find_element :xpath, "button[@name='Sign In']" = found

On Android name will be empty for most projects and #4 will fail. #232 introduced text fallback for the .name attribute. I think there should be a text fallback for XPath as well.

If an identifier attribute string is specified, that string is used as the name; otherwise, the label attribute string is used as the name.
http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Reference/UIAElementClassReference/UIAElement/UIAElement.html#//apple_ref/javascript/instm/UIAElement/name

On Android, if name is not set then there's no fallback and matches will fail.

Instruments Trace Error : Failed to start trace

Mac OS X Version 10.8.2
node-v0.8.18.pkg
iOS Simulator Version 6.1
Xcode version 4.6

info: Using local app from desiredCaps: /Users/upgundecha/TestApps/BmiCalc.app
info: Creating new appium session 880f43b4-4e49-41c2-8116-1ae60ea35d92
info: [INSTSERVER] Instruments socket server started at /tmp/instruments_sock
info: [INST STDERR] 2013-02-05 23:12:57.388 instruments[2020:1207] -[NSAlert alertWithError:] called with nil NSError. A generic error message will be displayed, but the user deserves better.

info: [INST STDERR] 2013-02-05 23:13:14.757 instruments[2020:1207] Recording cancelled : At least one target failed to launch; aborting run
Instruments Trace Error : Failed to start trace.

info: [INSTSERVER] Instruments exited with code 253
error: Instruments did not launch successfully, failing session
POST /wd/hub/session 500 17703ms - 153
a function in your .chain() failed: { message: 'The environment you requested was unavailable.',
data: '{\n "status": 6,\n "value": {\n "message": "A session is either terminated or not started"\n },\n "sessionId": "880f43b4-4e49-41c2-8116-1ae60ea35d92"\n}' }
Unmesh-Gundechas-iMac:appium-test upgundecha$ node simplest.js error: Instruments socket client never checked in; timing out
error: Instruments did not launch successfully, failing session
error: uncaughtException date=Tue Feb 05 2013 23:17:57 GMT+0530 (IST), pid=2011, uid=501, gid=20, cwd=/Users/upgundecha, execPath=/usr/local/bin/node, version=v0.8.18, argv=[node, /usr/local/bin/appium], rss=23371776, heapTotal=15394560, heapUsed=9904352, loadavg=[0.42529296875, 0.58740234375, 0.94873046875], uptime=9255, trace=[column=42, file=/usr/local/lib/node_modules/appium/app/appium.js, function=Appium.invoke, line=176, method=invoke, native=false, column=7, file=[as exitHandler](/usr/local/lib/node_modules/appium/app/ios.js, function=IOS.start.onExit, line=81, method=start.onExit, native=false, column=10, file=/usr/local/lib/node_modules/appium/instruments/instruments.js, function=Instruments.startSocketServer.onSocketNeverConnect, line=58, method=startSocketServer.onSocketNeverConnect, native=false, column=19, file=timers.js, function=Timer.list.ontimeout, line=101, method=list.ontimeout, native=false], stack=[TypeError: Cannot set property 'sessionId' of undefined, at Appium.invoke %28/usr/local/lib/node_modules/appium/app/appium.js:176:42), at IOS.start.onExit as exitHandler, at Instruments.startSocketServer.onSocketNeverConnect (/usr/local/lib/node_modules/appium/instruments/instruments.js:58:10), at Timer.list.ontimeout (timers.js:101:19)]

Running entire suite of 'grunt functional' results in 'EMFILE, too many open files' error

The flick gesture test passes consistently when run via this specific command:
$ mocha -t 90000 -R spec test/functional/uicatalog/flick.js
flick gesture
✓ should work via webdriver method (4194ms)
✓ should work via mobile only method (4179ms)
✓ should work via mobile only method with percentage (4186ms)
...
8 tests complete (2 minutes)

However, when running the same tests as part of the large suite of 'grunt functional' tests, I am consistently blocked by this file handler error:
$ grunt functional
Running "functional" task

active
✓ should return active element (3319ms)
...
flick gesture
✓ should work via webdriver method (4235ms)
◦ should work via mobile only method:
/Users/mlai/dev/appium/node_modules/winston/lib/winston/exception.js:29
cwd: process.cwd(),
^
Error: EMFILE, too many open files
at Object.exception.getProcessInfo (/Users/mlai/dev/appium/node_modules/winston/lib/winston/exception.js:29:26)
at Object.exception.getAllInfo (/Users/mlai/dev/appium/node_modules/winston/lib/winston/exception.js:17:24)
at Logger._uncaughtException (/Users/mlai/dev/appium/node_modules/winston/lib/winston/logger.js:600:24)
at process.EventEmitter.emit (events.js:126:20)

Thanks to jlipps for confirming this issue as a problem with appium or one of its dependency failing to release Node's file handlers.

SendKeys() fails on UITextField that is SubView of UITableViewCell

Screen Shot 2013-02-19 at 4 08 34 PM

UITableViewCell.contentView with 2 subviews (UILabel, and UITextField) I am trying to sendkeys to the UITextField

debug: Appium request received with params: {"value":["G","i","l","b","e","r","t"]}
info: [INSTSERVER] Sending command to instruments: au.getElement('15').setValueByType('Gilbert')
info: [INSTSERVER] Closing our half of the connection
info: Pushed command to appium work queue: au.getElement('15').setValueByType('Gilbert')
info: [INSTSERVER] Socket Completely closed
info: [INST] 2013-02-19 23:49:09 +0000 Default: Got new command from instruments: au.getElement('15').setValueByType('Gilbert')
info: [INSTSERVER] Socket Connected
info: [INSTSERVER] Socket data received (75 bytes)
info: [INSTSERVER] Socket closed by other side
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":17,"value":"(null) could not be tapped"}
info: Responding to client with error: {"status":17,"value":"(null) could not be tapped","sessionId":"65879eb5-11b2-48e3-bbde-5d44d8a8dc4b"}
POST /wd/hub/session/65879eb5-11b2-48e3-bbde-5d44d8a8dc4b/element/15/value 500 2434ms - 114
info: [INST] 2013-02-19 23:49:09 +0000 Debug: (null).tap()
2013-02-19 23:49:10 +0000 Debug: (null).tap()
2013-02-19 23:49:10 +0000 Debug: (null).scrollToVisible()
2013-02-19 23:49:11 +0000 Debug: (null) - scrollToVisible could not generate a scroll to make the element visible.
2013-02-19 23:49:11 +0000 Debug: (null) - scrollToVisible could not generate a scroll to make the element visible.
2013-02-19 23:49:11 +0000 Debug: (null) could not be tapped

Include post body in verbose output

Why doesn't verbose mode show the POSTed command?

$ appium -V 1
POST /wd/hub/session/c7a34f56-cbe2-436f-8c4e-5f20c4684eaf/execute 501 1ms - 159

Verbose mode isn't helpful if the source of the error is never printed.

Implicit Wait Isn't Working

I'm trying to set the implicit wait using driver.implicitly_wait and this doesn't seem to work when running a test as it fails before the element is on the screen.

Alert buttons IndexOutOfBoundsError

Why can't Appium list all the buttons?

> @driver.execute_script 'UIATarget.localTarget().frontMostApp().alert().buttons();'
post
session/84e3c025-1c75-49c2-bf9d-65e649725ca5/execute
{"script":"UIATarget.localTarget().frontMostApp().alert().buttons();","args":[]}
Selenium::WebDriver::Error::IndexOutOfBoundsError: 

I can click the alert button using button index or button name and it works. I can't find out how to list all the buttons though. Should there be a built in method that makes this easier?

@driver.execute_script 'UIATarget.localTarget().frontMostApp().alert().elements()[3].tap();'
@driver.execute_script 'UIATarget.localTarget().frontMostApp().alert().buttons()[0].tap();'
@driver.execute_script 'UIATarget.localTarget().frontMostApp().alert().buttons()["Yes"].tap();'

Reset App

If you look at the cucumber example for the github app, you'll notice that the app is reset between scenarios. Is there some way to accomplish this with Appium?

The absence of such a feature means the tests are almost twice as long because you have to undo all the work each time and it's fragile. All tests will fail if one doesn't execute properly.

appium.io should stay in sync with appium/appium/README

The "customer"-facing appium.io is not automatically kept up to date with changes in Appium's README or other doc files. I think this will lead to a lot of confusion. Is there a way to automatically generate these pages from Appium source so that we can automate pushing a new version (say, on npm publish?). @admc, @bernii, any thoughts?

Appium crashes immediately

Hitting this because I possibly set things up incorrectly. When I run appium and try to connect, it crashes immediately with the following error:

error: uncaughtException date=Tue Feb 12 2013 15:18:48 GMT-0800 (PST), pid=1916, uid=503, gid=20, cwd=/usr/local/lib, execPath=/usr/local/bin/node, version=v0.8.19, argv=[node, /usr/local/bin/appium], rss=31576064, heapTotal=21686016, heapUsed=14713600, loadavg=[2.25146484375, 1.79541015625, 1.6279296875], uptime=4288, trace=[column=11, file=net.js, function=errnoException, line=770, method=null, native=false, column=19, file=net.js, function=Server._listen2, line=893, method=_listen2, native=false, column=10, file=net.js, function=listen, line=937, method=null, native=false, column=5, file=net.js, function=Server.listen, line=980, method=listen, native=false, column=10, file=/usr/local/lib/node_modules/appium/instruments/instruments.js, function=Instruments.startSocketServer, line=108, method=startSocketServer, native=false, column=8, file=Instruments (/usr/local/lib/node_modules/appium/instruments/instruments.js, function=new, line=42, method=null, native=false, column=10, file=/usr/local/lib/node_modules/appium/instruments/instruments.js, function=module.exports, line=279, method=exports, native=false, column=26, file=/usr/local/lib/node_modules/appium/app/ios.js, function=IOS.start, line=131, method=start, native=false, column=5, file=/usr/local/lib/node_modules/appium/app/ios.js, function=IOS.cleanup, line=79, method=cleanup, native=false, column=5, file=/usr/local/lib/node_modules/appium/node_modules/rimraf/rimraf.js, function=CB, line=46, method=null, native=false], stack=[Error: listen EADDRINUSE, at errnoException (net.js:770:11), at Server._listen2 (net.js:893:19), at listen (net.js:937:10), at Server.listen (net.js:980:5), at Instruments.startSocketServer (/usr/local/lib/node_modules/appium/instruments/instruments.js:108:10), at new Instruments (/usr/local/lib/node_modules/appium/instruments/instruments.js:42:8), at module.exports (/usr/local/lib/node_modules/appium/instruments/instruments.js:279:10), at IOS.start (/usr/local/lib/node_modules/appium/app/ios.js:131:26), at IOS.cleanup (/usr/local/lib/node_modules/appium/app/ios.js:79:5), at CB (/usr/local/lib/node_modules/appium/node_modules/rimraf/rimraf.js:46:5)]

SOME NOTES: If I run as "sudo appium", it doesn't crash, but it can't find any buttons because it is looking in the root directory for the simulator. This is the warning I get:

info: [INST STDERR] 2013-02-12 14:36:17.865 ScriptAgent[1460:13403] CFPreferences: user home directory at file://localhost/var/root/Library/Application%20Support/iPhone%20Simulator/6.1/ is unavailable. User domains will be volatile.

info: [INST STDERR] 2013-02-12 14:36:37.891 ScriptAgent[1460:13403] +[UIAXElement initialize]: UIAutomation never received kAXAccessibilityLoaded. Waited 20.02 seconds.

The iPhone Simulator actually sits in Users/username/Library/Application%20Support/iPhone%20Simulator

server.js crash on "text" element of UIAButton.

Mac OS X Version 10.7.5
node-v0.8.18.pkg
iOS Simulator Version 6.0 (358.4)
Xcode version 4.5.2 (4G2008a)

node server.js --app /Full/Path/To/MYiOS.app/ -V 1 -a 10.20.73.101

BEGIN python code

from selenium import webdriver
driver = webdriver.Remote("http://10.20.73.95:4723/wd/hub",{})
driver.find_elements_by_tag_name("UIAButton")[1].text

END python code

Rackspaces-MacBook-Pro:appium rackspace$ node server.js --app /Users/rackspace/Desktop/toks_stuff/rackspace-ios-master/build/Debug-iphonesimulator/Rackspace\ Cloud.app -V 1 -a 10.20.73.95
info: Appium REST http interface listener started on 10.20.73.95:4723
info: Using app from command line: /Users/rackspace/Desktop/toks_stuff/rackspace-ios-master/build/Debug-iphonesimulator/Rackspace Cloud.app
info: Creating new appium session 29d65652-29c1-452f-a3bf-1671486c585f
info: [INSTSERVER] Instruments socket server started at /tmp/instruments_sock
info: [INSTSERVER] Instruments is ready to receive commands
info: Instruments launched. Starting poll loop for new commands.
POST /wd/hub/session 302 6508ms - 0
info: [INSTSERVER] Socket data received (15 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
GET /wd/hub/session/29d65652-29c1-452f-a3bf-1671486c585f 200 1ms - 320
info: [INSTSERVER] Sending command to instruments: au.getElementsByType('UIAButton')
info: Pushed command to appium work queue: au.getElementsByType('UIAButton')
info: [INST] 2013-01-29 19:13:20 +0000 Default: Got new command from instruments: au.getElementsByType('UIAButton')
info: [INSTSERVER] Socket data received (152 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":[{"ELEMENT":"Edit"},{"ELEMENT":"Add"},{"ELEMENT":"Settings"},{"ELEMENT":"Accounts"},{"ELEMENT":"Refresh"}]}
POST /wd/hub/session/29d65652-29c1-452f-a3bf-1671486c585f/elements 200 1119ms - 284
info: [INSTSERVER] Sending command to instruments: au.getElement('Add').value()
info: Pushed command to appium work queue: au.getElement('Add').value()
info: [INST] 2013-01-29 19:13:21 +0000 Default: Got new command from instruments: au.getElement('Add').value()
info: [INST] 2013-01-29 19:13:21 +0000 None: Script threw an uncaught JavaScript error: 'null' is not an object (evaluating 'result.status') on line 29 of bootstrap.js
2013-01-29 19:13:21 +0000 Stopped: Script was stopped by the user
Instruments Trace Complete (Duration : 37.044357s; Output : /Users/rackspace/Desktop/toks_stuff/appium/instrumentscli2.trace)

Give server.js parameters to allow defining activity full path instead of assuming package-name is part of the activity name.

e.g., starting my app manually created the following entry in logcat:

I/ActivityManager(  477): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 
flg=0x10200000 cmp=com.rackspace.cloud.android/com.rackspacecloud.android.ListAccountsActivity}

Thus the adb command that works for me is:

adb shell am start -n com.rackspace.cloud.android/com.rackspacecloud.android.ListAccountsActivity

Notice that the package name doesn't equal the activity name, the "rackspacecloud" versus "rackspace.cloud". I would like to provide the full activity string myself seeing as there does exist the possibility that the package name isn't a substring of the activity.

$('button') hangs appium

Why does this hang Appium?

$driver.execute_script "$('button')"

This also hangs.

$driver.execute_script "mechanic('button')"

POST /wd/hub/session/28e201ab-07a7-4370-8d2b-51d75f8b770f/execute 200 1053ms - 89
debug: Appium request received with params: {"script":"$('button')","args":[]}
info: [INSTSERVER] Sending command to instruments: $('button')
info: [INSTSERVER] Closing our half of the connection
info: Pushed command to appium work queue: $('button')
info: [INSTSERVER] Socket Completely closed
info: [INST] 2013-02-15 17:48:10 +0000 Default: Got new command from instruments: $('button')

This works:

$driver.execute_script "au.lookup('button')"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.