0

Using appium 1.7.2, my test ran correctly and never had any issue with clearing text field with element.clear. but now since i upgrade my appium to 1.8.0 element.clear seems to stop working. it didn't throw any errors, it just not doing anything. Besides, my AUT component is using React-Native and the dev just upgrade it and change their library to Redux Form or something like that

Im using ruby, cucumber, XCode 9.2, XCuiTest 2.80, appium 1.8.0, iPhone 7 Simulator with iOS 11.2

2 Answers 2

1

I've seen this particular situation reported by various users and the general consensus solution is to manually determine the length of the existing text contents, then literally send one delete character in a loop until the field is empty. Obviously .clear() should work but apparently in many cases it doesn't.

I don't code in ruby, so I can't show you a coding example, but I'm sure it's simple enough that you should be able to go on the concept and write your own code.

0

I don't code in ruby but I have faced same issue that time I used java code .By the given answer atleast you can get idea & you will able to write code in your programming langauge.

        IOSElement customrPhone = driver.findElement(By.name("Value of text field"));
        String text1 = customrPhone.getText();
        int maxChars1 = text1.length();
        for(int i =0;i < maxChars1;i++) {
        customrPhone.sendKeys(Keys.BACK_SPACE);
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.