当前位置:网站首页>About selenium common. exceptions. Webdriverexception: message: an unknown server side error solution (resolved)

About selenium common. exceptions. Webdriverexception: message: an unknown server side error solution (resolved)

2022-06-26 15:04:00 Full stack husky

Wanyeji
Faint thunder , Cloudy sky .
But I hope the wind and rain will come , I can keep you here .


Preface
Author's brief introduction : Husky who yearns for power , You can call me Siberian Husky , One devoted to TFS - The whole stack Empowered bloggers
CSDN Blog expert certification 、 Nova plan Season 3 full stack track top_1 、 Huawei cloud sharing expert 、 Alibaba cloud expert Blogger
If there is something wrong with the knowledge of the article , Please correct me. ! Learn with you , Progress together
The motto of life : Being superior to some other man , Is not high , The true nobility is to be superior to one's former self .
If you feel the blogger's article is good , Please pay attention. 、 give the thumbs-up 、 Collect three companies to support bloggers


Column series ( Click unlock ) Learning route guidance Knowledge orientation
Python Full stack white paper Zero foundation beginner level chapter Easy to get started in an easy to understand way , Let you fall in love with Python The charm of .
Advanced Grammar Mainly around multi-threaded programming 、 Regular expression learning 、 Including project exercises close to actual combat .
Office automation Realize the automatic operation of daily office software , Save time 、 Improve office efficiency .
Automation test practice From the perspective of actual combat , One step ahead , Rapid transformation test development engineer .
Database development practice Updating
Introduction and practice of reptile Updating
Data analysis Updating
Introduction to the front +flask Full stack Updating
django+vue Full stack Updating
expand - Introduction to artificial intelligence Updating
The road to network security Stepping on a pit Record the pit encountered during learning and drilling , It is convenient for those who come from behind to catch up
Net security literacy Three days fishing , No deep understanding of the principle , It will only make you a script boy .
vulhub The loopholes in the shooting range reappear Make it easy to reproduce vulnerabilities , Let security researchers focus more on the vulnerability principle itself .
shell Programming Don't involve linux Basics , The final case will be in the direction of safety reinforcement . [ To be finished ]
WEB Vulnerability attack and defense 2021 year 9 month 3 Stop updating on , Move to safe communities such as prophet community and small secret circles
Collection of penetration tools 2021 year 9 month 3 Stop updating on , Move to safe communities such as prophet community and small secret circles
A little Engineer Test artifact - Charles Software test data packet capture analysis artifact
Test artifact - Fiddler Learn to fiddle , Learn not to stand upside down and eat , Rarefied !
Test artifact - Jmeter Not just a performance test artifact , It can also be used to build a lightweight interface automation testing framework .
RobotFrameWorkPython Automatic test tool realized , This chapter only introduces UI Automation part .
Java Realization UI automation Document written in 2016 year ,Java Realized UI automation , It still has reference significance .
MonkeyRunner There are not many application scenarios for this tool at present , The document has been deleted , Only for the sake of good typesetting .


If you click in, you must first carefully check whether your error reporting details are consistent with those of the blogger , The “WebDriverException” Many exception types , Please carefully check whether the error information in this article is consistent with yours .

Example script with errors

# coding=utf-8


from time import sleep
from appium import webdriver    # appium  The feature of Android is that Android 、IOS The bottom layer of is encapsulated into  webdriver  Type statements 
# from appium.webdriver.common import appiumby

'''  The difference in WEB automation ,APP Automation requires a concept of equipment ;  The so-called equipment concept , Is the start parameter  '''

#  Launch parameters 
desired_caps = {
    }       #  Definition  desired_caps  Variable , Used to assign a lot of startup information 
desired_caps['platformName'] = 'Android'    #  Equipment name 、 System is  "Android"
desired_caps['platformVersion'] = '4.4.2'   #  Here is the setup center of the night God simulator to view the Android version  "7.1.2" , Later, I will tell you how to switch versions 
desired_caps['deviceName'] = '127.0.0.1::62001'     #  If it is a real machine, fill in the equipment name ; Because we use simulators , Fill in IP Port number 
desired_caps['appPackage'] = 'com.android.contacts'     # APP  The package name ; Here we use the address book 
desired_caps['appActivity'] = '.activities.PeopleActivity'    #  The name of the launched interface ( Or the startup name , The default is  "."  At the beginning )
desired_caps['automationName']='UiAutomator1'

#  Declare the mobile driver 
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)  #  Register to this node , Pass in  "desired_caps". This node is  "appium"  Open port node 

#  Navigate to the contact you want to work on 
driver.find_element_by_id('com.android.contacts:id/cliv_name_textview').click()     #  Here is the demonstration effect , First write . Later, I will tell you how to locate this id
sleep(3)
driver.quit()

Preface

Doing it APPIUM Of APP The following two error messages appear during the automated case demonstration :

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Unable to find an active device or emulator with OS 4.4.2. The following are available: 127.0.0.1:62001 (7.1.2)


appium The contents of the error report are as follows :

Encountered internal error running command: Error: Unable to find an active device or emulator with OS 4.4.2. The following are available: 127.0.0.1:62001 (7.1.2)


Abnormal analysis

In fact, there is nothing to analyze , The prompt message has already told you . It is the default device information we have passed in “ Android version ” Not caused by , We introduced The Android version is 4.4.2 , But in fact “ Night God Simulator ” The current default version of is “7.1.2”.

PS: I wrote this script before , At that time “ Night God Simulator ” The default version of is “4.4.2”, The error message tells us that the current Android version of the device is “7.1.2”




原网站

版权声明
本文为[Full stack husky]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261421309620.html