Problems starting iOS driver - ios

I am having difficulty with executing a test with my driver.
1) I start my server with the following (grid does not start as I am getting kicked out… for another thread)
java -jar ios-server-standalone-0.6.6-SNAPSHOT.jar -port 1111
2) I launch a test from the respective directory
3) The logs dump the following:
The server cannot run Capabilities [{platform=MAC, cssSelectorsEnabled=false, CFBundleIdentifier=com.apple.mobilesafari, javascriptEnabled=true, nativeEvents=false, locale=en_GB, CFBundleName=Safari, variation=Retina4, device=iphone, rotatable=false, takesScreenshot=false, sdkVersion=7.1, version=}] at the moment.org.uiautomation.ios.application.APPIOSApplication cannot be cast to org.uiautomation.ios.application.IPAApplication
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: '(hidden for privacy)', ip: '(hidden for privacy)', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_67'
Driver info: driver.version: unknown
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: '(hidden for privacy)', ip: '(hidden for privacy)', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_67'
Driver info: driver.version: unknown (org.openqa.selenium.SessionNotCreatedException) (Selenium::WebDriver::Error::WebDriverError)
[remote server] org.uiautomation.ios.command.uiautomation.NewSessionNHandler(NewSessionNHandler.java):100:in `safeStart'
What is the root cause?

Having had the exact same issue, you could try using
capabilities.setCapability("simulator", true);
This got me past this issue at least (and into another one).

Related

Error: io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0

2022-06-07 09:14:19.862 DEBUG testcase.TEST - 8: switchToWindow(findWindowsObject("Object Repository/mainWindow/mainFrame"))
lut 20, 2020 9:14:20 AM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
INFO: Detected dialect: OSS
2020-02-20 09:14:20.033 DEBUG testcase.TEST - 9: click(findWindowsObject("Object Repository/mainWindow/menuItem", ["itemName":"KOI"]))
2020-02-20 09:14:21.419 ERROR c.k.k.core.keyword.internal.KeywordMain - ❌ An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'APS00076262-MB', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: io.appium.java_client.windows.WindowsDriver
Capabilities {appTopLevelWindow: 808ba, javascriptEnabled: true, platform: WINDOWS, platformName: WINDOWS}
Session ID: B4334F10-B953-4EF6-B814-E43A3B191EFA
*** Element info: {Using=xpath, value=//MenuItem[#Name="${itemName}"]} (Root cause: org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'APS00076262-MB', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: io.appium.java_client.windows.WindowsDriver
Capabilities {appTopLevelWindow: 808ba, javascriptEnabled: true, platform: WINDOWS, platformName: WINDOWS}
Session ID: B4334F10-B953-4EF6-B814-E43A3B191EFA
*** Element info: {Using=xpath, value=//MenuItem[#Name="${itemName}"]}

Driver info: driver.version: unknown error running Selenium and Codeception in DDEV (Mac M1)

I was using VirtualBox for development when i had a windows pc. Later i bought a Macbook M1 and installed the DDEV instead of VirtualBox.
In my old development virtualbox, i installed selenium and chromedriver in Virtualbox. With this setup i could run Codeception Tests.
Since i'm using DDEV for development, i tired to install Selenium-chromedriver with following tutorials:
https://dev.to/tomasnorre/codeception-ddev-selenium-docker-36kk
https://docs.typo3.org/m/typo3/reference-coreapi/9.5/en-us/Testing/ProjectTesting.html
My docker-compose.selenium.yaml File
version: '3.6'
services:
selenium:
container_name: ddev-${DDEV_SITENAME}-chrome
image: selenium/standalone-chrome:latest
environment:
- VIRTUAL_HOST=$DDEV_HOSTNAME
- HTTP_EXPOSE=4444
external_links:
- ddev-router:$DDEV_HOSTNAME
codeception.yaml File
# suite config
suites:
acceptance:
actor: AcceptanceTester
path: .
modules:
enabled:
- WebDriver:
url: http://test.ddev.site
host: ddev-test-chrome
browser: chrome
- \Helper\Acceptance
I get following Error when i try to execute a Test in ddev ssh with php vendor/bin/codecept run tests/FirstCest.php
[Facebook\WebDriver\Exception\SessionNotCreatedException] Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
Is it possible, that the errors are related to M1-Chip or am i doing something wrong?
The selenium/standalone-chrome image is not built for arm64 (Mac M1). In fact, the chrome package it probably derives from is not available at all for arm64.
However, the chromium package is available for arm64. You may be able to use justinribeiro/chrome-headless:chromium, which is built for arm64.
Also, take a look at https://github.com/drud/ddev-contrib/tree/master/docker-compose-services/headless-chrome, which has been updated to use the arm64 chromium image.
This error message...
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
...implies that the ChromeDriver version wasn't detected.
Presumably the main issue is the incompatibility between the version of the binaries you are using.
Solution
Ensure that:
ChromeDriver is updated to current ChromeDriver v96.0 level.
Chrome is updated to current chrome=96.0.4664.45 (as per chrome=96.0.4664.45 release notes).

Launching appium server programmatically throws server-side error Could not find 'adb' in PATH

While launch appium server manually this issue doesnt occur.
Error log
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Could not find 'adb' in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'INSML-0VLLVCF', ip: 'fe80:0:0:0:c3f:fa48:d75f:bc45%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_251'
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find 'adb' in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:388:37)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'INSML-0VLLVCF', ip: 'fe80:0:0:0:c3f:fa48:d75f:bc45%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_251'
Driver info: driver.version: AndroidDriver
Run which aapt in terminal and check the output. Most likely it is empty.
If you didn't install adb, you can follow these steps
If you install it, then probably you didn't set path properly: run cat ~/.bash_profile and make sure to set path to ANDROID_HOME, assuming you did default path installation
export ANDROID_HOME=/Users/<your_username>/Library/Android/sdk
export PATH=$ANDROID_HOME:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH
export PATH=$ANDROID_HOME/build-tools/<sdk_version>:$PATH
You can check official Appium docs about environment issues troubleshoot

Not able to interact with application using any of the locator - throwing me 'Locator Strategy 'name' is not supported for this session'

Testing an Android app and not able interact with app
Tried with ID, xpath and other locator but still display same error message.
#AndroidFindBy(xpath = "//android.widget.Button[#text='English']")
public WebElement language;
#AndroidFindBy(xpath="//android.widget.Button[#text='GET STARTED']")
public WebElement start;
The error I am getting is:
FAILED: login org.openqa.selenium.InvalidSelectorException: Locator Strategy 'name' is not supported for this session For documentation on this error, please visit: seleniumhq.org/exceptions/invalid_selector_exception.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'nsubramani-mbp-1', ip: 'fe80:0:0:0:10b4:b83f:ee48:38b2%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_202' Driver info: io.appium.java_client.android.AndroidDriver

Error with iOS driver set up

As per the instruction with http://ios-driver.github.io/ios-driver/?page=setup , i am trying to set up ios driver my application first testing using this automation.
I have installed java 7 and downloaded the app in given link. Installed OSX 10.9. While executing the command $ java -jar ios-server-0.6.6-SNAPSHOT-standalone.jar -aut path/to/aut.app -port 4444 i am getting below error
45:08:315 INFO ApplicationStore.<init> App archive folder:/Users/labuser/Downloads/applications
false
45:08:838 SEVERE IOSServer.main cannot start ios-driver server: org.openqa.selenium.WebDriverException: path/to/aut.app isn't an IOS app.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9', java.version: '1.7.0_55'
Driver info: driver.version: unknown
Any one suggest me to resolve this error and am new to use commands in terminal
It looks like path/to/aut.app is a placeholder and you need to replace it with the path to your application.

Resources