Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appium 1.7.1/Xcode 9.1 clear function is not working anymore #9752

Closed
rakeshsukla53 opened this issue Dec 5, 2017 · 5 comments
Closed

Appium 1.7.1/Xcode 9.1 clear function is not working anymore #9752

rakeshsukla53 opened this issue Dec 5, 2017 · 5 comments
Labels
ThirdParty upstream problems XCUITest regarding xcuitest driver

Comments

@rakeshsukla53
Copy link

rakeshsukla53 commented Dec 5, 2017

The problem

I was able to use appium on Xcode version 8.3.3 covering devices that run iOS 10.x.x without any issues. Since upgrading to Xcode 9.1 and using iOS 11.x or iOS 10.x.x, the clear function is not working anymore. The clear function basically deletes all the text present in the iOS Textfield.
send_keys is working fine but not the clear function.

def clear_text(driver, locator, idx=None):
    try:
        if idx:
            find_elements(driver, locator)[idx].clear()
        else:
            find_element(driver, locator).clear()
    except NoSuchElementException:
        raise  # Make sure if the element isn't there we don't hide it.
    except WebDriverException:
        pass  # Ignore bizarre can't clear text errors.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.7.1
  • Last Appium version that did not exhibit the issue (if applicable): 1.6.5
  • Desktop OS/version used to run Appium: OS 11 current simulator version is 11
  • Mobile platform/version under test: iOS
  • Real device or emulator/simulator: Simulator
  • Appium CLI or Appium.app|exe: Appium CLI

Details

>>> el = find_element(driver, GuestbookView.search_list)
[12/05/2017 14:30:04] Find element Search
>>> el
<appium.webdriver.webelement.WebElement (session="9de50f6c-60eb-4714-b648-6894772e0716",
 element="47175C61-5D2D-49A5-AAD4-D101F1EE7881")>
>>> el.clear()
<appium.webdriver.webelement.WebElement (session="9de50f6c-60eb-4714-b648-6894772e0716",
 element="47175C61-5D2D-49A5-AAD4-D101F1EE7881")>
>>>

the clear function just returns an webelement object but doesn't delete anything.

EDIT:

Those who are facing the same issue can try with el.send_keys(Keys.DELETE). This works so far.

@mykola-mokhnach mykola-mokhnach added ThirdParty upstream problems XCUITest regarding xcuitest driver labels Dec 5, 2017
@abhishekgaur4feb
Copy link

el.send_keys(Keys.DELETE) does not worked for me. Instead, it gives special character.

@mykola-mokhnach
Copy link
Collaborator

Closed as third party issue.

@vikramvi
Copy link
Contributor

vikramvi commented Jun 4, 2018

3rd party issue can be tracked under facebookarchive/WebDriverAgent#603

@LayMuiToh
Copy link

Hi
is this issue resolved?
I send this 2 commands, the textfield didn't get cleared
await driver.elementByAccessibilityId('textUserName').click();
await driver.elementByAccessibilityId('textUserName').clear();
I notice the cursor is at the end of the current text instead of place at the beginning.
how to place the cursor to the beginning of the text field so I can replace the existing text with the new text value.
any workaround or any plan to fix this?
thanks

@lock
Copy link

lock bot commented Oct 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Oct 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ThirdParty upstream problems XCUITest regarding xcuitest driver
Projects
None yet
Development

No branches or pull requests

5 participants