I've being trying to access to the uielements (labels) which are located within UITableViewCell which is located in UITableView. (see the picture below)
I set a setIsAccessibilityElement:YES and setAccessibilityLabelto each required label I can access with no issues.
I'm adding an accessibility to the cell , still can access to each label in addition to the cell as well
I'm adding accessibility to the table from this point Appium cannot recognise/inspect the cell and the labels , but only the table ...
The thing is , IOS Accessibility inspector (runs from IOS simulator) does able to recognise the table / cell / labels
Any idea what Do I need in the sourcecode of the app in order to make it work with Appium ?
Thanks
Found this on http://appium.io/slate/en/v/?javascript#finding-and-interacting-with-elements
There’s a known issue with table cell elements becoming invalidated before there’s time to interact with them. We’re working on a fix
However, what I did find was if you were to .click() on the UITableView element it picked the row in the center of the screen. Not sure if that's helpful in your testing.
Related
UITableViewCell shows up in Main.storyboard but doesn't show up in simulator.
I'm using Main.storyboard. In my simple experiment with Swift, I added a TableView, then put a UITableViewCell in it, and then I put an image and a label under the cell's content. It looks okay in Main.storyboard but when I run the project, the content disappear. All I did is purely on Main.storyboard and not touching the .swift file yet.
Here are the links of screenshots of my simple work:
How my app looks in Main.storyboard
How it looks when I run Xcode simulator on iPhone 8, the tableview cell's content disappear
I have searched the problem through the stackoverflow and found a related question here: 'UIImageView doesn't show up in simulator', then I followed the recommended solutions from the forum but still didn't solve the bug.
What I have done so far to solve the bug:
Check if every item in my view has four constraints defining X, Y position, width and height.
Try to check and uncheck the autolayout flag for my Main.storyboard
Make sure my tableview cell's contents (and everything inside my view) has alpha set to 1
Well I haven't check how things looks in my .xib file.
I would like to know if this is a bug, or just a problem in my settings?
I'm quite new to Xcode, swift, and iOS app. Any help or suggestion would be greatly appreciated. If you have the same problem with me, I would like to know your case as well.
The only reason your cell doesn't show up in the simulator is because your tableview is dynamic.
Dynamic table views have data that is loaded at runtime, where there isn't a fixed number of cells, and every cell has the same layout. The Apple tutorial is a good place to start. It guides you through on how to use a tableview/tableviewcontroller.
There is no way around it: You have to code in .swift files if you want to use dynamic table views.
If you are going to use static table views, on the other hand, the number of cells is fixed, and the data is not loaded at runtime. You can use static tableviews if you don't want anything to do with code at the moment.
I had a similar problem. I solved it by deleting constraints for the affected view and starting all over.
since the upgrade to Xcode 7 & testing my app with iOS9, the contents of some custom cells have become invisible at runtime. There's an emphasis on 'some' here, as this affects only 2 out of 6 table views, all of which reside in different view controllers.
A similar problem was encountered here, but the answer ("check constraints") does not work for me:
Custom TableViewCell contents invisible on ios9 xcode7
The cell that makes trouble is a large placeholder that is displayed when no data is available to be presented in the table.
It only contains a UILabel which is centered by two constraints.
The cell, as well as other custom cells not shown in the picture, are visible at runtime. However, not their contents.
In other view controllers of the same app, the exact same custom cell (same design, same class, same reuse identifier...) work as they should.
However, not in this VC.
Before the upgrade to Xcode 7 and testing on iOS9, the cell's content was visible also in this VC.
I haven't changed anything in IB or the code and double-checked everything a couple times. It's crazy and I am desperately looking for help :-)
Thanks for your time
In the meantime I figured out the answer:
In iOS 8.4, the label is installed in the view hierarchy, whereas it isn't in iOS 9.2 according to XCode's view debugger.
The size class for the label is Regular/Regular, which should suffice for iPad.
When I add the size class Any/Any for the label, it will install correctly.
This is clearly a bug which has been confirmed to my by Apple, but not acted upon yet.
Here is some background to the issue. I've been looking at it for the past two days and to my knowledge everything is properly configured. To make sure that we are on the same page with versions that are being used I am using the following:
Xcode 6.1
Code is in Swift with some added Objective-C libraries
OS X is 10.9.5
I have UISplitView that was added to the storyboard at a later stage of the project. The project was started form Single View template. Normally the left part consist of a UITableView. When Xcode added it to my storyboard it also had a prototype cell setup. I've added the needed Identifiers and now the prototype cell is accessible in my code. I've implemented and binded the needed delegate and dataSource protocols and checked that their methods are actually being called and working. I've also added background colors to the prototype cell and the prototype label and I see a cell when there should be one but it does not have a label. So here is a list what I've checked:
Data binding is working and data is available. I've also cross checked this with a second UITableView that is in the project and is working properly. This is also true because I see the background color that was set for the cell when I run the app and data is available;
The storyboard does not have any errors or warnings. In fact the project itself does not have any warnings on compilation;
I've reset/removed/recreated constraints multiple times;
I've used the Preview mode and I can see the label rendered properly on my target device and orientation. I've checked this because storyboard sizing can be easily overseen so that you actually don't have the label for this device and orientation but this is not the case;
I've used the new layout debug feature that Apple added in Xcode 6 called view debugger and it does not show a label for this cell. And on the following screen shot you can see that the background of the cell has been properly rendered but there is nothing that is on top of this cell. The cell has been selected for better clarity.
So pretty much I am out of ideas right now. Can you please help me on revealing this mystery?
To answer my own question.
I've created an empty master detail project and saw that this is working there. This made me think that actually there is some kind of a bug in Xcode when you drag and drop an UISplitViewController to your storyboard. For some reason the storyboard is not properly configured. I have no idea what is not properly configured but there is definitely something that is wrong.
Because of the above observations I deleted the UISPlitViewController and used a plain UIViewController to recreate a similar setup that will also work for me. As a result I was able to adjust my already existing code to the new View and use it without logic changes. Which to me just indicates that this is an Xcode issue.
Thanks!
I'm creating a Table View in Interface Builder (Storyboard). I'd like to have a couple of different Dynamic Prototype cells with different sets of Labels and Images in them and so on, and I can give them different reuseIdentifiers so I can pick which ones I want at runtime.
In Interface Builder, I create several Dynamic Prototype cells in my UITableView, which is controlled by a UITableViewController.
In the first cell, I drag and drop in various views and so on.
In the second cell, IB will not let me drag any views into it? I can resize the second cell vertically, but can't put anything into it at all, either by dragging into the cell or into the object graph in the left-side bar.
If I copy and paste the first cell, a second Dynamic Prototype will appear with all of the same contents, but I won't be able to modify the copied cell (can't add or move subviews). However--and this is strange--I can select the constraints and modify their values to resize and shift objects in the second cell.
As a note, running XCode 5-DP3. Tried restarting it (didn't expect that to help, and it didn't). Otherwise, unsure what to try, and unsure if I'm doing something very braindead, or if this is a bug I need to report to Apple.
So, am I crazy? Has anyone experienced this/can anyone recreate this?
EDIT:
After further testing, if I stick a big UIView into the first cell, and then copy that cell, I can edit inside my added view. (Does this make sense?) I can't edit anything that lies within the second UITableViewCell, but if it contains a UIView copied over from the first cell, I can put new views into that view and move them around and so on. Super-strange.
For the sake of posterity, I'm answering my own question:
The way I solved this was to take a UITableViewCell object from the Object library and drag it onto the UITableView. Sounds simple, right?
The problem I was running into was only if I copied existing dynamic prototypes through Cmd+C & Cmd+V, or by incrementing the number in the Attributes inspector for the table view. The Storyboard Editor wouldn't allow me to modify those ones.
Dropping in new cells from the Object library let me tweak them all separately.
XCode 5-DP6 solved issues with not abling to resize cell's subviews.
I've created an UIView and modified with XCode :
But the resultant display on simulator and device is :
So, there is some property or anything in order to table maintain the height defined on the XCode edition? Note that the table has a bigger than the table on simulator.
You need to check the section height, header and footer:
It is a bit hard to see what is going on in your picture, but make sure you are making use of sections--it almost looks like you have multiple UITableViews. You should only have to use one tableview for your UI here.
A second thing to check is those UISearchBars. Are they meant to be there?