The Appium+Python+nox simulator failed to use XPATH to locate elements

The following error was reported (with code) :

from appium import webdriver
import time
from appium.webdriver.common.appiumby import AppiumBy

desired_caps={}

desired_caps[‘deviceName’] = ‘127.0.0.1:62001’

desired_caps[‘platformName’] = ‘Android’
desired_caps[‘platformVersion’] = ‘7.1’

desired_caps[‘appPackage’] = ‘com.android.settings’
desired_caps[‘appActivity’] = ‘.Settings’

des = webdriver.Remote(‘http://127.0.0.1:4723/wd/hub’,desired_capabilities=desired_caps)

time.sleep(2)

des.find_element(AppiumBy.XPATH,"//*[@text()=‘Show’]").click()

time.sleep(3)

des.terminate_app(‘com.android.settings’)

des.quit()

error:

D:\Programs\Python\Python39\python.exe “D:/Program Files/JetBrains/PycharmProjects/pycode/appcode/chazhaoyuansu02.py”
Traceback (most recent call last):
File “D:\Program Files\JetBrains\PycharmProjects\pycode\appcode\chazhaoyuansu02.py”, line 37, in
des.find_element(AppiumBy.XPATH,"//*[@text()=‘Show’]").click()
File “D:\Programs\Python\Python39\lib\site-packages\appium\webdriver\webdriver.py”, line 371, in find_element
return self.execute(RemoteCommand.FIND_ELEMENT, {‘using’: by, ‘value’: value})[‘value’]
File “D:\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 435, in execute
self.error_handler.check_response(response)
File “D:\Programs\Python\Python39\lib\site-packages\appium\webdriver\errorhandler.py”, line 30, in check_response
raise wde
File “D:\Programs\Python\Python39\lib\site-packages\appium\webdriver\errorhandler.py”, line 26, in check_response
super().check_response(response)
File “D:\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py”, line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters.
Stacktrace:
NoSuchElementError: An element could not be located on the page using the given search parameters.
at AndroidUiautomator2Driver.findElOrEls (C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\commands\find.js:75:11)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at AndroidUiautomator2Driver.findElOrElsWithProcessing (C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\commands\find.js:33:12)
at AndroidUiautomator2Driver.findElement (C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\commands\find.js:53:10)

with Appium:

[HTTP]
[HTTP] --> POST /wd/hub/session/753d43cf-f5a6-4ee9-a168-dd75664d4f24/element
[HTTP] {“using”:“xpath”,“value”:"//[@text()=‘显示’]"}
[W3C (753d43cf)] Calling AppiumDriver.findElement() with args: [“xpath”,"//
[@text()=‘显示’]",“753d43cf-f5a6-4ee9-a168-dd75664d4f24”]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[WD Proxy] Matched ‘/element’ to command name ‘findElement’
[WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8205/wd/hub/session/1e10a911-3cf6-489e-b7d0-51134f2796de/element] with body: {“strategy”:“xpath”,“selector”:"//*[@text()=‘显示’]",“context”:"",“multiple”:false}
[WD Proxy] Got response with status 404: {“sessionId”:“1e10a911-3cf6-489e-b7d0-51134f2796de”,“value”:{“error”:“no such element”,“message”:“An element could not be located on the page using the given search parameters”,“stacktrace”:"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:90)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:67)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:266)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:260)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCont…
[W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[W3C (753d43cf)] Encountered internal error running command: NoSuchElementError: An element could not be located on the page using the given search parameters.
[W3C (753d43cf)] at AndroidUiautomator2Driver.findElOrEls (C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\commands\find.js:75:11)
[W3C (753d43cf)] at runMicrotasks ()
[W3C (753d43cf)] at processTicksAndRejections (internal/process/task_queues.js:97:5)
[W3C (753d43cf)] at AndroidUiautomator2Driver.findElOrElsWithProcessing (C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\commands\find.js:33:12)
[W3C (753d43cf)] at AndroidUiautomator2Driver.findElement (C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\commands\find.js:53:10)
[HTTP] <-- POST /wd/hub/session/753d43cf-f5a6-4ee9-a168-dd75664d4f24/element 404 116 ms - 953
[HTTP]

Whether SDK JDK ADB all configured, except JDK is 1.8 other versions are up to date

Thank you very much for your help