1. 程式人生 > >Appium 運行腳本報錯InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for (轉)

Appium 運行腳本報錯InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for (轉)

解決 cbc support 題解 cat 轉載 LIDS nbsp 重新

現象:Appium運行腳本報錯InvalidSelectorException: Message: Locator Strategy ‘css selector‘ is not supported for this session,但是腳本裏使用的定位元素方法為find_element_by_id() 原因: 根本原因1:電腦裏安裝的selenium版本和Appium-Python-Client版本不兼容 原因2:selenium版本之前是單獨安裝的3.12.0版本。Appium-Python-Client版本是通過Pycharm工具-settings- project Interpreter裏安裝的,安裝時沒有安裝所對應匹配的selenium版本,導致版本不兼容 pycharm 裏安裝包的地點: 技術分享圖片
解決方法: 總結:從cmd裏通過pip方法安裝Appium-Python-Client時會同時安裝正確對應的selenium版本(如果已經存在不兼容會卸載)。 方法: 1. Pycharm工具,先把Appium-Python-Client安裝包卸載掉 技術分享圖片 2. 通過pip重新安裝Appium-Python-Client 技術分享圖片

技術分享圖片 看截圖裏卸載掉了3.12.0,重新安裝了selenium3.141.0版本。 3. 重新運行腳本,問題解決了 --------------------- 作者:hou_angela 來源:CSDN 原文:https://blog.csdn.net/hou_angela/article/details/86608090 ; 版權聲明:本文為博主原創文章,轉載請附上博文鏈接!

Appium 運行腳本報錯InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for (轉)