0
votes

I am trying to check the element but is never clicked

WebElement checkBox = driver.findElementByXPath("//XCUIElementTypeOther[@name=\"checkTerms\"]");

System.out.println(checkBox.getAttribute("enabled"));

checkBox.click();

it prints true but nothing happens

Appium 1.11.1

appium java-client 7.0.0

selenium-java 3.141.59

I am using this pod https://cocoapods.org/pods/M13Checkbox to show checkboxes

enter image description here

If I click on tap in the right panel it works as expected.

Edit: I have to click it after filling user/password and I can't hide the keyboard after password (it's numeric keyboard) getting WebDriverException but it's working one time hiding it after user textfield.

Edit2: No matter keyboard is shown checkbox is never tapped.

Thanks for any help.

2
what error are you getting? - KunduK
I don't have any error but when I check the element with appium desktop enabled is always true and I don't see any attribute "checked" - Pablo R.
The enabled property is not going to change when you click/tap the element. What happens to the other properties when you click the tap button on the viewer? Do any of them change value? Normally, I would check for a value attribute, but it's not clear from your screenshot whether or not that's what to do. I work with Android, not IOS, so mine looks a bit different. - Bill Hileman
were you able to click it using appium desktop inspector? Select the element and try to click tap button in the appium desktop inspector. - Suban Dhyako
@SubanDhyako I am able to tap it on appium desktop an I can record the tap action giving me -- MobileElement el1 = (MobileElement) driver.findElementByAccessibilityId("checkTerms"); el1.click(); -- but never works on code. appium server 1.11.1 desktop 1.10.0 Bill nothing changes and attribute value is never shown in desktop and I can't get it trough code - Pablo R.

2 Answers

0
votes

Have you tried this?

Actions action = new Actions(driver);
action.moveTo(checkbox);
action.click();
action.perform();
0
votes

I finally solved it scrolling down to the next element to the checkbox. for some reason even if it was appearing on the screen the view couldn't tap the element so it worked scrolling down to password textfield and then click into the checkbox.