Unable to locate element

Try to locate elements on Mac desktop application “TextEdit”, here is the desired capabilities,

options.W3C_CAPABILITY_NAMES = {
“platformName”: “mac”,
“appium:automationName”: “Mac2”,
“appium:serverStartupTimeout”: “120000”,
“appium:bundleId”: “com.apple.TextEdit”,
“appium:deviceName”: “mac”,
“maxInstances”: “1”,
“showServerLogs”: True,
“platformVersion”: “13.5”
}

Errors received from appium server, I really need help on how to resolve the issues,

[debug] [Mac2Driver@0138] Creating session with W3C capabilities: {
[debug] [Mac2Driver@0138] “alwaysMatch”: {
[debug] [Mac2Driver@0138] “platformName”: “Mac”,
[debug] [Mac2Driver@0138] “appium:automationName”: “Mac2”
[debug] [Mac2Driver@0138] },
[debug] [Mac2Driver@0138] “firstMatch”: [
[debug] [Mac2Driver@0138] {}
[debug] [Mac2Driver@0138] ]
[debug] [Mac2Driver@0138] }
[Mac2Driver@0138 (75a6f4bf)] Session created with session id: 75a6f4bf-8c3a-4bbc-822a-3969d33f3f78
[WebDriverAgentMac] The host process has already been listening. Proceeding with session creation
[debug] [WD Proxy] Matched ‘/session’ to command name ‘createSession’
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:10100/session] with body: {“capabilities”:{“firstMatch”:[{}],“alwaysMatch”:{“platformName”:“Mac”,“automationName”:“Mac2”}}}
[debug] [WD Proxy] Got response with status 200: {“value”:{“sessionId”:“2C555457-89B2-44BE-B2F0-15FB84605C2D”,“capabilities”:{“CFBundleIdentifier”:“com.apple.finder”}},“sessionId”:“2C555457-89B2-44BE-B2F0-15FB84605C2D”}
[WD Proxy] Determined the downstream protocol as ‘W3C’
[AppiumDriver@9b55] New Mac2Driver session created successfully, session 75a6f4bf-8c3a-4bbc-822a-3969d33f3f78 added to master session list
[debug] [AppiumDriver@9b55] Event ‘newSessionStarted’ logged at 1694029232114 (15:40:32 GMT-0400 (Eastern Daylight Time))
[AppiumDriver@9b55] Promoting 1 sessionless plugins to be attached to session ID 75a6f4bf-8c3a-4bbc-822a-3969d33f3f78
[debug] [Mac2Driver@0138 (75a6f4bf)] Cached the protocol value ‘W3C’ for the new session 75a6f4bf-8c3a-4bbc-822a-3969d33f3f78
[debug] [Mac2Driver@0138 (75a6f4bf)] Responding to client with driver.createSession() result: {“capabilities”:{“platformName”:“Mac”,“automationName”:“Mac2”}}
[HTTP] <-- POST /session 200 9 ms - 124
[HTTP]
[HTTP] --> POST /session/75a6f4bf-8c3a-4bbc-822a-3969d33f3f78/element
[HTTP] {“using”:“class name”,“value”:“XCUIElementTypeTextView”}
[debug] [Mac2Driver@0138 (75a6f4bf)] Calling AppiumDriver.findElement() with args: [“class name”,“XCUIElementTypeTextView”,“75a6f4bf-8c3a-4bbc-822a-3969d33f3f78”]
[debug] [Mac2Driver@0138 (75a6f4bf)] Valid locator strategies for this request: id, name, accessibility id, xpath, class name, -ios predicate string, predicate string, -ios class chain, class chain
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:10100/session/2C555457-89B2-44BE-B2F0-15FB84605C2D/element] with body: {“using”:“class name”,“value”:“XCUIElementTypeTextView”}
[WD Proxy] Got response with status 404: {“value”:{“error”:“no such element”,“message”:“unable to find an element using ‘class name’, value ‘XCUIElementTypeTextView’”,“traceback”:"(\n\t0 WebDriverAgentLib 0x0000000105629c62 FBNoSuchElementErrorResponseForRequest + 290\n\t1 WebDriverAgentLib 0x00000001056299e9 +[FBFindElementCommands handleFindElement:] + 409\n\t2 WebDriverAgentLib 0x000000010566f42c -[FBRoute_TargetAction mountRequest:intoResponse:] + 172\n\t3 WebDriverAgentLib 0x0000000105668bf8 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 776\n\t4 WebDriverAgentLib 0x00000001056622ed -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t5 WebDriverAgentLib 0x0000000105663031 __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 65\n\t6 libdispatch.dylib 0x00007ff8189b9033 _dispatch_client_callout + 8\n\t7 libdispatch.dylib 0x000…
[debug] [W3C] Matched W3C error code ‘no such element’ to NoSuchElementError
[debug] [Mac2Driver@0138 (75a6f4bf)] Encountered internal error running command: NoSuchElementError: unable to find an element using ‘class name’, value ‘XCUIElementTypeTextView’
[debug] [Mac2Driver@0138 (75a6f4bf)] at errorFromW3CJsonCode (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1040:25)
[debug] [Mac2Driver@0138 (75a6f4bf)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:909:14)
[debug] [Mac2Driver@0138 (75a6f4bf)] at WDAMacProxy.command (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:353:19)
[debug] [Mac2Driver@0138 (75a6f4bf)] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[debug] [Mac2Driver@0138 (75a6f4bf)] at Mac2Driver.findElOrEls (/Users/XXXXXX/.appium/node_modules/appium-mac2-driver/lib/commands/find.js:17:10)
[debug] [Mac2Driver@0138 (75a6f4bf)] at Mac2Driver.findElOrElsWithProcessing (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:60:12)
[debug] [Mac2Driver@0138 (75a6f4bf)] at Mac2Driver.findElement (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:75:12)
[HTTP] <-- POST /session/75a6f4bf-8c3a-4bbc-822a-3969d33f3f78/element 404 424 ms - 1128
[HTTP]
^C[Appium] Received SIGINT - shutting down
[debug] [AppiumDriver@9b55] Cleaning up 2 active sessions
[AppiumDriver@9b55] Ending session, cause was ‘The process has received SIGINT signal’
[debug] [AppiumDriver@9b55] Plugin execute-driver does not define an unexpected shutdown handler
[AppiumDriver@9b55] Removing session ‘cf066bb4-d79c-4a85-a139-fb1d9433e35c’ from our master session list
[AppiumDriver@9b55] Ending session, cause was ‘The process has received SIGINT signal’
[debug] [AppiumDriver@9b55] Plugin execute-driver does not define an unexpected shutdown handler
[AppiumDriver@9b55] Removing session ‘75a6f4bf-8c3a-4bbc-822a-3969d33f3f78’ from our master session list
[debug] [WD Proxy] Matched ‘/session/2C555457-89B2-44BE-B2F0-15FB84605C2D’ to command name ‘deleteSession’
[debug] [WD Proxy] Proxying [DELETE /session/2C555457-89B2-44BE-B2F0-15FB84605C2D] to [DELETE http://127.0.0.1:10100/session/2C555457-89B2-44BE-B2F0-15FB84605C2D] with no body
[debug] [WD Proxy] Matched ‘/session/2C555457-89B2-44BE-B2F0-15FB84605C2D’ to command name ‘deleteSession’
[debug] [WD Proxy] Proxying [DELETE /session/2C555457-89B2-44BE-B2F0-15FB84605C2D] to [DELETE http://127.0.0.1:10100/session/2C555457-89B2-44BE-B2F0-15FB84605C2D] with no body
[debug] [WD Proxy] Got response with status 200: {“value”:null,“sessionId”:null}
[WD Proxy] Got response with status 404: {“value”:{“error”:“invalid session id”,“message”:“Session does not exist”,“traceback”:"(\n\t0 CoreFoundation 0x00007ff818cad18a __exceptionPreprocess + 242\n\t1 libobjc.A.dylib 0x00007ff8187d342b objc_exception_throw + 48\n\t2 CoreFoundation 0x00007ff818cd52f6 -[NSException raise] + 9\n\t3 WebDriverAgentLib 0x0000000105670056 -[FBRoute raiseNoSessionException] + 86\n\t4 WebDriverAgentLib 0x000000010566ffa3 -[FBRoute decorateRequest:] + 259\n\t5 WebDriverAgentLib 0x000000010566f3da -[FBRoute_TargetAction mountRequest:intoResponse:] + 90\n\t6 WebDriverAgentLib 0x0000000105668bf8 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 776\n\t7 WebDriverAgentLib 0x00000001056622ed -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t8 WebDriverAgentLib 0x0000000105663031 __72-[RoutingHTTPServer routeMethod:withPat…
[debug] [W3C] Matched W3C error code ‘invalid session id’ to NoSuchDriverError