Appium Error:main.js: error: Unrecognized arguments: --no-session-override - ios

I am trying to record iOS automated Tests using Appium Inspector by instructions using tutorial..
http://www.youtube.com/watch?v=Hv9A9WfYF4g
I have my app on workspace. I built it using iphonesimulator7.0 which showed a sucess message then correctly set the path to the built app on appium inspector. But when i click Launch it shows the error.
Appium Error:main.js: error: Unrecognized arguments: --no-session-override
on its console..Any idea what might be the problem.
PS:Am using appium for the first time
above is the screenshot that i get when i click launch button..

Please check whether Override Existing Sessions checkbox is checked or not. It should be checked.
Appium -- > Preferences ---> General

Related

UIAutomatorViewer is not working. Error obtaining UI Hiearchy. Unexpected error while obtaining UI Hiearchy

I have stoppped appium server and then I tried to capture object through UIAutomatorViewer, but still it throws the error as "Unexpected error while obtaining UI Hierarchy". I have tried the following options.
Stop Appium server in the background.
Disconnected mobile device & connect it back.
3.close the uiautomatorviewer.bat file & restart it again.
Restarted the device
a. Turn on USB DEBUGGING
b. Enable view attribute inspection
c. Select the debug app option and choose io.appium.uiautomator2.server
adb devices to recognise my device.
I have exit and restarted uiautomatorviewer
After tried all the above options, still I get the same error.
Please help to get this issue resolved.
UIAutomatorviewer Error

Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Keyboard is not present" UserInfo={NSLocalizedDescription=Keyboard is not present}

My simulator keyboard is not displayed when I run my test cases from automation. I keep getting the below error.
Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Keyboard is not present" UserInfo={NSLocalizedDescription=Keyboard is not present}
When my automation code opens simulator, In simulator->Harward->keyboard->Connect Hardware keyboard is unchecked and I am not able to check that.
And when I open simulator normally I get the simulator keyboard and the option Connect hardware Keyboard is also selected by default
Can anyone help me out here.
Its a known WebDriverAgent issue: https://github.com/facebook/WebDriverAgent/issues/574
Try to update to latest Appium server 1.9.1 to use latest version of WebDriverAgent.
If it won't help, follow suggestion from the last comment on github issue:
Before tests run bash script defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool no
Add turn off hardware keyboard as it seems to cause failures occasionally
error occurs when you use ios simulator.
To solve this use below command for enabling keyboard.
1.Restart your Xcode if it's already open. Then use below keys.
For opening and closing keyboard you can use below shortcuts.
cmd + k
If first option doesn't work then set below capabilities in your script.
2.
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("Connect Hardware Keyboard", true);
OR
(capabilities.setCapability(IOSMobileCapabilityType.CONNECT_HARDWARE_KEYBOARD, true)
I resolved this on iOS for Mobile app automation using Appium
Set the capability to not refer to the hardware keyboard
cap.setCapability("connectHardwareKeyboard", false);
While executing the case, where you need to access the keyboard use
driver.findElementByXPath("****** ").sendKeys("Text")
After getting the input on the field, dismiss the keyboard
driver.hideKeyboard()
iOS:Real Device
Uninstall if you have installed any third party keyboards, keep only the default keyboard on the device.
Re run the same code. It should work now
Uninstalling Keyboards: Settings ->General -> KeyBoards-> Edit

Build successful but unable to run on iOS simulator

I am making a demo of cordova app. The console log is showing me build successful but after sometime it shows this error and run fails :
2016-07-30 09:34:47.609 instruments[9268:1431174] WebKit Threading
Violation - initial use of WebKit from a secondary thread. Instruments
Usage Error: Unknown device specified:
"B7257830-92A2-4C85-A4BA-342D7237F9A8"
Known Devices:
test's iPhone (8.4.1) [7fdfcc5aaeb179fdb53a86343ba18796a1825bc4]
The error is to replace UDID with known devices but I am unable find the file where it is mentioned.
Please share the path of file or file name or anything related to this error. Thanks in advance.
I solved this error simply following two steps.
Step 1: Go to Run Options and select Run Configuration as image shown below.
Step 2 : Now a window will open as shown below & select your device from simulator list.

Simple XCTest for UITest is failing all the time?

I start a new project from File -> New -> project
I add a button to ViewController.
I open UITest folder which created by xcode by default. Run the test code.
It fails:
2016-03-16 12:57:09.191 XCTRunner[3511:150419] Continuing to run tests in the background with task ID 1
t = 10.18s Assertion Failure: UI Testing Failure - Failed to background test runner.
/Users/Bernard/Desktop/ExampleTestApplication/ExampleTestApplicationUITests/test2.m:27: error: -[test2 testExample] : UI Testing Failure - Failed to background test runner.
2016-03-16 12:57:12.789 XCTRunner[3511:150419] *** Terminating app due to uncaught exception '_XCTestCaseInterruptionException', reason: 'Interrupting test'
Now I add a break point as follow:
Now test is successful! Anyone can explain the reason?
I was also facing same issues and none of the available solutions worked for me. Issue was not letting app to attach to the simulator itself.
I checked the log and saw that i did a mistake in code while locating the element. for Predicate instead of BEGINSWITH i wrote STARTSWITH and this was stopping the app to get attached.
So check your logs in the test report to get the issue.
I was getting this error happening when the iOS simulator was already launched (which may not necessarily mean you can see it in the OS X dock). You can check the state of the various simulators using the simctl command.
I.e.
xcrun simctl list devices
Then, ensure that any devices listed as "Booted" are shutdown:
xcrun simctl shutdown <device-udid-here>
Then, try running your UI tests again.

calabash-ios physical device test, app starts but crashes

Running calabash-ios cucumber for simple iPhone app. Simulator is working perfectly. When trying on physical device, app loads, crashes, then loads again, and crashes again, on a loop.
Error message:
Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator version
Calabash::Cucumber::Launcher::StartError: Time out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.
Logfile /var/folders/9s/yttj4cz93m98hqs6bfw2x8xr0000gn/T/run_loop20150522-12657-dr3m49/run_loop.out
2015-05-22 19:58:11 +0000 Fail: An error occurred while trying to run the script.
Instruments Trace Complete (Duration : 2.594758s; Output : /var/folders/9s/yttj4cz93m98hqs6bfw2x8xr0000gn/T/run_loop20150522-12657-dr3m49/trace.trace)
to run the script. UIAScriptAgentSignaledException
(Calabash::Cucumber::Launcher::StartError)
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:766:in `new_run_loop'
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:631:in `relaunch'
Steps:
loaded app-cal on device
ran in command-line using:
$ DEVICE_TARGET=udid BUNDLE_ID=com.company.app DEVICE_ENDPOINT=http://ip:37265
Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError
The probably cause of this is that the device is not enabled for UIAutomation. The device must be enabled for development. A device is enabled for development if it appears in Xcode's Device's window (Shift + Command +2) and you must enable on-device testing manually by visiting the device's Settings.app > Developer tab.
If you have recently upgraded the iOS version we recommend that you check the UIAutomation settings again and perform a restart. Often, after an upgrade, Xcode cannot download debugging information from the device. Look at Xcode's Device's window. The device must appear without any warnings.
Sometimes devices get into a bad state and Xcode cannot communicate with it. We recommend trying to interact with the device with Apple's Instruments to clear this bad state.
All this information and more can be found on the Calabash iOS Hot Topics page. https://github.com/calabash/calabash-ios/wiki/Hot-Topics#6-errnoeintr-interrupted-system-call

Resources