Sunday, April 19, 2026
HomeiOS DevelopmentXCUITest doesn't repeat identical aspect click on with Appium and iOS

XCUITest doesn’t repeat identical aspect click on with Appium and iOS

[ad_1]

I’m utilizing Eclipse, Appium, and a digital iPhone gadget to aim to automate a person registration on an app. Nevertheless, clicking the identical aspect 2 occasions in the identical session ends in the 2nd or extra clicks to be ignored or unsuccessful. So far as I can inform, Appium shouldn’t be throwing any errors. The take a look at ins to sort to a pin code show to enter 10 numbers.

I’ve confirmed that each aspect works if not one of the numbers are repeated. If any of the numbers are repeated, the clicking submitted to the gadget.

I’ve additionally confirmed that by doing this take a look at manually below the identical circumstances, I’m able to repeat urgent the identical quantity button as many occasions as I would like with out challenge. All clicks are registered.

Altering the pause does not matter. I’ve modified it to be as much as 5 seconds per click on. Pace of clicks does not appear to be the difficulty. Neither does the kind of aspect getting used. I additionally tried this with XCode.

That is my easy take a look at to register to a service utilizing a set code.

public static void RegisterUser() {
    
    //Click on the register button.
    driver.findElement(By.id("registerButton")).click on();
    
    //Enter Reg Code.
    ClickButton("**/XCUIElementTypeStaticText[`label == "9"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "9"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "1"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "9"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "3"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "1"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "6"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "6"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "7"`]");
    ClickButton("**/XCUIElementTypeStaticText[`label == "0"`]");
    
}

//Click on the goal and wait half a second.
public static void ClickButton(String aspect) {
    
    driver.findElement(MobileBy.iOSClassChain(aspect)).click on();
    Pause(100);
}

//Pause the present thread.
public static void Pause(int pauseTime) {
    
    strive {
        Thread.sleep(pauseTime);
    }
    catch(InterruptedException e) {
        
        e.printStackTrace();
        e.getMessage();
        e.getCause();
    }
}

That is the output from Appium for the two clicks on the identical aspect.
This one ends in a profitable click on.

[HTTP] {"utilizing":"-ios class chain","worth":"**/XCUIElementTypeStaticText[`label == "9"`]"}
[debug] [W3C (47290369)] Calling AppiumDriver.findElement() with args: ["-ios class chain","**/XCUIElementTypeStaticText[`label == "9"`]","47290369-1558-4bae-98f7-ab0a3d0dc031"]
[debug] [XCUITest] Executing command 'findElement'
[debug] [BaseDriver] Legitimate locator methods for this request: xpath, id, identify, class identify, -ios predicate string, -ios class chain, accessibility id, css selector
[debug] [BaseDriver] Ready as much as 0 ms for situation
[debug] [XCUITest] Setting customized timeout to 12000 ms for 'findElement' command
[debug] [WD Proxy] Matched '/aspect' to command identify 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/7C394CAB-D8A7-4977-A463-97BE23B2671B/element] with physique: {"utilizing":"class chain","worth":"**/XCUIElementTypeStaticText[`label == "9"`]"}
[debug] [WD Proxy] Received response with standing 200: {"worth":{"ELEMENT":"6A000000-0000-0000-7205-010000000000","element-6066-11e4-a52e-4f735466cecf":"6A000000-0000-0000-7205-010000000000"},"sessionId":"7C394CAB-D8A7-4977-A463-97BE23B2671B"}
[debug] [W3C (47290369)] Responding to consumer with driver.findElement() consequence: {"element-6066-11e4-a52e-4f735466cecf":"6A000000-0000-0000-7205-010000000000","ELEMENT":"6A000000-0000-0000-7205-010000000000"}
[HTTP] <-- POST /wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/aspect 200 92 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/aspect/6A000000-0000-0000-7205-010000000000/click on
[HTTP] {"id":"6A000000-0000-0000-7205-010000000000"}
[W3C (47290369)] Driver proxy lively, passing request on through HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[debug] [WD Proxy] Matched '/wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/aspect/6A000000-0000-0000-7205-010000000000/click on' to command identify 'click on'
[debug] [WD Proxy] Proxying [POST /wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/element/6A000000-0000-0000-7205-010000000000/click] to [POST http://127.0.0.1:8100/session/7C394CAB-D8A7-4977-A463-97BE23B2671B/element/6A000000-0000-0000-7205-010000000000/click] with physique: {"id":"6A000000-0000-0000-7205-010000000000"}
[debug] [WD Proxy] Received response with standing 200: {"worth":null,"sessionId":"7C394CAB-D8A7-4977-A463-97BE23B2671B"}
[WD Proxy] Changing sessionId 7C394CAB-D8A7-4977-A463-97BE23B2671B with 47290369-1558-4bae-98f7-ab0a3d0dc031
[HTTP] <-- POST /wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/aspect/6A000000-0000-0000-7205-010000000000/click on 200 165 ms - 65

This one doesn’t really lead to a click on. However Appium thinks it does.

[HTTP] {"utilizing":"-ios class chain","worth":"**/XCUIElementTypeStaticText[`label == "9"`]"}
[debug] [W3C (47290369)] Calling AppiumDriver.findElement() with args: ["-ios class chain","**/XCUIElementTypeStaticText[`label == "9"`]","47290369-1558-4bae-98f7-ab0a3d0dc031"]
[debug] [XCUITest] Executing command 'findElement'
[debug] [BaseDriver] Legitimate locator methods for this request: xpath, id, identify, class identify, -ios predicate string, -ios class chain, accessibility id, css selector
[debug] [BaseDriver] Ready as much as 0 ms for situation
[debug] [XCUITest] Setting customized timeout to 12000 ms for 'findElement' command
[debug] [WD Proxy] Matched '/aspect' to command identify 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/7C394CAB-D8A7-4977-A463-97BE23B2671B/element] with physique: {"utilizing":"class chain","worth":"**/XCUIElementTypeStaticText[`label == "9"`]"}
[debug] [WD Proxy] Received response with standing 200: {"worth":{"ELEMENT":"6E000000-0000-0000-7205-010000000000","element-6066-11e4-a52e-4f735466cecf":"6E000000-0000-0000-7205-010000000000"},"sessionId":"7C394CAB-D8A7-4977-A463-97BE23B2671B"}
[debug] [W3C (47290369)] Responding to consumer with driver.findElement() consequence: {"element-6066-11e4-a52e-4f735466cecf":"6E000000-0000-0000-7205-010000000000","ELEMENT":"6E000000-0000-0000-7205-010000000000"}
[HTTP] <-- POST /wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/aspect 200 103 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/aspect/6E000000-0000-0000-7205-010000000000/click on
[HTTP] {"id":"6E000000-0000-0000-7205-010000000000"}
[W3C (47290369)] Driver proxy lively, passing request on through HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[debug] [WD Proxy] Matched '/wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/aspect/6E000000-0000-0000-7205-010000000000/click on' to command identify 'click on'
[debug] [WD Proxy] Proxying [POST /wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/element/6E000000-0000-0000-7205-010000000000/click] to [POST http://127.0.0.1:8100/session/7C394CAB-D8A7-4977-A463-97BE23B2671B/element/6E000000-0000-0000-7205-010000000000/click] with physique: {"id":"6E000000-0000-0000-7205-010000000000"}
[debug] [WD Proxy] Received response with standing 200: {"worth":null,"sessionId":"7C394CAB-D8A7-4977-A463-97BE23B2671B"}
[WD Proxy] Changing sessionId 7C394CAB-D8A7-4977-A463-97BE23B2671B with 47290369-1558-4bae-98f7-ab0a3d0dc031
[HTTP] <-- POST /wd/hub/session/47290369-1558-4bae-98f7-ab0a3d0dc031/aspect/6E000000-0000-0000-7205-010000000000/click on 200 175 ms - 65

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments