Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
self.driver.set_network_connection(1)在selenium python客户端的android操作系统版本8上不起作用_Python_Android_Selenium_Selenium Webdriver - Fatal编程技术网

self.driver.set_network_connection(1)在selenium python客户端的android操作系统版本8上不起作用

self.driver.set_network_connection(1)在selenium python客户端的android操作系统版本8上不起作用,python,android,selenium,selenium-webdriver,Python,Android,Selenium,Selenium Webdriver,请找到下面的堆栈跟踪- self.driver.set\u network\u连接(1)在操作系统版本6中正常工作,但在操作系统版本8中遇到问题 Traceback (most recent call last): File "/home/abc/Desktop/reef-py-3/testcase_web-framework/tests_student/tests/xyz.py", line 1151, in xy self.past_session.drive

请找到下面的堆栈跟踪-

self.driver.set\u network\u连接(1)在操作系统版本6中正常工作,但在操作系统版本8中遇到问题

Traceback (most recent call last):
  File "/home/abc/Desktop/reef-py-3/testcase_web-framework/tests_student/tests/xyz.py", line 1151, in xy
    self.past_session.driver.mobile.set_network_connection(1)
  File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/mobile.py", line 64, in set_network_connection
    'parameters': {'type': mode}})['value'])
  File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.6/dist-packages/appium/webdriver/errorhandler.py", line 29, in check_response
    raise wde
  File "/usr/local/lib/python3.6/dist-packages/appium/webdriver/errorhandler.py", line 24, in check_response
    super(MobileErrorHandler, self).check_response(response)
  File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/home/abc/Android/Sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true' exited with code 1'; Stderr: 'java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=3746, uid=2000
    at android.os.Parcel.readException(Parcel.java:1683)
    at android.os.Parcel.readException(Parcel.java:1636)
    at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:3507)
    at com.android.commands.am.Am.sendBroadcast(Am.java:772)
    at com.android.commands.am.Am.onRun(Am.java:404)
    at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
    at com.android.commands.am.Am.main(Am.java:121)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)'; Code: '1'```