RobotFramework+Appium 升級Appium v1.10.0後,執行click element時報錯:InvalidSelectorException: Message: Locato

報錯信息以下:css

debug] [XCUITest] Connection to WDA timed out
[debug] [XCUITest] Connection to WDA timed out[info] [HTTP] --> POST /wd/hub/session/0fa5e52b-19f3-4c08-87c7-053b1e9ed018/elements
[info] [HTTP] {"using":"css selector","value":"[id=\"SVW_LoginChoiceView.swift130001\"]"}
[debug] [W3C (0fa5e52b)] Calling AppiumDriver.findElements() with args: ["css selector","[id=\"SVW_LoginChoiceView.swift130001\"]","0fa5e52b-19f3-4c08-87c7-053b1e9ed018"]
[debug] [XCUITest] Executing command 'findElements'
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[debug] [W3C (0fa5e52b)] Encountered internal error running command: InvalidSelectorError: Locator Strategy 'css selector' is not supported for this session
[debug] [W3C (0fa5e52b)] at XCUITestDriver.validateLocatorStrategy (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/basedriver/driver.js:344:13)
[debug] [W3C (0fa5e52b)] at XCUITestDriver.validateLocatorStrategy (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/lib/driver.js:918:11)
[debug] [W3C (0fa5e52b)] at XCUITestDriver.helpers.findElOrElsWithProcessing (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/basedriver/commands/find.js:28:8)
[debug] [W3C (0fa5e52b)] at XCUITestDriver.commands.findElements (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/basedriver/commands/find.js:60:21)
[debug] [W3C (0fa5e52b)] at curCommandCancellable._bluebird.default.resolve.then (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/basedriver/driver.js:291:18)
[debug] [W3C (0fa5e52b)] at tryCatcher (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/bluebird/js/main/util.js:26:23)
[debug] [W3C (0fa5e52b)] at Promise._settlePromiseFromHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/bluebird/js/main/promise.js:510:31)
[debug] [W3C (0fa5e52b)] at Promise._settlePromiseAt (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/bluebird/js/main/promise.js:584:18)
[debug] [W3C (0fa5e52b)] at Promise._settlePromiseAtPostResolution (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/bluebird/js/main/promise.js:248:10)
[debug] [W3C (0fa5e52b)] at Async._drainQueue (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/bluebird/js/main/async.js:128:12)
[debug] [W3C (0fa5e52b)] at Async._drainQueues (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/bluebird/js/main/async.js:133:10)
[debug] [W3C (0fa5e52b)] at Immediate.Async.drainQueues (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/bluebird/js/main/async.js:15:14)
[debug] [W3C (0fa5e52b)] at runCallback (timers.js:696:18)
[debug] [W3C (0fa5e52b)] at tryOnImmediate (timers.js:667:5)
[debug] [W3C (0fa5e52b)] at processImmediate (timers.js:649:5)
[info] node

解決辦法:python

在python文件夾下找到site-pankages/selenium/webdriver/remote/webdriver.py中找到def find_element和def find_elements,註釋掉if self.w3c;ios

保存後,再次運行,成功解決。web

 

 

 

相關文章
相關標籤/搜索