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

Is there a way to set a camera into landscape mode in swift?
How do I change the pitch of recorded voice audio? I'm getting the same voice as I recorded
How to remove white spaces inside a string? [duplicate]
Can't export development iOS App after archiving it
WatchOS2 Event Complication, how to step to next event at endTime of prior event? (getTimelineEntriesForComplication)
Swift more complex array dictionary
Change google maps location button image [duplicate]
ios view transition is getting distorted with setNavigationBarHidden=YES
How to implementent videoGravity for CAMetalLayer?
Display two images in didFinishPickingImage - iOS Swift 2.2 [duplicate]
Set CGPath width to view width
Best practice to define enums? [closed]
Sending picked image to another view
Jail broken iOS: Communication between tweak and application
Download data from iCloud if app is not running
Move function void to boolean Swift

Categories

HOME
uwp
asp.net-mvc
lua
anylogic
windows-runtime
middleware
httpbuilder-ng
spacemacs
command-line-arguments
signature
smartsheet-c#-sdk-v2
jmespath
textmatebundles
rtp
nested-set-model
rgdal
rrd
iar
number-formatting
android-security
memorystream
file-manager
jsplumb
react-redux-form
background-process
jdk1.6
xaf
vtable
rft
azure-management-api
msysgit
sections
scoring
multisite
laravel-routing
mashery
flying-saucer
graph-traversal
assembly-references
breach-attack
ipmi
sizing
topojson
ipopt
measurement-protocol
webtrends
struts1
visual-build-professional
ios-frameworks
storage-duration
screen-capture
multer
ane
armv7
cng
oboe.js
selectsinglenode
bonfire
simperium
sql-server-ce-3.5
easynetq
sigkill
words
isql
gcovr
private-methods
zeroclipboard
aps
custom-titlebar
mydbr
hebrew
deap
kmz
couchpotato
uptime
northwind
gigaspaces
code-structure
media-manager
objcopy
gemstone
machine.config
cassandra-0.7
wmd
markitup
dynamic-websites
68hc11
fogbugz-on-demand
shareware
greensoftware
ants

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