ios


Xcode UITest - Unable to find buttons in a Cell containing Key Value Pairs


I am having trouble finding a way to uniquely identify a series of buttons (custom checkboxes) that exist within a Cell. The Cell contains data in a series of key value pairs with the checkbox button tied to each key value pair. The problem is that the Cell contains the values for ALL the key value pairs, so I seem to be unable to find just one of the buttons, since they are all identical.
As the UITest code is parsing the data that is supposed to be displaying in the application, I am checking for a custom type associated with the key value pair. If it's a .CheckboxInput, then it performs the below code:
else if case KeyValueType.CheckboxInput = currentType {
let currentCheckboxInput = currentKeyQuery.buttons["step unchecked"]
currentCheckboxInput.tap()
XCTAssert(currentKeyQuery.buttons["step checked"].exists)
}
For reference, currentKeyQuery gets to the Cell and queries for text matching the Key of the key value pair. I'm unable to tap the checkbox button because it's finding all of them that exist in the cell, not just the one associated with the current key value pair it's testing against. Is there any way to associate the button with only the current key value pair since all the checkboxes exist within the same cell?
I was actually able to figure this out, although I can't really explain why it's working. I changed currentCheckboxInput to currentKeyQuery.childrenMatchingType(.Button).matchingIdentifier("step unchecked").elementBoundByIndex(0)

Related Links

iOS: Large UIAlertController ActionSheet bouncing while scrolling and not showing line separators
Facebook sharing on iOS works on some devices, but not others
Is it possible to force the device's date to test local notifications?
Why is my Done key not resigning the keyboard?
Magical Record Custom Core Data Migration not pulling existing data
Possible to have nested reusable UICollectionViewCells
Issue while using viewDidLayoutSubviews
Best practices to define Xcode Preprocessor Macros for Multi Projects WorkSpace in iOS
Unable to set top margin NSLayout Constraint programatically in iOS?
iOS Universal link not working
Call a function of an another class (protocol)
Objective C ternary operator vs if statements nil check
Login error in iOS 9 Facebook SDK
How to map each Pixel to Vertex effectively with OpenGL ES on iOS?
how can i make a pop up menu in sprite kit swift? [closed]
Spritekit - Increase duration every 10 points

Categories

HOME
flutter
magento
x-editable
configuration
amazon-kinesis
arm
geany
socrata
google-maps-sdk-ios
wso2-das
xorg
oracle-agile-plm
image-gallery
eigen3
ssrs-2008
gyroscope
git-bash
advantage-database-server
pwm
code-analysis
aspdotnetstorefront
core-location
precision
naturallyspeaking
google-oauth2
fat-free-framework
pdfa
toolbar
sql-server-2014-express
akka-http
dokuwiki
ecmascript-4
vue2
uistoryboardsegue
polymer-cli
qmake
opal
smartbanner
database-cleaner
laravel-routing
tpl-dataflow
canopen
omniauth
nuget-package-restore
android-camera-intent
masspay
dr-memory
geneticsharp
rails-console
measurement-protocol
xendesktop
texture2d
pygments
rsh
xmllint
restbed
python-3.1
webmail
ironmq
core-data-migration
protected
voting
translucency
dhc
simperium
modern-ui
excel-charts
misra
catalina.out
bessel-functions
syndication-feed
xacml3
jquery-backstretch
hebrew
sshj
ducttape
re2c
polarssl
sizzle
dynamic-usercontrols
cocosbuilder
guvnor
datakey
code-structure
xml-dtd
httpcontext.cache
formsauthentication
sqlitemanager
roguelike

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App