Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Appium Java client 8.3.0. @iOSXCUITFindBy uses CSS selector irrespective of the locator used for the element

Aperta
#1,885 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java

Direzione di ricerca

Inizia tracciando come @iOSXCUITFindBy e la Page factory trasformano gli attributi di accessibilità e id nella richiesta find-element di WebDriver. Riproduci il problema con i due locator del report e confronta i log di Appium. Il lavoro è completato quando ogni locator viene inviato con la strategia e il valore corrispondenti, invece di diventare entrambi un selettore CSS.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

@iOSXCUITFindBy uses CSS selector irrespective of the locator used for the element identifications.

Environment

  • Java client build version or git revision if you use some snapshot:8.3.0
  • Appium server version or git revision if you use some snapshot: V2
  • Desktop OS/version used to run Appium if necessary: Ventura 13.2.1
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: 18.15
  • Mobile platform/version under test: 16.3.1
  • Real device or emulator/simulator: Real Device

Details

My Page factory Web elements,

@iOSXCUITFindBy(accessibility = "Allow")
public WebElement btnAllow;

@iOSXCUITFindBy(id = "Allow")
public WebElement btnAllow;

Appium Server log for both the locators are same as below in Appium Logs:

[HTTP] {"using":"css selector","value":"#btnAllow"}

Code To Reproduce Issue [ Good To Have ]

My XCUITestOptions are as below

options.setDeviceName("Device Name");
options.setApp("AppPath/MyWork.app");
options.setPlatformVersion("16.3.1");
options.setPlatformName("iOS");
options.setBundleId("com.xx.xxx.mywork");
options.setUdid("xxxxxxxxx-***");
options.setWdaLaunchTimeout(Duration.ofSeconds(20));

Exception Stacktraces

Please create a gist with the pasted stacktrace of the exception thrown by java.

Link To Appium Logs

[AppiumDriver@3d7e] New XCUITestDriver session created successfully, session 1ff5105f-f613-4fd1-808c-67453526c3db added to master session list
[debug] [XCUITestDriver@576d (1ff5105f)] Cached the protocol value 'W3C' for the new session 1ff5105f-f613-4fd1-808c-67453526c3db
[debug] [XCUITestDriver@576d (1ff5105f)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"ios","app":"/xxxxxxxxxxx//MyWork.app","automationName":"XCuiTest","bundleId":"com.xxxxxxxx.mywork","deviceName":"xxxxxxx","platformVersion":"16.3.1","udid":"xxxxxxxxx","wdaLaunchTimeout":20000}}
[HTTP] <-- POST /session 200 25238 ms - 664
[HTTP]
[HTTP] --> POST /session/1ff5105f-f613-4fd1-808c-67453526c3db/timeouts
[HTTP] {"implicit":80000}
[debug] [XCUITestDriver@576d (1ff5105f)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,80000,"1ff5105f-f613-4fd1-808c-67453526c3db"]
[debug] [XCUITestDriver@576d (1ff5105f)] Executing command 'timeouts'
[debug] [XCUITestDriver@576d (1ff5105f)] W3C timeout argument: {"implicit":80000}}
[debug] [XCUITestDriver@576d (1ff5105f)] Set implicit wait to 80000ms
[debug] [XCUITestDriver@576d (1ff5105f)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /session/1ff5105f-f613-4fd1-808c-67453526c3db/timeouts 200 4 ms - 14
[HTTP]
[HTTP] --> POST /session/1ff5105f-f613-4fd1-808c-67453526c3db/element
[HTTP] {"using":"css selector","value":"#btnAllow"}
[debug] [XCUITestDriver@576d (1ff5105f)] Calling AppiumDriver.findElement() with args: ["css selector","#btnAllow","1ff5105f-f613-4fd1-808c-67453526c3db"]
[debug] [XCUITestDriver@576d (1ff5105f)] Executing command 'findElement'
[debug] [XCUITestDriver@576d (1ff5105f)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[debug] [XCUITestDriver@576d (1ff5105f)] Waiting up to 80000 ms for condition
[debug] [XCUITestDriver@576d (1ff5105f)] Matched '/element' to command name 'findElement'
[debug] [XCUITestDriver@576d (1ff5105f)] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/F4A03C6E-3D98-4992-82E3-0FC164E4B6A6/element] with body: {"using":"class chain","value":"/*[name == \"btnAllow\"]"}
[XCUITestDriver@576d (1ff5105f)] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'class chain', value '
/*[name == \"btnAllow\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x00000001056056ec FBNoSuchElementErrorResponseForRequest + 252\n\t1 WebDriverAgentLib 0x000000010560551c +[FBFindElementCommands handleFindElement:] + 312\n\t2 WebDriverAgentLib 0x00000001055ca5a4 -[FBRoute_TargetAction mountRequest:intoResponse:] + 168\n\t3 WebDriverAgentLib 0x00000001055b65b4 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 404\n\t4 WebDriverAgentLib 0x00000001055ec280 -[RoutingHTTPServer handleRoute:withRequest:response:] + 168\n\t5 WebDriverAgentLib 0x00000001055ecd70 __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 64\n\t6 libdispatch.dylib 0x000000018fbd0f88 DED4D0A5-1420-32AE-83A6-C31D938A1C9A + 16264\n\t7 libdispatch.dylib ...
[debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError
[debug] [XCUITestDriver@576d (1ff5105f)] Waited for 55 ms so far.

Lingua principale
Java
Stelle
1.3k
Fork
755
Merge medio
5g 14h
PR unite (30g)
8

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di appium/java-client

Tutte le issue di appium/java-client

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.