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

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}"]}

Related

UnhandledPromiseRejectionWarning: WebDriverError: unknown error: Chrome failed to start: crashed error running Selenium tests with docker-compose

while trying to run slenium tests from docker which we use in most projects i get this error saying chrome has crashed i 've both google chrome and chrome driver installed and working fine any help with this ?
(node:231) UnhandledPromiseRejectionWarning: WebDriverError: 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: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '1a84fd607b36', ip: '172.27.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.47-linuxkit', java.version: '1.8.0_292'
Driver info: driver.version: unknown
remote stacktrace: #0 0x00400068e949 <unknown>
This error message...
(node:231) UnhandledPromiseRejectionWarning: WebDriverError: 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: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '1a84fd607b36', ip: '172.27.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.47-linuxkit', java.version: '1.8.0_292'
Driver info: driver.version: unknown
remote stacktrace: #0 0x00400068e949 <unknown>
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as java.version: '1.8.0_292' and the error being:
Driver info: driver.version: unknown
remote stacktrace: #0 0x00400068e949 <unknown>
Solution
Ensure that:
JDK is upgraded to current levels JDK 8u311.
Selenium is upgraded to current levels Version 3.141.59.
ChromeDriver is updated to current ChromeDriver v95.0 level.
Chrome is updated to current Chrome Version 95.0 level. (as per ChromeDriver v95.0 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

Issue while inspecting hybrid app. Not able to find required selectors

I am automating a hybrid app using Appium, using real mobile device. So my code is written as below:
DesiredCapabilities capabilities = new DesiredCapabilities();
//capabilities.setCapability(CapabilityType.BROWSER_NAME,"Chrome");
capabilities.setCapability("deviceName", "77377f50");
capabilities.setCapability("platformVersion", "9");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("automationName", "uiautomator2");
capabilities.setCapability("autoWebview", "true");
capabilities.setCapability("appium:chromeOptions", ImmutableMap.of("w3c", false));
capabilities.setCapability("appPackage", "com.englishbolo.android.alpha");
capabilities.setCapability("appActivity", "com.englishbolo.android.ui.EnglishBoloSplashScreen filter 36b63470");
capabilities.setCapability(MobileCapabilityType.FULL_RESET,false);
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
Set <String> contextNames = driver.getContextHandles();
for (String contextName : contextNames)
{
System.out.println("Available Context:"+contextName);
}
driver.context((String) contextNames.toArray()[1]);
driver.findElement(By.xpath("//android.view.View[contains(#resource-id,'en_US')]")).click();
driver.findElement(By.xpath("//android.widget.Button[contains(#resource-id,'OK')]")).click();
driver.findElement(By.xpath("//android.view.View[#text='SIGNUP FREE']")).click();
driver.findElementByClassName("android.widget.Spinner").click();
driver.findElementByXPath("//android.widget.EditText[contains(#resource-id,'userFullName')]").sendKeys("ebuat");
driver.findElementByXPath("//android.view.View[#text='Sri Lanka+94']").click();
driver.findElementByXPath("//android.widget.EditText[contains(#resource-id,'userPhone')]").sendKeys("744693540");
driver.findElementByXPath("//android.widget.EditText[contains(#resource-id,'userPassword')]").sendKeys("1234");
driver.findElementByXPath("//android.widget.EditText[contains(#resource-id,'userMailId')]").sendKeys("ebuatuser_nov18#sharklasers.com");
driver.hideKeyboard();
driver.findElementByXPath("//android.widget.Button[#text='SUBMIT']").click();
driver.findElementByXPath("//android.widget.Button[#text='START NOW']").click();
After this last click action i need to click on radio buttons but after inspecting in appium desktop, only class as a locator is present.
For all radio button class android.view.View is the locator present.
I have used xpath using class name, text * resource-id present. If only classname is present So how can I form xpath to click on radio buttons?
Set <String> contextNames = driver.getContextHandles();
for (String contextName : contextNames)
{
System.out.println("Available Context:"+contextName);
}
driver.context((String) contextNames.toArray()[1]);
Also I have written method getContextHandles to set view to WebView.
Error observed after writing this method:
INFO: HTTP Status: '400' -> incorrect JSON status mapping for 'unknown error' (500 expected)
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: No such context found.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'englishhelper-MS-7A15', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-52-generic', java.version: '12.0.1'
Driver info: driver.version: AndroidDriver
remote stacktrace: NoSuchContextError: No such context found.
at AndroidUiautomator2Driver.setContext (/tmp/.mount_AppiumZrt5AD/resources/app/node_modules/appium/node_modules/appium-android-driver/lib/commands/context.js:57:11)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'englishhelper-MS-7A15', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-52-generic', java.version: '12.0.1'
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:84)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:94)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:95)
at appium_new.AppiumSignup.main(AppiumSignup.java:62)
Caused by: java.lang.reflect.InvocationTargetException
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:567)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
... 13 more
Caused by: org.openqa.selenium.WebDriverException: No such context found.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'englishhelper-MS-7A15', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-52-generic', java.version: '12.0.1'
Driver info: driver.version: AndroidDriver
remote stacktrace: NoSuchContextError: No such context found.
at AndroidUiautomator2Driver.setContext (/tmp/.mount_AppiumZrt5AD/resources/app/node_modules/appium/node_modules/appium-android-driver/lib/commands/context.js:57:11)
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.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
... 18 more
Can you please help me with the solutions you may know.

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

Problems starting iOS driver

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).

Resources