Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Handle setValue API call conversion between protocols #297

Merged
merged 3 commits into from
Jan 27, 2019

Conversation

mykola-mokhnach
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach merged commit 7b163dc into appium:master Jan 27, 2019
@mykola-mokhnach mykola-mokhnach deleted the value branch January 27, 2019 20:33
@KazuCocoa
Copy link
Member

I found org.json.JSONException happened after this change. (Haven't tested iOS)

https://gist.github.com/KazuCocoa/39deaf62f134714812ac64bb4a0b954d

@KazuCocoa
Copy link
Member

KazuCocoa commented Jan 29, 2019

@KazuCocoa
Copy link
Member

KazuCocoa commented Jan 29, 2019

Should we send text and value in webcontext case like iOS?

https://github.com/appium/appium-xcuitest-driver/blob/fcbbddc101fcfca23bad952dd104bd86dde8bd99/lib/commands/element.js#L163

https://github.com/appium/appium-uiautomator2-driver/blob/a91a34141634ecdb6928ecbd89312ef3042f1aa5/lib/commands/element.js#L60-L71

(Espresso driver handles /value command in the server)


I imagine like below as a hotfix:

commands.setValue = async function (keys, elementId) {
+  if (this.isWebContext()) {
+    return await this.chromedriver.jwproxy.command(`/element/${elementId}/value`, 'POST', keys);
+  }
  return await this.setElementValue(keys, elementId, false);
};

@KazuCocoa
Copy link
Member

Do you have a time to take a look ^?
@mykola-mokhnach

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants