-
Notifications
You must be signed in to change notification settings - Fork 562
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
add appium prefix in create session and fix find_elements for W3C #196
Conversation
always_match = {} | ||
if caps.get('proxy') and caps['proxy'].get('proxyType'): | ||
caps['proxy']['proxyType'] = caps['proxy']['proxyType'].lower() | ||
for k, v in caps.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> iteritems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Python 3.x, items()
looks enough as an iterator and iteritems
is deprecated.
appium/webdriver/webdriver.py
Outdated
for k, v in caps.items(): | ||
if v and k in _OSS_W3C_CONVERSION: | ||
always_match[_OSS_W3C_CONVERSION[k]] = v.lower() if k == 'platform' else v | ||
if k in _W3C_CAPABILITY_NAMES or ':' in k: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a constant for ':' ?
appium/webdriver/webdriver.py
Outdated
new_opts = copy.deepcopy(moz_opts) | ||
new_opts['profile'] = profile | ||
always_match['moz:firefoxOptions'] = new_opts | ||
return {"firstMatch": [{}], "alwaysMatch": always_match} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP recommends to use single quotes by default for string constants
appium/webdriver/webdriver.py
Outdated
@@ -48,6 +98,43 @@ def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub', | |||
By.ANDROID_UIAUTOMATOR = MobileBy.ANDROID_UIAUTOMATOR | |||
By.ACCESSIBILITY_ID = MobileBy.ACCESSIBILITY_ID | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one line space is enough between class methods
@mykola-mokhnach Doesn't the Java client send the capabilities like this: {
"desiredCapabilities": {...},
"capabilities": {
"alwaysMatch:" {...},
"firstMatch": [{...}, ...],
}
} I think the safest way to send capabilities is to use both protocols and then parse the response to determine if the session is |
This is how we send currently in java-client. |
Yes, the client should send both types of capabilities as a compatibility measure. @SrinivasanTarget that payload doesn't look correct, @dpgraham's does though. |
📝
So, if the response is like the below, it comes from Ruby client's test code, the clients work as the OSS(MJSONWP) driver. response = {
status: 0, # To make bridge.dialect == :oss
sessionId: '1234567890',
value: {
capabilities: {
device: 'iphone',
browserName: 'UICatalog',
sdkVersion: '10.3.1',
CFBundleIdentifier: 'com.example.apple-samplecode.UICatalog'
}
}
}.to_json And if the response is like the below, it comes from Ruby client's test code, the drivers work as the W3C driver. response = {
value: {
sessionId: '1234567890',
capabilities: {
device: 'iphone',
browserName: 'UICatalog',
sdkVersion: '10.3.1',
CFBundleIdentifier: 'com.example.apple-samplecode.UICatalog'
}
}
}.to_json The above's response depends on the response. Meanwhile, Appium 1.7.2-beta3~5 support both formats. In the environment, clients should send only Thus, I define BTW, I found some missing commands and locators in W3C module. I'm not sure Java Client, but I think we also cover them for W3C.
|
👍
Yes @jlipps Looks like a bug. Will fix in upcoming release. @KazuCocoa looking at your links |
📝 |
I'm waiting for this fix to be released! (since now python client does not work with Appium1.8.0-beta maybe due to this problem) |
@NozomiIto This probably won't fix the problem. Do you have error logs? |
@dpgraham Thanks. Appium server 1.8.0-beta log: https://gist.github.com/NozomiIto/3c12eefec788a9d6a87bfdf5d3d82f8d Python client0.26 log: My Python code:
But when I install Python client from the master HEAD, this error is resolved. |
@NozomiIto Looks like you were right, and it is a client issue. It's sending incomplete capabilities. However, the next upcoming beta will have a workaround for that. Appium on the master branch currently has that fix and we'll probably publish a new beta later today or tomorrow. |
@dpgraham Thank you so much! |
What do I do in this PR
appium:
prefix for capabilities except for items defined by W3CforceMjsonwp
capability to force request format MJSONWP format.{'firstMatch': [{}], 'alwaysMatch': always_match}
stylefind_element/s
related methos since in W3C,id
is convert tocss selector
style'forceMjsonwp': True
related