Giter Club home page Giter Club logo

appium-wait-plugin's Introduction

appium-wait-plugin npm version


AppiumWait2


This is an Appium plugin designed to wait for element to be present.

Prerequisite

Appium version 2.0

Tested with appium v2.0.0-beta.42

From Verion 2.0.0

  • Following bindings are not supported - sessionId/waitplugin/timeout - sessionId/waitplugin/getTimeout
  • Following command are renamed - plugin: getWaitTimeout is renamed to plugin: getWaitPluginProperties - plugin: getWaitTimeout is renamed to plugin: setWaitPluginProperties

Installation - Server

Install the plugin using Appium's plugin CLI, either as a named plugin or via NPM:

appium plugin install --source=npm appium-wait-plugin

Installation - Client

No special action is needed to make things work on the client side.

Activation

The plugin will not be active unless turned on when invoking the Appium server:

appium --use-plugins=element-wait

Configuration

To override the default element-wait retry

  1. Use appium server CLI --plugin-element-wait-timeout=30000 --plugin-element-wait-interval-between-attempts=200 --plugin-element-wait-exclude-enabled-check="click,clear"

  2. Use appium server config file. Refer.

Example

Before wait-plugin

wait = new WebDriverWait(driver, 30);
wait.until(presenceOfElementLocated(MobileBy.AccessibilityId("login"))).click();
wait.until(presenceOfElementLocated(MobileBy.AccessibilityId("slider1")));
driver.findElementByAccessibilityId("slider1").click();
WebElement slider = wait.until(presenceOfElementLocated(MobileBy.AccessibilityId("slider")));
WebElement slider1 = wait.until(presenceOfElementLocated(MobileBy.AccessibilityId("slider1")));

After wait-plugin

driver.findElementByAccessibilityId("login").click();
driver.findElementByAccessibilityId("slider1").click();
driver.findElementByAccessibilityId("login").sendKeys('Hello');

Configure Wait timeout in test

While overriding timeouts one can choose to override all or one of the below

  • timeout
  • intervalBetweenAttempts

WDIO Example

await driver.executeScript('plugin: setWaitPluginProperties', [
        {
          timeout: 1111,
          intervalBetweenAttempts: 11,
        },
]);

await driver.executeScript('plugin: getWaitPluginProperties', [])

or

await driver.executeScript('plugin: setWaitPluginProperties', [
        {
          timeout: 1111,
        },
]);

await driver.executeScript('plugin: getWaitPluginProperties', [])

Java Example

driver.executeScript("plugin: setWaitPluginProperties", ImmutableMap.of("timeout", 1111 , "intervalBetweenAttempts", 11 ));

Server logs will be as below:

[Appium] Plugins which can handle cmd 'findElement': element-wait (sessionless)
[Appium] Plugin element-wait (sessionless) is now handling cmd 'findElement'
[Plugin [element-wait (sessionless)]] Waiting to find element with accessibility id strategy for login selector
[Plugin [element-wait (sessionless)]] Waiting to find element with accessibility id strategy for login selector
[Plugin [element-wait (sessionless)]] Waiting to find element with accessibility id strategy for login selector
[Plugin [element-wait (sessionless)]] Waiting to find element with accessibility id strategy for login selector
[Plugin [element-wait (sessionless)]] Element with accessibility id strategy for login selector found.
[Plugin [element-wait (sessionless)]] Checking if login element is displayed
[Plugin [element-wait (sessionless)]] login element is displayed.

Skip element Enabled Check for commands

Before performing actions such as click, setValue, clear etc, plugin waits for element to be enabled. As mentioned in #78 if there is a need to skip the elementEnabled check for a set of commands, excludeEnabledCheck can be sent along with timeout values.

Usage

wdio

await driver.executeScript('plugin: setWaitPluginProperties', [
        {
          timeout: 1111,
          intervalBetweenAttempts: 11,
	  excludeEnabledCheck: ['click','setValue']
        },
]);

await driver.executeScript('plugin: getWaitPluginProperties', [])

By default excludeEnabledCheck is empty list.

appium-wait-plugin's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar dileep17 avatar saikrishna321 avatar srinivasantarget avatar sudharsan-selvaraj 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

Watchers

 avatar  avatar  avatar  avatar  avatar

appium-wait-plugin's Issues

example of config JSON usage

Hi,

Could you show how to initialize the appium server with this plugin using the config json file of the docs ?

Thank you

The default element-wait retry do not override when trying to update from code

The default element-wait retry do not override when I am trying to update from code:

{
  "server": {
    "plugin": {
      "element-wait": {
        "timeout": 50000,
        "intervalBetweenAttempts": 150,
        "excludeEnabledCheck": ["click"]
      }
    }
  }
}
private static AppiumDriverLocalService getAppiumDriverService() {
        return AppiumDriverLocalService.buildService(new AppiumServiceBuilder()
                .withIPAddress("127.0.0.1")
                .usingPort(4723)
                .withArgument(GeneralServerFlag.BASEPATH, "/wd/hub")
                .withArgument(GeneralServerFlag.LOG_LEVEL, "info:debug")
                .withArgument(GeneralServerFlag.USE_DRIVERS, "UiAutomator2")
                .withArgument(GeneralServerFlag.ALLOW_INSECURE, "adb_shell")
                .withArgument(GeneralServerFlag.RELAXED_SECURITY)
                .withArgument(GeneralServerFlag.USE_PLUGINS, "element-wait, gestures, appium-dashboard")
                .withArgument(GeneralServerFlag.SESSION_OVERRIDE)
                .withTimeout(Duration.ofSeconds(180))
                .withArgument(GeneralServerFlag.CONFIGURATION_FILE, new File("config" + File.separator + "serverconfig.json").toString())
                .withArgument(GeneralServerFlag.SHOW_CONFIG)
                .withLogFile(new File(System.getProperty("user.dir") + File.separator + "Logs" + File.separator + Thread.currentThread().getId())));
    }
    
```

{
address: '0.0.0.0',
allowCors: false,
basePath: '',
callbackPort: 4723,
debugLogSpacing: false,
keepAliveTimeout: 600,
localTimezone: false,
loglevel: 'debug',
logNoColors: false,
logTimestamp: false,
longStacktrace: false,
noPermsCheck: false,
port: 4723,
relaxedSecurityEnabled: false,
sessionOverride: false,
strictCaps: false
}

(no configuration file loaded)

via CLI or function call:

{
address: '127.0.0.1',
allowInsecure: [ 'adb_shell' ],
basePath: '/wd/hub/',
loglevel: 'info:debug',
relaxedSecurityEnabled: true,
sessionOverride: true,
useDrivers: [ 'UiAutomator2' ],
usePlugins: [ 'element-wait', 'gestures', 'appium-dashboard' ]
}

final configuration:

{
address: '127.0.0.1',
allowInsecure: [ 'adb_shell' ],
basePath: '/wd/hub/',
logFile: 'D:\Automation-Framework\Generic\Logs\1',
loglevel: 'info:debug',
nodeconfig: { server: { plugin: [Object] } },
port: 4723,
relaxedSecurityEnabled: true,
sessionOverride: true,
useDrivers: [ 'UiAutomator2' ],
usePlugins: [ 'element-wait', 'gestures', 'appium-dashboard' ],
showConfig: true,
allowCors: false,
callbackPort: 4723,
debugLogSpacing: false,
keepAliveTimeout: 600,
localTimezone: false,
logNoColors: false,
logTimestamp: false,
longStacktrace: false,
noPermsCheck: false,
strictCaps: false
}


from CLI it is working properly
appium --base-path="/wd/hub/" --allow-insecure="adb_shell" --relaxed-security --session-override --use-drivers="UiAutomator2" --use-plugins="images, element-wait, appium-dashboard" --config "%cd%\config\serverconfig.json"


Not able to activate the plugin after installing via NPM

I installed the package via NPM, but when I am running appium --use-plugins=element-wait in the command line get's an error as
error: unrecognized arguments: --use-plugins=element-wait

Seems like there's no --use-plugins option in Appium

Element-wait plugin not retrying when element not found

I'm using the element-wait plugin with Robot Framework and Appium2 to automate mobile testing. I've created a configuration file .appiumrc.json with the following settings:
{
"server": {
"plugin": {
"element-wait": {
"timeout": 2000000,
"intervalBetweenAttempts": 200,
"excludeEnabledCheck": ["click", "false"]
}
},
"use-plugins": ["element-wait"]
}
}
When executing tests, the Appium server starts with the plugin, and the timeout and interval settings are correctly applied. However, when attempting to find an element using the AppiumDriver.findElements() method, if the element is not found on the first attempt, the test immediately fails without retrying.

I expected the plugin to retry finding the element based on the configured timeout and interval settings, similar to how the Wait Until Page Contains Element keyword works in Robot Framework. However, it seems that the plugin is not retrying the element search.

Steps to Reproduce:

Set up Appium server with the element-wait plugin configured as described above.
Write a test case to find an element that may not be immediately available.
Execute the test case and observe that the test fails without retrying the element search.
Environment:

Operating System: Windows
Appium Version: 2.5.1
Device Under Test: android emulator

Expected Behavior:
I expect the element-wait plugin to retry finding the element according to the configured timeout and interval settings, allowing for more robust and reliable element detection during test execution.

wait plugin is not retrying to find element if the locator is not there on screen

configurations : [email protected] [installed (npm)]

element wait plugin doesnt retry to find element, it tries once and if the element is not present it doesnt retry to find the element

server config 👇
"server": {
"keep-alive-timeout": 800,
"use-plugins": ["device-farm","element-wait"],
"port": 4444,
"plugin": {
"element-wait": {
"timeout": 20000,
"intervalBetweenAttempts": 500
},
"device-farm": {
"platform": "both"
},
"appium-dashboard": {
"dashboard:enableLiveVideo": false,
"dashboard:enableVideoRecording": false
}
},

error log 👇
Plugin element-wait is now handling cmd 'findElement'

  • Waiting to find element with id strategy for incomeCheckbox selector
    [AxiosError: Request failed with status code 404] {
    code: 'ERR_BAD_REQUEST',
    config: {
    transitional: {
    silentJSONParsing: true,
    forcedJSONParsing: true,
    clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function] },
    validateStatus: [Function: validateStatus],
    headers: {
    Accept: 'application/json, text/plain, /',
    'Content-Type': 'application/json',
    'User-Agent': 'axios/0.27.2',
    'Content-Length': 75
    },
    method: 'post',
    url: 'http://127.0.0.1:57415/session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element',
    data: '{"strategy":"id","selector":"incomeCheckbox","context":"","multiple":false}'
    },
    request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
    abort: [Function (anonymous)],
    aborted: [Function (anonymous)],
    connect: [Function (anonymous)],
    error: [Function (anonymous)],
    socket: [Function (anonymous)],
    timeout: [Function (anonymous)],
    finish: [Function: requestOnFinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: true,
    _last: false,
    chunkedEncoding: false,
    shouldKeepAlive: true,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    strictContentLength: false,
    _contentLength: 75,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: true,
    socket: Socket {
    connecting: false,
    _hadError: false,
    _parent: null,
    _host: null,
    _closeAfterHandlingError: false,
    _events: [Object],
    _readableState: [ReadableState],
    _writableState: [WritableState],
    allowHalfOpen: false,
    _maxListeners: undefined,
    _eventsCount: 6,
    _sockname: null,
    _pendingData: null,
    _pendingEncoding: '',
    server: null,
    _server: null,
    timeout: 5000,
    parser: null,
    _httpMessage: null,
    [Symbol(async_id_symbol)]: -1,
    [Symbol(kHandle)]: [TCP],
    [Symbol(lastWriteQueueSize)]: 0,
    [Symbol(timeout)]: Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [TimersList],
    _idleStart: 104480,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 38566,
    [Symbol(triggerId)]: 38564
    },
    [Symbol(kBuffer)]: null,
    [Symbol(kBufferCb)]: null,
    [Symbol(kBufferGen)]: null,
    [Symbol(shapeMode)]: true,
    [Symbol(kCapture)]: false,
    [Symbol(kSetNoDelay)]: true,
    [Symbol(kSetKeepAlive)]: true,
    [Symbol(kSetKeepAliveInitialDelay)]: 1,
    [Symbol(kBytesRead)]: 0,
    [Symbol(kBytesWritten)]: 0
    },
    _header: 'POST /session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, /\r\n' +
    'Content-Type: application/json\r\n' +
    'User-Agent: axios/0.27.2\r\n' +
    'Content-Length: 75\r\n' +
    'Host: 127.0.0.1:57415\r\n' +
    'Connection: keep-alive\r\n' +
    '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
    _events: [Object: null prototype],
    _eventsCount: 2,
    _maxListeners: undefined,
    defaultPort: 80,
    protocol: 'http:',
    options: [Object: null prototype],
    requests: [Object: null prototype] {},
    sockets: [Object: null prototype] {},
    freeSockets: [Object: null prototype],
    keepAliveMsecs: 1000,
    keepAlive: true,
    maxSockets: Infinity,
    maxFreeSockets: 256,
    scheduling: 'lifo',
    maxTotalSockets: Infinity,
    totalSocketCount: 1,
    [Symbol(shapeMode)]: false,
    [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    joinDuplicateHeaders: undefined,
    path: '/session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element',
    _ended: true,
    res: IncomingMessage {
    _events: [Object],
    _readableState: [ReadableState],
    _maxListeners: undefined,
    socket: null,
    httpVersionMajor: 1,
    httpVersionMinor: 1,
    httpVersion: '1.1',
    complete: true,
    rawHeaders: [Array],
    rawTrailers: [],
    joinDuplicateHeaders: undefined,
    aborted: false,
    upgrade: false,
    url: '',
    method: null,
    statusCode: 404,
    statusMessage: 'Not Found',
    client: [Socket],
    _consuming: false,
    _dumped: false,
    req: [Circular *1],
    _eventsCount: 4,
    responseUrl: 'http://127.0.0.1:57415/session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element',
    redirects: [],
    [Symbol(shapeMode)]: true,
    [Symbol(kCapture)]: false,
    [Symbol(kHeaders)]: [Object],
    [Symbol(kHeadersCount)]: 12,
    [Symbol(kTrailers)]: null,
    [Symbol(kTrailersCount)]: 0
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: true,
    host: '127.0.0.1',
    protocol: 'http:',
    _redirectable: Writable {
    _events: [Object],
    _writableState: [WritableState],
    _maxListeners: undefined,
    _options: [Object],
    _ended: true,
    _ending: true,
    _redirectCount: 0,
    _redirects: [],
    _requestBodyLength: 75,
    _requestBodyBuffers: [],
    _eventsCount: 3,
    _onNativeResponse: [Function (anonymous)],
    _currentRequest: [Circular *1],
    _currentUrl: 'http://127.0.0.1:57415/session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element',
    [Symbol(shapeMode)]: true,
    [Symbol(kCapture)]: false
    },
    [Symbol(shapeMode)]: false,
    [Symbol(kCapture)]: false,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
    accept: [Array],
    'content-type': [Array],
    'user-agent': [Array],
    'content-length': [Array],
    host: [Array]
    },
    [Symbol(errored)]: null,
    [Symbol(kHighWaterMark)]: 16384,
    [Symbol(kRejectNonStandardBodyWrites)]: false,
    [Symbol(kUniqueHeaders)]: null
    },
    response: {
    status: 404,
    statusText: 'Not Found',
    headers: {
    connection: 'keep-alive',
    pragma: 'no-cache',
    'cache-control': 'no-store',
    'content-encoding': 'identity',
    'content-type': 'application/json',
    'content-length': '3828'
    },
    config: {
    transitional: [Object],
    adapter: [Function: httpAdapter],
    transformRequest: [Array],
    transformResponse: [Array],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: [Object],
    validateStatus: [Function: validateStatus],
    headers: [Object],
    method: 'post',
    url: 'http://127.0.0.1:57415/session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element',
    data: '{"strategy":"id","selector":"incomeCheckbox","context":"","multiple":false}'
    },
    request: <ref *1> ClientRequest {
    _events: [Object: null prototype],
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: true,
    _last: false,
    chunkedEncoding: false,
    shouldKeepAlive: true,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    strictContentLength: false,
    _contentLength: 75,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: true,
    socket: [Socket],
    _header: 'POST /session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, /\r\n' +
    'Content-Type: application/json\r\n' +
    'User-Agent: axios/0.27.2\r\n' +
    'Content-Length: 75\r\n' +
    'Host: 127.0.0.1:57415\r\n' +
    'Connection: keep-alive\r\n' +
    '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: [Agent],
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    joinDuplicateHeaders: undefined,
    path: '/session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element',
    _ended: true,
    res: [IncomingMessage],
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: true,
    host: '127.0.0.1',
    protocol: 'http:',
    _redirectable: [Writable],
    [Symbol(shapeMode)]: false,
    [Symbol(kCapture)]: false,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype],
    [Symbol(errored)]: null,
    [Symbol(kHighWaterMark)]: 16384,
    [Symbol(kRejectNonStandardBodyWrites)]: false,
    [Symbol(kUniqueHeaders)]: null
    },
    data: {
    sessionId: '0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281',
    value: [Object]
    }
    }
    }
    �[38;5;48m[AppiumDriver@17b9]�[0m Plugin device-farm is now handling cmd 'findElement'
    �[38;5;48m[AppiumDriver@17b9]�[0m Executing default handling behavior for command 'findElement'
    �[38;5;64m[AndroidUiautomator2Driver@87b6 (88292602)]�[0m Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator
    �[38;5;64m[AndroidUiautomator2Driver@87b6 (88292602)]�[0m Waiting up to 10000 ms for condition
    �[38;5;0m[device-farm-/Users/sankethcs/.appium]�[0m Updating lastCmdExecutedAt for device emulator-5554 in session 88292602-1636-43cc-96bf-54f3e763f8c3
    �[38;5;64m[AndroidUiautomator2Driver@87b6 (88292602)]�[0m Matched '/element' to command name 'findElement'
    �[38;5;64m[AndroidUiautomator2Driver@87b6 (88292602)]�[0m Proxying [POST /element] to [POST http://127.0.0.1:57415/session/0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281/element] with body: {"strategy":"id","selector":"incomeCheckbox","context":"","multiple":false}
    �[38;5;64m[AndroidUiautomator2Driver@87b6 (88292602)]�[0m Got response with status 404: {"sessionId":"0f19ae31-e3d8-4f24-a1c9-76a1ffaa0281","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:63)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:277)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:271)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.chann...

Command 'findElement' was not handled by the following behaviors or plugins

Configuration

Appium 2.3.0 and Java-client 9.2.3

Driver Used

plugin used

The element-wait plugin conflicts with the images plugin. After removing the element-wait plugin from the --use-plugins list, the image element is clicked properly.

[AppiumDriver@48ff] Command 'findElement' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default","images","ocr"]. The command was handled by these: ["element-wait"].

public class Main {

    private static AppiumDriverLocalService getAppiumDriverService() {
        String strDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("MMMM_dd_yyyy"));
        String strTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH_mm_ss"));
        var strReportDir = Paths.get(System.getProperty("user.dir"), strDate);

        String logFileName = String.format("Appium_Server_%s.log", strTime);
        File logFile = new File(Paths.get(strReportDir.toString(), logFileName).toString());

        return AppiumDriverLocalService.buildService(new AppiumServiceBuilder()
                .withIPAddress("127.0.0.1")
                .usingPort(4723)
                .withArgument(() -> "--long-stacktrace")
                .withArgument(GeneralServerFlag.LOG_LEVEL, "info:debug")
                .withArgument(GeneralServerFlag.USE_DRIVERS, "uiautomator2")
                .withArgument(GeneralServerFlag.ALLOW_INSECURE, "adb_shell")
                .withArgument(GeneralServerFlag.RELAXED_SECURITY)
                .withArgument(GeneralServerFlag.USE_PLUGINS, "images, gestures, ocr")//element-wait
                .withArgument(GeneralServerFlag.SESSION_OVERRIDE)
                .withArgument(() -> "--config", new File(System.getProperty("user.dir") + File.separator + "config" + File.separator + "serverconfig.json").toString())
                .withTimeout(Duration.ofSeconds(240))
                .withLogOutput(System.err)
                .withLogFile(logFile));
    }

    public static void main(String[] args) throws IOException, InterruptedException {
        AppiumDriverLocalService appiumDriverLocalService = getAppiumDriverService();
        AppiumDriver appiumDriver = null;
        try {
            appiumDriverLocalService.start();

            UiAutomator2Options uiAutomator2Options = new UiAutomator2Options()
                    .setAutomationName(AutomationName.ANDROID_UIAUTOMATOR2)
                    .setApp(System.getProperty("user.dir") + File.separator + "app" + File.separator + "android" + File.separator + "mda-2.0.2-23.apk")
                    .setFullReset(false)
                    .setNoReset(true)
                    .setPlatformName("android")
                    .setPlatformVersion("13")
                    .setUdid("ZD222CJSXB")
                    .setAppPackage("com.saucelabs.mydemoapp.android")
                    .setAppActivity("com.saucelabs.mydemoapp.android.view.activities.SplashActivity");

            uiAutomator2Options.setCapability("shouldTerminateApp", true);

            System.out.println("URL " + appiumDriverLocalService.getUrl());
            appiumDriver = new AndroidDriver(appiumDriverLocalService.getUrl(), uiAutomator2Options);
            System.out.println("SessionID " + appiumDriver.getSessionId());

            Thread.sleep(5000);

            byte[] navMenuByte = FileUtils.readFileToByteArray(new File(System.getProperty("user.dir") + File.separator + "image" + File.separator + "NavMenuIcon.png"));
            String navMenuEncodedString = Base64.getEncoder().encodeToString(navMenuByte);

            appiumDriver.findElement(AppiumBy.image(navMenuEncodedString)).click();

            Thread.sleep(5000);

        } finally {
            if (appiumDriver != null) {
                appiumDriver.quit();
            }
            appiumDriverLocalService.stop();
        }
    }
}
  1. Failed Log when element-wait is passed in --use-plugins
    Command 'findElement' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default","images","ocr"]. The command was handled by these: ["element-wait"]

https://gist.github.com/dipakkumar1225/207e6ce236f3f6bb27abfcfe6ca7ac1f

  1. Success Log when element-wait plugin is not used in --use-plugins
    https://gist.github.com/dipakkumar1225/c80de443415e7f15fa486cce78d94e08

Sample App
https://github.com/dipakkumar1225/AppiumWaitPluginSample

Please suggest the solution for this

Add possibility to configure plugin for element clickability

I am trying to click on an element which is visible, but its attribute enabled is false. The plugin is therefore waiting for it to become true, so the test fails.

Is it possible to configure the plugin to check only if an element exists, regardless of its enabled attribute?

Unable to install appium-wait-plugin

Upon running the command : appium plugin install --source=npm appium-wait-plugin I am getting the following error:

0 verbose cli /usr/local/bin/node /usr/local/bin/npm 1 info using [email protected] 2 info using [email protected] 3 timing npm:load:whichnode Completed in 1ms 4 timing config:load:defaults Completed in 1ms 5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms 6 timing config:load:builtin Completed in 1ms 7 timing config:load:cli Completed in 2ms 8 timing config:load:env Completed in 1ms 9 timing config:load:project Completed in 1ms 10 timing config:load:file:/Users/xx/.npmrc Completed in 0ms 11 timing config:load:user Completed in 0ms 12 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms 13 timing config:load:global Completed in 1ms 14 timing config:load:validate Completed in 0ms 15 timing config:load:credentials Completed in 0ms 16 timing config:load:setEnvs Completed in 1ms 17 timing config:load Completed in 8ms 18 timing npm:load:configload Completed in 8ms 19 timing npm:load:mkdirpcache Completed in 1ms 20 timing npm:load:mkdirplogs Completed in 1ms 21 verbose title npm install appium-wait-plugin 22 verbose argv "install" "--save-dev" "appium-wait-plugin" "--json" 23 timing npm:load:setTitle Completed in 17ms 24 timing config:load:flatten Completed in 2ms 25 timing npm:load:display Completed in 3ms 26 verbose logfile logs-max:10 dir:/Users/xx/.npm/_logs 27 verbose logfile /Users/xx/.npm/_logs/2023-04-04T14_08_44_164Z-debug-0.log 28 timing npm:load:logFile Completed in 5ms 29 timing npm:load:timers Completed in 0ms 30 timing npm:load:configScope Completed in 0ms 31 timing npm:load Completed in 36ms 32 timing arborist:ctor Completed in 0ms 33 silly logfile start cleaning logs, removing 1 files 34 silly logfile done cleaning log files 35 timing idealTree:init Completed in 919ms 36 timing idealTree:userRequests Completed in 2ms 37 silly idealTree buildDeps 38 silly fetch manifest appium-wait-plugin@* 39 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/@appium 40 http fetch GET 200 https://registry.npmjs.org/appium-wait-plugin 395ms (cache hit) 41 silly fetch manifest appium@^1.9.1 42 http fetch GET 200 https://registry.npmjs.org/appium 913ms (cache hit) 43 silly fetch manifest appium@^2.0.0-beta.57 44 timing idealTree Completed in 2247ms 45 timing command:install Completed in 2257ms 46 verbose stack Error: unable to resolve dependency tree 46 verbose stack at Arborist.[failPeerConflict] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1418:25) 46 verbose stack at Arborist.[loadPeerSet] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1384:34) 46 verbose stack at async Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:970:11) 46 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:216:7) 46 verbose stack at async Promise.all (index 1) 46 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:153:5) 46 verbose stack at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:159:5) 46 verbose stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:78:5) 47 verbose cwd /Users/xx 48 verbose Darwin 22.2.0 49 verbose node v16.13.2 50 verbose npm v8.6.0 51 error code ERESOLVE 52 error ERESOLVE unable to resolve dependency tree 53 error 54 error While resolving: [email protected] 54 error Found: [email protected] 54 error node_modules/appium 54 error appium@"^1.9.1" from the root project 54 error 54 error Could not resolve dependency: 54 error peer appium@"^2.0.0-beta.57" from [email protected] 54 error node_modules/appium-wait-plugin 54 error dev appium-wait-plugin@"*" from the root project 54 error 54 error Fix the upstream dependency conflict, or retry 54 error this command with --force, or --legacy-peer-deps 54 error to accept an incorrect (and potentially broken) dependency resolution. 54 error "~/.npm/_logs/2023-04-04T14_08_44_164Z-debug-0.log" 86L, 4706B

The Appium version installed on my machine: appium --version
2.0.0-beta.59

iOS TypeError: Cannot read properties of undefined (reading 'jwproxy')

Hi,
I was working with appium-wait-plugin for past few days and it was working fine but today to my surprise it stopped working. I even restarted the appium server and simulator with fullReset but it did not solve the issue. Further i also ran the following commands as suggested on some forums to clear any other sessions running.

adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server.test
adb uninstall io.appium.unlock
adb uninstall io.appium.settings

But trying all of these did not solve the issue. If I run my script without the wait plugin, then it works successfully.
I have the following environment setup:

  • JDK 11.0.2
  • Appium 2.0.0-beta.71
  • appium-java-client 8.5.1
  • [email protected] [installed (npm)]
  • selenium-java 4.9.1
  • Node v18.16.0
  • NPM 9.6.7
  • macOS Ventura 13.4
  • XCode 14.3
  • iPhone 14 (iOS 16.4 simulator)

Java Client Test Code for UIKitCatalogApp:

By activityIndicators = AppiumBy.accessibilityId("Activity Indicators");
driver.findElement(activityIndicators).click();

i get the following error at findElement call:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot read properties of undefined (reading 'jwproxy')

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot read properties of undefined (reading 'jwproxy')
Build info: version: '4.9.1', revision: 'eb2032df7f'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '11.0.2'
Driver info: io.appium.java_client.ios.IOSDriver
Command: [e377915a-b4f4-4cce-a62f-4a151408e927, findElement {using=accessibility id, value=Activity Indicators}]
Capabilities {appium:app: /Users/xxxx/dev/appium/Appi..., appium:autoAcceptAlerts: true, appium:automationName: XCUITest, appium:bundleId: com.example.apple-samplecod..., appium:databaseEnabled: false, appium:deviceName: iPhone 14, appium:javascriptEnabled: true, appium:locationContextEnabled: false, appium:networkConnectionEnabled: false, appium:newCommandTimeout: 180, appium:takesScreenshot: true, appium:udid: 6B4B083D-5F01-4B6D-88D1-175..., appium:webStorageEnabled: false, platformName: IOS}
Session ID: e377915a-b4f4-4cce-a62f-4a151408e927

	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:53)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:193)
	at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:250)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
	at org.openqa.selenium.remote.ElementLocation$ElementFinder$2.findElement(ElementLocation.java:162)
	at org.openqa.selenium.remote.ElementLocation.findElement(ElementLocation.java:66)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)
	at com.itkhanz.practice.drivercommands.ios.IOSAppInteractions.test_terminateApp(IOSAppInteractions.java:40)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
	at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:664)
	at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
	at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
	at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
	at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
	at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
	at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.testng.TestRunner.privateRun(TestRunner.java:848)
	at org.testng.TestRunner.run(TestRunner.java:621)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:437)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:397)
	at org.testng.SuiteRunner.run(SuiteRunner.java:336)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1200)
	at org.testng.TestNG.runSuites(TestNG.java:1114)
	at org.testng.TestNG.run(TestNG.java:1082)
	at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
	at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)

Here are the appium server logs.
I am also attaching the logs.
appiumlogs.txt

xxxx@w4deumsy9000289 ~ % appium --use-drivers=xcuitest --use-plugins=element-wait 
[Appium] Attempting to load plugin element-wait...
[debug] [Appium] Requiring plugin at /Users/xxxx/.appium/node_modules/appium-wait-plugin
[Appium] Welcome to Appium v2.0.0-beta.71 (REV 552db40622bb7a82d9c6d67d2d6bcf3694b47e30)
[Appium] Non-default server args:
[Appium] {
[Appium]   useDrivers: [
[Appium]     'xcuitest'
[Appium]   ],
[Appium]   usePlugins: [
[Appium]     'element-wait'
[Appium]   ]
[Appium] }
[Appium] Attempting to load driver xcuitest...
[debug] [Appium] Requiring driver at /Users/xxxx/.appium/node_modules/appium-xcuitest-driver
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[Appium] Available drivers:
[Appium]   - [email protected] (automationName 'UiAutomator2')
[Appium]   - [email protected] (automationName 'XCUITest')
[Appium]   - [email protected] (automationName 'Espresso')
[Appium]   - [email protected] (automationName 'Safari')
[Appium]   - [email protected] (automationName 'Gecko')
[Appium]   - [email protected] (automationName 'Chromium')
[Appium] Available plugins:
[Appium]   - [email protected] (ACTIVE)
[Appium]   - [email protected]
[debug] [HTTP] Request idempotency key: 00c5e8e1-0d1a-4a58-ba40-3e2208ec4cc1
[HTTP] --> POST /session
[HTTP] {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"appium:app":"/Users/xxxx/dev/appium/Appium-OC/src/main/resources/apps/UIKitCatalog-iphonesimulator.app","appium:autoAcceptAlerts":true,"appium:automationName":"XCUITest","appium:bundleId":"com.example.apple-samplecode.UICatalog","appium:deviceName":"iPhone 14","appium:newCommandTimeout":180,"appium:udid":"6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F","platformName":"IOS"}}}
[debug] [AppiumDriver@aaa2] Calling AppiumDriver.createSession() with args: [null,null,{"firstMatch":[{}],"alwaysMatch":{"appium:app":"/Users/xxxx/dev/appium/Appium-OC/src/main/resources/apps/UIKitCatalog-iphonesimulator.app","appium:autoAcceptAlerts":true,"appium:automationName":"XCUITest","appium:bundleId":"com.example.apple-samplecode.UICatalog","appium:deviceName":"iPhone 14","appium:newCommandTimeout":180,"appium:udid":"6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F","platformName":"IOS"}}]
[AppiumDriver@aaa2] Plugins which can handle cmd 'createSession': element-wait
[AppiumDriver@aaa2] Plugin element-wait is now handling cmd 'createSession'
[AppiumDriver@aaa2] Executing default handling behavior for command 'createSession'
[debug] [AppiumDriver@aaa2] Event 'newSessionRequested' logged at 1687245918116 (09:25:18 GMT+0200 (Central European Summer Time))
[Appium] Attempting to find matching driver for automationName 'XCUITest' and platformName 'IOS'
[Appium] The 'xcuitest' driver was installed and matched caps.
[Appium] Will require it at /Users/xxxx/.appium/node_modules/appium-xcuitest-driver
[debug] [Appium] Requiring driver at /Users/xxxx/.appium/node_modules/appium-xcuitest-driver
[AppiumDriver@aaa2] Appium v2.0.0-beta.71 creating new XCUITestDriver (v4.30.2) session
[AppiumDriver@aaa2] Checking BaseDriver versions for Appium and XCUITestDriver
[AppiumDriver@aaa2] Appium's BaseDriver version is 9.3.10
[AppiumDriver@aaa2] XCUITestDriver's BaseDriver version is 9.3.10
[debug] [XCUITestDriver@4bd3] Creating session with W3C capabilities: {
[debug] [XCUITestDriver@4bd3]   "alwaysMatch": {
[debug] [XCUITestDriver@4bd3]     "platformName": "IOS",
[debug] [XCUITestDriver@4bd3]     "appium:app": "/Users/xxxx/dev/appium/Appium-OC/src/main/resources/apps/UIKitCatalog-iphonesimulator.app",
[debug] [XCUITestDriver@4bd3]     "appium:autoAcceptAlerts": true,
[debug] [XCUITestDriver@4bd3]     "appium:automationName": "XCUITest",
[debug] [XCUITestDriver@4bd3]     "appium:bundleId": "com.example.apple-samplecode.UICatalog",
[debug] [XCUITestDriver@4bd3]     "appium:deviceName": "iPhone 14",
[debug] [XCUITestDriver@4bd3]     "appium:newCommandTimeout": 180,
[debug] [XCUITestDriver@4bd3]     "appium:udid": "6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F"
[debug] [XCUITestDriver@4bd3]   },
[debug] [XCUITestDriver@4bd3]   "firstMatch": [
[debug] [XCUITestDriver@4bd3]     {}
[debug] [XCUITestDriver@4bd3]   ]
[debug] [XCUITestDriver@4bd3] }
[XCUITestDriver@4bd3] 'platformVersion' capability ('undefined') is not a valid version number. Consider fixing it or be ready to experience an inconsistent driver behavior.
[XCUITestDriver@4bd3 (e377915a)] Session created with session id: e377915a-b4f4-4cce-a62f-4a151408e927
[debug] [XCUITest] Current user: 'xxxx'
[debug] [XCUITestDriver@4bd3 (e377915a)] Available devices: 
[debug] [XCUITestDriver@4bd3 (e377915a)] No real device with udid '6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F'. Looking for simulator
[iOSSim] Constructing iOS simulator for Xcode version 14.3 with udid '6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F'
[XCUITestDriver@4bd3 (e377915a)] Determining device to run tests on: udid: '6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F', real device: false
[XCUITestDriver@4bd3 (e377915a)] No platformVersion specified. Using device version: '16.4'
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'xcodeDetailsRetrieved' logged at 1687245918839 (09:25:18 GMT+0200 (Central European Summer Time))
[BaseDriver] Using local app '/Users/xxxx/dev/appium/Appium-OC/src/main/resources/apps/UIKitCatalog-iphonesimulator.app'
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'appConfigured' logged at 1687245918841 (09:25:18 GMT+0200 (Central European Summer Time))
[debug] [XCUITest] Checking whether app '/Users/xxxx/dev/appium/Appium-OC/src/main/resources/apps/UIKitCatalog-iphonesimulator.app' is actually present on file system
[debug] [XCUITest] App is present
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'resetStarted' logged at 1687245918842 (09:25:18 GMT+0200 (Central European Summer Time))
[debug] [simctl] Error running 'terminate': An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Simulator device returned an error for the requested operation.
found nothing to terminate
Underlying error (domain=NSPOSIXErrorDomain, code=3):
	The operation couldn’t be completed. found nothing to terminate
	found nothing to terminate
[XCUITest] Reset: failed to terminate Simulator application with id "com.example.apple-samplecode.UICatalog"
[XCUITest] Not scrubbing third party app in anticipation of uninstall
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'resetComplete' logged at 1687245919088 (09:25:19 GMT+0200 (Central European Summer Time))
[XCUITestDriver@4bd3 (e377915a)] Using WDA path: '/Users/xxxx/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent'
[XCUITestDriver@4bd3 (e377915a)] Using WDA agent: '/Users/xxxx/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
[debug] [IOSSimulatorLog] Starting log capture for iOS Simulator with udid '6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F' using simctl
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'logCaptureStarted' logged at 1687245919777 (09:25:19 GMT+0200 (Central European Summer Time))
[XCUITestDriver@4bd3 (e377915a)] Setting up simulator
[debug] [iOSSim] Setting preferences of 6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F Simulator to {"ConnectHardwareKeyboard":false}
[debug] [iOSSim] Setting common Simulator preferences to {"RotateWindowWhenSignaledByGuest":true,"StartLastDeviceOnLaunch":false,"DetachOnWindowClose":false,"AttachBootedOnStart":true,"ConnectHardwareKeyboard":false,"PasteboardAutomaticSync":false}
[debug] [iOSSim] Updated 6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F Simulator preferences at '/Users/xxxx/Library/Preferences/com.apple.iphonesimulator.plist' with {"RotateWindowWhenSignaledByGuest":true,"StartLastDeviceOnLaunch":false,"DetachOnWindowClose":false,"AttachBootedOnStart":true,"ConnectHardwareKeyboard":false,"PasteboardAutomaticSync":false,"DevicePreferences":{"6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F":{"SimulatorExternalDisplay":2114,"ConnectHardwareKeyboard":false,"ChromeTint":"","SimulatorWindowGeometry":{"682D5D27-8B10-4399-8580-B9F64BDC400B":{"WindowCenter":"{1359.5, 532.5}","WindowScale":0.9977477477477478},"006487F4-269F-481B-BE46-0E12B79585EF":{"WindowCenter":"{1386.5, 544.5}","WindowScale":0.9977477477477478},"2E7ACCB9-37BE-49DE-93D6-4533F97CCEE3":{"WindowCenter":"{1638.5, 549.5}","WindowScale":0.9977477477477478},"2BA915AB-EE56-498D-990D-4C20E79F0734":{"WindowCenter":"{1386.5, 546.5}","WindowScale":0.9977477477477478}},"SimulatorWindowOrientation":"Portrait","SimulatorWindowRotationAngle":0}}}
[debug] [iOSSim] Got Simulator UI client PID: 55649
[iOSSim] Both Simulator with UDID '6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F' and the UI client are currently running
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'simStarted' logged at 1687245920600 (09:25:20 GMT+0200 (Central European Summer Time))
[debug] [XCUITest] Verifying application platform
[debug] [XCUITest] CFBundleSupportedPlatforms: ["iPhoneSimulator"]
[XCUITestDriver@4bd3 (e377915a)] App 'com.example.apple-samplecode.UICatalog' is already installed
[debug] [XCUITest] Reset requested. Removing app with id 'com.example.apple-samplecode.UICatalog' from the device
[debug] [XCUITest] Installing '/Users/xxxx/dev/appium/Appium-OC/src/main/resources/apps/UIKitCatalog-iphonesimulator.app' on Simulator with UUID '6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F'...
[debug] [XCUITestDriver@4bd3 (e377915a)] Parsed BUILD_DIR configuration value: '/Users/xxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-cmloeqhuqbaydofbwmkqjkvbyjnx/Build/Products'
[debug] [XCUITestDriver@4bd3 (e377915a)] Got derived data root: '/Users/xxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-cmloeqhuqbaydofbwmkqjkvbyjnx'
[debug] [XCUITest] The app has been installed successfully.
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'appInstalled' logged at 1687245922840 (09:25:22 GMT+0200 (Central European Summer Time))
[debug] [XCUITestDriver@4bd3 (e377915a)] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[DevCon Factory] Requesting connection for device 6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F on local port 8100
[debug] [DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for 6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F:8100
[debug] [XCUITestDriver@4bd3 (e377915a)] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"16.4","version":"16.4"},"ios":{"simulatorVersion":"16.4","ip":"192.168.0.105"},"ready":true,"build":{"upgradedAt":"1685706987875","time":"Jun 20 2023 08:55:39","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null}
[debug] [XCUITestDriver@4bd3 (e377915a)] Upgrade timestamp of the currently bundled WDA: 1685706987875
[debug] [XCUITestDriver@4bd3 (e377915a)] Upgrade timestamp of the WDA on the device: 1685706987875
[XCUITestDriver@4bd3 (e377915a)] Will reuse previously cached WDA instance at 'http://127.0.0.1:8100/' with 'com.facebook.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior.
[debug] [XCUITestDriver@4bd3 (e377915a)] Trying to start WebDriverAgent 2 times with 10000ms interval
[debug] [XCUITestDriver@4bd3 (e377915a)] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'wdaStartAttempted' logged at 1687245923089 (09:25:23 GMT+0200 (Central European Summer Time))
[XCUITestDriver@4bd3 (e377915a)] Using provided WebdriverAgent at 'http://127.0.0.1:8100/'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"16.4","version":"16.4"},"ios":{"simulatorVersion":"16.4","ip":"192.168.0.105"},"ready":true,"build":{"upgradedAt":"1685706987875","time":"Jun 20 2023 08:55:39","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null}
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'wdaSessionAttempted' logged at 1687245923096 (09:25:23 GMT+0200 (Central European Summer Time))
[debug] [XCUITestDriver@4bd3 (e377915a)] Sending createSession command to WDA
[debug] [XCUITestDriver@4bd3 (e377915a)] Matched '/session' to command name 'createSession'
[debug] [XCUITestDriver@4bd3 (e377915a)] Proxying [POST /session] to [POST http://127.0.0.1:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"com.example.apple-samplecode.UICatalog","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"forceAppLaunch":true,"useNativeCachingStrategy":true,"forceSimulatorSoftwareKeyboardPresence":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [XCUITestDriver@4bd3 (e377915a)] Got response with status 200: {"value":{"sessionId":"36641397-BF19-4B4B-AA7B-4FDE8D361CE0","capabilities":{"device":"iphone","browserName":"UIKitCatalog","sdkVersion":"16.4","CFBundleIdentifier":"com.example.apple-samplecode.UICatalog"}},"sessionId":"36641397-BF19-4B4B-AA7B-4FDE8D361CE0"}
[XCUITestDriver@4bd3 (e377915a)] Determined the downstream protocol as 'W3C'
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'wdaSessionStarted' logged at 1687245925227 (09:25:25 GMT+0200 (Central European Summer Time))
[debug] [XCUITestDriver@4bd3 (e377915a)] Event 'wdaStarted' logged at 1687245925227 (09:25:25 GMT+0200 (Central European Summer Time))
[debug] [BaseDriver] The value of 'elementResponseAttributes' setting did not change. Skipping the update for it
[debug] [BaseDriver] The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it
[AppiumDriver@aaa2] New XCUITestDriver session created successfully, session e377915a-b4f4-4cce-a62f-4a151408e927 added to master session list
[debug] [AppiumDriver@aaa2] Event 'newSessionStarted' logged at 1687245925229 (09:25:25 GMT+0200 (Central European Summer Time))
[AppiumDriver@aaa2] Promoting 1 sessionless plugins to be attached to session ID e377915a-b4f4-4cce-a62f-4a151408e927
[debug] [XCUITestDriver@4bd3 (e377915a)] Cached the protocol value 'W3C' for the new session e377915a-b4f4-4cce-a62f-4a151408e927
[debug] [XCUITestDriver@4bd3 (e377915a)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"IOS","app":"/Users/xxxx/dev/appium/Appium-OC/src/main/resources/apps/UIKitCatalog-iphonesimulator.app","autoAcceptAlerts":true,"automationName":"XCUITest","bundleId":"com.example.apple-samplecode.UICatalog","deviceName":"iPhone 14","newCommandTimeout":180,"udid":"6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F"}}
[HTTP] <-- POST /session 200 7119 ms - 593
[HTTP] 
[HTTP] --> POST /session/e377915a-b4f4-4cce-a62f-4a151408e927/element
[HTTP] {"using":"accessibility id","value":"Activity Indicators"}
[debug] [XCUITestDriver@4bd3 (e377915a)] Calling AppiumDriver.findElement() with args: ["accessibility id","Activity Indicators","e377915a-b4f4-4cce-a62f-4a151408e927"]
[AppiumDriver@aaa2] Plugins which can handle cmd 'findElement': element-wait
[AppiumDriver@aaa2] Plugin element-wait is now handling cmd 'findElement'
[wait-plugin] Timeout properties not set for session e377915a-b4f4-4cce-a62f-4a151408e927, trying to set one
[wait-plugin] Timeout properties set for session e377915a-b4f4-4cce-a62f-4a151408e927 is {"timeout":10000,"intervalBetweenAttempts":500,"overrideTimeout":false} ms
[AppiumDriver@aaa2] Command 'findElement' was *not* handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command *was* handled by these: ["element-wait"].
[debug] [XCUITestDriver@4bd3 (e377915a)] Encountered internal error running command: TypeError: Cannot read properties of undefined (reading 'jwproxy')
[debug] [XCUITestDriver@4bd3 (e377915a)]     at sessionInfo (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:140:52)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at /Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:33:36
[debug] [XCUITestDriver@4bd3 (e377915a)]     at Generator.next (<anonymous>)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at /Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:8:71
[debug] [XCUITestDriver@4bd3 (e377915a)]     at new Promise (<anonymous>)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at __awaiter (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:4:12)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at find (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:22:12)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at WaitCommandPlugin.<anonymous> (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/plugin.js:41:38)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at Generator.next (<anonymous>)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at /Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/plugin.js:8:71
[debug] [XCUITestDriver@4bd3 (e377915a)]     at new Promise (<anonymous>)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at __awaiter (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/plugin.js:4:12)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at WaitCommandPlugin.findElement (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/plugin.js:39:16)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at /Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/lib/appium.js:734:35
[debug] [XCUITestDriver@4bd3 (e377915a)]     at AppiumDriver.executeWrappedCommand (/Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/lib/appium.js:774:22)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at AppiumDriver.executeCommand (/Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/lib/appium.js:696:28)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at asyncHandler (/Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:393:32)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at /Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:518:15
[debug] [XCUITestDriver@4bd3 (e377915a)]     at Layer.handle [as handle_request] (/Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at next (/Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/node_modules/express/lib/router/route.js:144:13)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at Route.dispatch (/Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/node_modules/express/lib/router/route.js:114:3)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at Layer.handle [as handle_request] (/Users/xxxx/.nvm/versions/node/v18.16.0/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[HTTP] <-- POST /session/e377915a-b4f4-4cce-a62f-4a151408e927/element 500 25 ms - 743
[HTTP] 
[HTTP] --> DELETE /session/e377915a-b4f4-4cce-a62f-4a151408e927
[HTTP] {}
[debug] [XCUITestDriver@4bd3 (e377915a)] Calling AppiumDriver.deleteSession() with args: ["e377915a-b4f4-4cce-a62f-4a151408e927"]
[AppiumDriver@aaa2] Plugins which can handle cmd 'deleteSession': element-wait
[AppiumDriver@aaa2] Plugin element-wait is now handling cmd 'deleteSession'
[AppiumDriver@aaa2] Executing default handling behavior for command 'deleteSession'
[debug] [AppiumDriver@aaa2] Event 'quitSessionRequested' logged at 1687245925464 (09:25:25 GMT+0200 (Central European Summer Time))
[AppiumDriver@aaa2] Removing session e377915a-b4f4-4cce-a62f-4a151408e927 from our master session list
[debug] [XCUITestDriver@4bd3 (e377915a)] Matched '/session/e377915a-b4f4-4cce-a62f-4a151408e927' to command name 'deleteSession'
[debug] [XCUITestDriver@4bd3 (e377915a)] Proxying [DELETE /session/e377915a-b4f4-4cce-a62f-4a151408e927] to [DELETE http://127.0.0.1:8100/session/36641397-BF19-4B4B-AA7B-4FDE8D361CE0] with no body
[debug] [XCUITestDriver@4bd3 (e377915a)] Got response with status 200: {"value":null,"sessionId":null}
[DevCon Factory] Releasing connections for 6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F device on any port number
[DevCon Factory] Found cached connections to release: ["6B4B083D-5F01-4B6D-88D1-175A4AFA3C4F:8100"]
[debug] [DevCon Factory] Cached connections count: 0
[debug] [XCUITestDriver@4bd3 (e377915a)] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [IOSSimulatorLog] Stopping iOS log capture
[debug] [AppiumDriver@aaa2] Event 'quitSessionFinished' logged at 1687245926526 (09:25:26 GMT+0200 (Central European Summer Time))
[debug] [AppiumDriver@aaa2] Received response: null
[debug] [AppiumDriver@aaa2] But deleting session, so not returning
[debug] [AppiumDriver@aaa2] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /session/e377915a-b4f4-4cce-a62f-4a151408e927 200 1063 ms - 14

What I have observed is that session is created successfully and app is launched but the script fails at the findElement because of the wait-plugin.
Command 'findElement' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command was handled by these: ["element-wait"].
Encountered internal error running command: TypeError: Cannot read properties of undefined (reading 'jwproxy')_

As you can see in the logs response that the error is caused because of the following reasons:

[debug] [XCUITestDriver@4bd3 (e377915a)] Calling AppiumDriver.findElement() with args: ["accessibility id","Activity Indicators","e377915a-b4f4-4cce-a62f-4a151408e927"]
[AppiumDriver@aaa2] Plugins which can handle cmd 'findElement': element-wait
[AppiumDriver@aaa2] Plugin element-wait is now handling cmd 'findElement'
[wait-plugin] Timeout properties not set for session e377915a-b4f4-4cce-a62f-4a151408e927, trying to set one
[wait-plugin] Timeout properties set for session e377915a-b4f4-4cce-a62f-4a151408e927 is {"timeout":10000,"intervalBetweenAttempts":500,"overrideTimeout":false} ms
[AppiumDriver@aaa2] Command 'findElement' was *not* handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command *was* handled by these: ["element-wait"].
[debug] [XCUITestDriver@4bd3 (e377915a)] Encountered internal error running command: TypeError: Cannot read properties of undefined (reading 'jwproxy')
[debug] [XCUITestDriver@4bd3 (e377915a)]     at sessionInfo (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:140:52)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at /Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:33:36
[debug] [XCUITestDriver@4bd3 (e377915a)]     at Generator.next (<anonymous>)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at /Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:8:71
[debug] [XCUITestDriver@4bd3 (e377915a)]     at new Promise (<anonymous>)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at __awaiter (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:4:12)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at find (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/element.js:22:12)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at WaitCommandPlugin.<anonymous> (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/plugin.js:41:38)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at Generator.next (<anonymous>)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at /Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/plugin.js:8:71
[debug] [XCUITestDriver@4bd3 (e377915a)]     at new Promise (<anonymous>)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at __awaiter (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/plugin.js:4:12)
[debug] [XCUITestDriver@4bd3 (e377915a)]     at WaitCommandPlugin.findElement (/Users/xxxx/.appium/node_modules/appium-wait-plugin/lib/plugin.js:39:16)

Could you please look into this issue what may be causing this problem?

find elements not working for iOS platform it wait for 40 sec

[debug] [XCUITestDriver@1a9e (5f06c4da)] Calling AppiumDriver.findElements() with args: ["xpath","//XCUIElementTypeButton[contains(@name,'Heart') and contains(@name,'selected')]","5f06c4da-6fc1-486b-b694-909b33b49e47"]
[AppiumDriver@1acc] Plugins which can handle cmd 'findElements': element-wait
[AppiumDriver@1acc] Plugin element-wait is now handling cmd 'findElements'
[AppiumDriver@1acc] Executing default handling behavior for command 'findElements'
[debug] [XCUITestDriver@1a9e (5f06c4da)] Executing command 'findElements'
[debug] [XCUITestDriver@1a9e (5f06c4da)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[debug] [XCUITestDriver@1a9e (5f06c4da)] Waiting up to 40000 ms for condition
[debug] [XCUITestDriver@1a9e (5f06c4da)] Matched '/elements' to command name 'findElements'
[debug] [XCUITestDriver@1a9e (5f06c4da)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/BF10DD05-C5BF-413B-8889-FF84AB42A317/elements] with body: {"using":"xpath","value":"//XCUIElementTypeButton[contains(@name,'Heart') and contains(@name,'selected')]"}
[debug] [XCUITestDriver@1a9e (5f06c4da)] Got response with status 200: {"value":[],"sessionId":"BF10DD05-C5BF-413B-8889-FF84AB42A317"}
[debug] [XCUITestDriver@1a9e (5f06c4da)] Waited for 547 ms so far
[debug] [XCUITestDriver@1a9e (5f06c4da)] Matched '/elements' to command name 'findElements'
[debug] [XCUITestDriver@1a9e (5f06c4da)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/BF10DD05-C5BF-413B-8889-FF84AB42A317/elements] with body: {"using":"xpath","value":"//XCUIElementTypeButton[contains(@name,'Heart') and contains(@name,'selected')]"}
[debug] [XCUITestDriver@1a9e (5f06c4da)] Got response with status 200: {"value":[],"sessionId":"BF10DD05-C5BF-413B-8889-FF84AB42A317"}
[debug] [XCUITestDriver@1a9e (5f06c4da)] Waited for 1592 ms so far

Appium v - 2.0.0-beta.65 , [email protected] , [email protected]

findElement() not working with IOSDriver if I start appium server with element-wait plugin

Step 1) Installed element-wait version : 1.4.0
Step 2) Started server using command : appium --use-plugins=element-wait
Step 3) Trying to run the below code :
_@test
void iOSTapTest() throws MalformedURLException, InterruptedException {
XCUITestOptions options = new XCUITestOptions();
options.setApp(System.getProperty("user.dir")+"/apps/iOS-Simulator-MyRNDemoApp.1.3.0-162.zip");
options.setDeviceName("iPhone 11 Pro");
options.setPlatformName("iOS");
options.setAutomationName("XCuiTest");
IOSDriver iosDriver = new IOSDriver(new URL("http://127.0.0.1:4723"),options);
Thread.sleep(10000);
WebElement ele = iosDriver.findElement(By.xpath("//XCUIElementTypeButton[@name='tab bar option menu']"));
ele.click();

  }_

Step 4) Appium Server logs:

[debug] [XCUITestDriver@ec88 (59853a01)] Calling AppiumDriver.findElement() with args: ["xpath","//XCUIElementTypeButton[@name='tab bar option menu']","59853a01-c637-45bd-bfaf-1bfde65462b8"]
[AppiumDriver@e07f] Plugins which can handle cmd 'findElement': element-wait
[AppiumDriver@e07f] Plugin element-wait is now handling cmd 'findElement'
[wait-plugin] Timeout properties not set for session 59853a01-c637-45bd-bfaf-1bfde65462b8, trying to set one
[wait-plugin] Timeout properties set for session 59853a01-c637-45bd-bfaf-1bfde65462b8 is {"timeout":10000,"intervalBetweenAttempts":500,"overrideTimeout":false} ms
[AppiumDriver@e07f] Command 'findElement' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command was handled by these: ["element-wait"].
[debug] [XCUITestDriver@ec88 (59853a01)] Encountered internal error running command: TypeError: Cannot read properties of undefined (reading 'jwproxy')
[debug] [XCUITestDriver@ec88 (59853a01)] at sessionInfo (/Users/q/.appium/node_modules/appium-wait-plugin/lib/element.js:140:52)
[debug] [XCUITestDriver@ec88 (59853a01)] at /Users/q/.appium/node_modules/appium-wait-plugin/lib/element.js:33:36
[debug] [XCUITestDriver@ec88 (59853a01)] at Generator.next ()
[debug] [XCUITestDriver@ec88 (59853a01)] at /Users/q/.appium/node_modules/appium-wait-plugin/lib/element.js:8:71
[debug] [XCUITestDriver@ec88 (59853a01)] at new Promise ()
[debug] [XCUITestDriver@ec88 (59853a01)] at __awaiter (/Users/q/.appium/node_modules/appium-wait-plugin/lib/element.js:4:12)
[debug] [XCUITestDriver@ec88 (59853a01)] at find (/Users/q/.appium/node_modules/appium-wait-plugin/lib/element.js:22:12)
[debug] [XCUITestDriver@ec88 (59853a01)] at WaitCommandPlugin. (/Users/q/.appium/node_modules/appium-wait-plugin/lib/plugin.js:41:38)
[debug] [XCUITestDriver@ec88 (59853a01)] at Generator.next ()
[debug] [XCUITestDriver@ec88 (59853a01)] at /Users/q/.appium/node_modules/appium-wait-plugin/lib/plugin.js:8:71
[debug] [XCUITestDriver@ec88 (59853a01)] at new Promise ()
[debug] [XCUITestDriver@ec88 (59853a01)] at __awaiter (/Users/q/.appium/node_modules/appium-wait-plugin/lib/plugin.js:4:12)
[debug] [XCUITestDriver@ec88 (59853a01)] at WaitCommandPlugin.findElement (/Users/q/.appium/node_modules/appium-wait-plugin/lib/plugin.js:39:16)
[debug] [XCUITestDriver@ec88 (59853a01)] at /opt/homebrew/lib/node_modules/appium/lib/appium.js:734:35
[debug] [XCUITestDriver@ec88 (59853a01)] at AppiumDriver.executeWrappedCommand (/opt/homebrew/lib/node_modules/appium/lib/appium.js:774:22)
[debug] [XCUITestDriver@ec88 (59853a01)] at AppiumDriver.executeCommand (/opt/homebrew/lib/node_modules/appium/lib/appium.js:696:28)
[debug] [XCUITestDriver@ec88 (59853a01)] at asyncHandler (/opt/homebrew/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:387:32)
[debug] [XCUITestDriver@ec88 (59853a01)] at /opt/homebrew/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:512:15
[debug] [XCUITestDriver@ec88 (59853a01)] at Layer.handle [as handle_request] (/opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [XCUITestDriver@ec88 (59853a01)] at next (/opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/route.js:144:13)
[debug] [XCUITestDriver@ec88 (59853a01)] at Route.dispatch (/opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/route.js:114:3)
[debug] [XCUITestDriver@ec88 (59853a01)] at Layer.handle [as handle_request] (/opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [XCUITestDriver@ec88 (59853a01)] at /opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/index.js:284:15
[debug] [XCUITestDriver@ec88 (59853a01)] at param (/opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/index.js:365:14)
[debug] [XCUITestDriver@ec88 (59853a01)] at param (/opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/index.js:376:14)
[debug] [XCUITestDriver@ec88 (59853a01)] at Function.process_params (/opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/index.js:421:3)
[debug] [XCUITestDriver@ec88 (59853a01)] at next (/opt/homebrew/lib/node_modules/appium/node_modules/express/lib/router/index.js:280:10)
[debug] [XCUITestDriver@ec88 (59853a01)] at logger (/opt/homebrew/lib/node_modules/appium/node_modules/morgan/index.js:144:5)
[HTTP] <-- POST /session/59853a01-c637-45bd-bfaf-1bfde65462b8/element 500 37 ms - 691
[HTTP]
[XCUITestDriver@ec88 (59853a01)] Shutting down because we waited 60 seconds for a command
[AppiumDriver@e07f] Ending session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'
[debug] [AppiumDriver@e07f] Plugin element-wait does not define an unexpected shutdown handler
[AppiumDriver@e07f] Removing session '59853a01-c637-45bd-bfaf-1bfde65462b8' from our master session list
[DevCon Factory] Releasing connections for 4DA0152E-6B3A-4BB3-8DE1-B78690B47115 device on any port number
[DevCon Factory] Found cached connections to release: ["4DA0152E-6B3A-4BB3-8DE1-B78690B47115:8100"]
[debug] [DevCon Factory] Cached connections count: 0
[debug] [XCUITestDriver@ec88 (59853a01)] Not clearing log files. Use clearSystemFiles capability to turn on.
[debug] [IOSSimulatorLog] Stopping iOS log capture

Error loading plugin while starting appium server

Appium version: 2.4.1
Plugin version: 3.0.0

Appium Server log:

[Appium] Attempting to load plugin element-wait...
[Appium] Requiring plugin at /private/tmp/some-temp-dir/node_modules/appium-wait-plugin/lib/index.js
[Appium] Could not load plugin 'element-wait', so it will not be available. Error in loading the plugin was: Cannot find module '@appium/base-plugin'
[Appium] Require stack:
[Appium] - /private/tmp/some-temp-dir/node_modules/appium-wait-plugin/lib/plugin.js
[Appium] - /private/tmp/some-temp-dir/node_modules/appium-wait-plugin/lib/index.js
[Appium] Error: Cannot find module '@appium/base-plugin'
[Appium] Require stack:
[Appium] - /private/tmp/some-temp-dir/node_modules/appium-wait-plugin/lib/plugin.js
[Appium] - /private/tmp/some-temp-dir/node_modules/appium-wait-plugin/lib/index.js
[Appium] at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
[Appium] at Function.Module._load (node:internal/modules/cjs/loader:873:27)
[Appium] at Module.require (node:internal/modules/cjs/loader:1100:19)
[Appium] at require (node:internal/modules/cjs/helpers:119:18)
[Appium] at Object. (/private/tmp/some-temp-dir/node_modules/appium-wait-plugin/lib/plugin.js:15:39)
[Appium] at Module._compile (node:internal/modules/cjs/loader:1198:14)
[Appium] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
[Appium] at Module.load (node:internal/modules/cjs/loader:1076:32)
[Appium] at Function.Module._load (node:internal/modules/cjs/loader:911:12)
[Appium] at Module.require (node:internal/modules/cjs/loader:1100:19)
[Appium] at require (node:internal/modules/cjs/helpers:119:18)
[Appium] at Object. (/private/tmp/some-temp-dir/node_modules/appium-wait-plugin/lib/index.js:7:34)
[Appium] at Module._compile (node:internal/modules/cjs/loader:1198:14)
[Appium] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
[Appium] at Module.load (node:internal/modules/cjs/loader:1076:32)
[Appium] at Function.Module._load (node:internal/modules/cjs/loader:911:12)

Python Support?

Does this currently support python?

Integrated into my test suite & cannot get it to find the element, it times out..

I can see JS uses driver.findElement where as the python equivelant is driver.find_element

Is python supported or am i doing something wrong?!

Any help would be great.

Log:
--> POST /session/eea7fcc4-e676-4209-9c24-dbbd1eb3a4da/element
[HTTP] {"using":"css selector","value":"[id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"]"}
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] Calling AppiumDriver.findElement() with args: ["css selector","[id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"]","eea7fcc4-e676-4209-9c24-dbbd1eb3a4da"]
[AppiumDriver@0a01] Plugins which can handle cmd 'findElement': element-wait
[AppiumDriver@0a01] Plugin element-wait is now handling cmd 'findElement'
| Waiting to find element with css selector strategy for [id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"] selector[HTTP] --> GET /session/bf4942bf-5ca8-4b62-aed4-fafeadf612c3/timeouts
[HTTP] {}
[debug] [AppiumDriver@0a01] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started
[debug] [AppiumDriver@0a01] at asyncHandler (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules@appium\base-driver\lib\protocol\protocol.js:315:15)
[debug] [AppiumDriver@0a01] at C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules@appium\base-driver\lib\protocol\protocol.js:518:15
[debug] [AppiumDriver@0a01] at Layer.handle [as handle_request] (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [AppiumDriver@0a01] at next (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:144:13)
[debug] [AppiumDriver@0a01] at Route.dispatch (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:114:3)
[debug] [AppiumDriver@0a01] at Layer.handle [as handle_request] (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [AppiumDriver@0a01] at C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:284:15
[debug] [AppiumDriver@0a01] at param (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:365:14)
[debug] [AppiumDriver@0a01] at param (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:376:14)
[debug] [AppiumDriver@0a01] at Function.process_params (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:421:3)
[debug] [AppiumDriver@0a01] at next (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:280:10)
[debug] [AppiumDriver@0a01] at logger (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\morgan\index.js:144:5)
[debug] [AppiumDriver@0a01] at Layer.handle [as handle_request] (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [AppiumDriver@0a01] at trim_prefix (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:328:13)
[debug] [AppiumDriver@0a01] at C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:286:9
[debug] [AppiumDriver@0a01] at Function.process_params (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:346:12)
[debug] [AppiumDriver@0a01] at next (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:280:10)
[debug] [AppiumDriver@0a01] at jsonParser (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\body-parser\lib\types\json.js:113:7)
[debug] [AppiumDriver@0a01] at Layer.handle [as handle_request] (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [AppiumDriver@0a01] at trim_prefix (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:328:13)
[debug] [AppiumDriver@0a01] at C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:286:9
[debug] [AppiumDriver@0a01] at Function.process_params (C:\Users\kieba\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:346:12)
[HTTP] <-- GET /session/bf4942bf-5ca8-4b62-aed4-fafeadf612c3/timeouts 404 26 ms - 3231
[HTTP]
× Waiting to find element with css selector strategy for [id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"] selector
[AppiumDriver@0a01] Command 'findElement' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command was handled by these: ["element-wait"].
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] Encountered internal error running command: NoSuchElementError: Time out after waiting for element [id="com.yourdolphin.easyreader:id/intro_welcome_skip_button"] for 10000 ms
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] at C:\Users\kieba.appium\node_modules\appium-wait-plugin\lib\element.js:73:23
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] at Generator.throw ()
[debug] [AndroidUiautomator2Driver@9e45 (eea7fcc4)] at rejected (C:\Users\kieba.appium\node_modules\appium-wait-plugin\lib\element.js:6:65)
[HTTP] <-- POST /session/eea7fcc4-e676-4209-9c24-dbbd1eb3a4da/element 404 10020 ms - 540

Ignore wait for element checks

Plugin should open options to disable for element check as well.

For Example:
When you are looking for element and adding login to scroll. This plugin will wait for given time for each element check. I would like to disable the element check in these cases.

cc: @Dileep17 @SrinivasanTarget

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.