I am seeing some strange behavior that I did not see previously. I've tried downgrading almost everything to the versions I was using previously and have so far had no luck in getting this to work again.
Environment:
Symptoms:
textfield.click now places the cursor at the beginning of the text (previously placed the cursor at the end or maybe center)textfield.clear cannot clear the text fields, fails with errorAn unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Failed to make any progress while clearing text" UserInfo={NSLocalizedDescription=Failed to make any progress while clearing text}
This happens much more often with text areas than text fields, but is happening 100% of the time with text areas.
As a workaround, I added code that catches that error and does select all/cut, but it is not working consistently. Also, in commit 45921ef, someone has recently removed that error so this workaround will stop working in a newer release.
I attempted another workaround to click the bottom right corner of each field but was unable to get this working. I'm not sure if that is caused by the same issue as this or if I just didn't do it right.
Can you provide a video?
@marekcirkos I am experiencing this issue clearing a text area field. More specifically, it is a UITextView field named questionTextField. The source for the automated test is at https://github.com/larryricker/ProjectOrganizerAppium. The video of the test and my attempts to mitigate it are at https://youtu.be/VDqJ8YiEHxU
Got similar problems with Appium 1.6.5 and iOS iPhone Simulator 10.3, anyone got a workaround?:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Failed to make any progress while clearing text" UserInfo={NSLocalizedDescription=Failed to make any progress while clearing text} (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.24 seconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'it-teamcity-mobile-agent-1.local', ip: '192.168.88.25', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_112'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities [{app=/Users/airhelp/teamcity/work/2910e3b7567b10fd/src/test/resources/apps/AirHelp.app, networkConnectionEnabled=false, databaseEnabled=false, deviceName=iPhone 6s, fullReset=true, platform=MAC, nativeInstrumentsLib=true, platformVersion=10.3, webStorageEnabled=false, locationContextEnabled=false, automationName=XCUITest, browserName=, takesScreenshot=true, javascriptEnabled=true, platformName=iOS, udid=59545CC1-4E01-4086-9D44-9FF5EEADBE8B}]
Session ID: 2ff4badb-cba2-4987-a110-f057ec649deb
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:274)
at io.appium.java_client.DefaultGenericMobileElement.execute(DefaultGenericMobileElement.java:33)
at io.appium.java_client.MobileElement.execute(MobileElement.java:1)
at io.appium.java_client.ios.IOSElement.execute(IOSElement.java:1)
at org.openqa.selenium.remote.RemoteWebElement.clear(RemoteWebElement.java:116)
at com.airhelp.qa.hawkeye.framework.DSL.sendKeys(DSL.java:76)
at com.airhelp.qa.hawkeye.page.objects.ios.IOSMainPage.claimSubmission(IOSMainPage.java:146)
at com.airhelp.qa.hawkeye.glue.ios.StepDefinitions.lambda$new$14(StepDefinitions.java:186)
at ✽.When I submit my claim successfully(src/test/resources/features/eligibility.feature:19)
This is an issue with Simulator. I got the same issue while clearing the text view in iPhone 6 10.3.1 simulator but the same worked fine in iPhone 5 10.3.1 simulator without any error.
@Sohan-Bakale this used to work with both of the simulators I mentioned in my first post and now it does not. If something with the simulators changed, the WebDriverAgent needs to be updated to accommodate.
@garie
This issue occurs when we try to clear a text field where we already have some text entered in it but the same works if we try to clear an empty text field.
The reason for this is whenever we try to clear any text field, appium first selects that text field and unfortunately it places it's cursor at the beggining of the text where as expected is to be at the end of the text so we need to do a small step before clearing the text field, we need to somehow place our cursor at the end of the text.
This worked for me.
((IOSDriver) driver).tap(1, element.getLocation().x + element.getSize().width - 10, element.getLocation().y + element.getSize().height - 10, 100);
100 is duration of tap in millisecs
width - 10 and height - 10 makes sure we are tapping inside our text area as tapping exactly at the bottom right corner doesn't work.
On appium Desktop 1.6.5. I am experiencing the same error using .Clear() on iOS.
{"An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Failed to make any progress while clearing text" UserInfo={NSLocalizedDescription=Failed to make any progress while clearing text}"}
I also get the same error back when I use the Clear button on the inspector.
Any suggestions?
Thanks!!
Facing the same issue today - could execute TextField.clear() command.
Will be there a fix in near future or this is a feature?
Environment: Appium Server ver. 1.7.2
Affected Platform: iOS only
Toggle the software keyboard under Hardware > Keyboard > Software Keyboard or Cmd + K and see your textfields working like a charm.
@haseebzagir I also got this by experience.
Thanks!
Most helpful comment
@garie
This issue occurs when we try to clear a text field where we already have some text entered in it but the same works if we try to clear an empty text field.
The reason for this is whenever we try to clear any text field, appium first selects that text field and unfortunately it places it's cursor at the beggining of the text where as expected is to be at the end of the text so we need to do a small step before clearing the text field, we need to somehow place our cursor at the end of the text.
This worked for me.
((IOSDriver) driver).tap(1, element.getLocation().x + element.getSize().width - 10, element.getLocation().y + element.getSize().height - 10, 100);
100 is duration of tap in millisecs
width - 10 and height - 10 makes sure we are tapping inside our text area as tapping exactly at the bottom right corner doesn't work.