title: UI Automation "could not be tapped because the element is not visible" iOS
body: <p>this is driving me insane, if anyone can help I'd really appreciate it...
  I'm trying to write a ui automation script to test an app. There is a particular collection view, where the cells are generated from a nib via firstly the view did load....</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  // Do any additional setup after loading the view, typically from a nib.
      self.title = @"Forms";
  
      [self.categoryCollectionView registerNib:[UINib nibWithNibName:@"HomeCategoryCell"    bundle:nil] forCellWithReuseIdentifier:@"HomeCategoryCell"];
      [self.formsCollectionView registerNib:[UINib nibWithNibName:@"HomeFormCell" bundle:nil] forCellWithReuseIdentifier:@"HomeFormCell"];
      [self.existingFormsCollectionView registerNib:[UINib nibWithNibName:@"HomeExistingFormCell" bundle:nil] forCellWithReuseIdentifier:@"HomeExistingFormCell"];
  
      [self setupFormCategories];
  }
  </code></pre>
  
  <p>And then a setup form method...</p>
  
  <pre><code>- (void)setupFormCategories
  {
      categories = [[NSMutableArray alloc] init];
      FormCategory *cat = [[FormCategory alloc] init];
      cat.categoryTitle = @"All Forms";
      cat.iconFileName = @"CategoryIcon.png";
      cat.relatedForms = @[@"Form Type 1", @"Form Type 2"];
      [categories addObject:cat];
  
      cat = [[FormCategory alloc] init];
      cat.categoryTitle = @"Customer Forms";
      cat.iconFileName = @"CategoryIcon.png";
      cat.relatedForms = @[@"Form Type 1", @"Form Type 2"];
      [categories addObject:cat];
  
      cat = [[FormCategory alloc] init];
      cat.categoryTitle = @"Client Forms";
      cat.iconFileName = @"CategoryIcon.png";
      cat.relatedForms = @[@"Form Type 1", @"Form Type 2"];
      [categories addObject:cat];
  
      cat = [[FormCategory alloc] init];
      cat.categoryTitle = @"User Forms";
      cat.iconFileName = @"CategoryIcon.png";
      cat.relatedForms = @[@"Form Type 1", @"Form Type 2"];
      [categories addObject:cat];
  
      brandNewForms = nil;
  }
  </code></pre>
  
  <p>I have tried several ways of selecting one of these forms, (both the categoryTitle and then the related forms...</p>
  
  <pre><code>target.frontMostApp().mainWindow().collectionViews()[0].cells()["User Forms"].tap();
  </code></pre>
  
  <p>As well as firstWithPredicate etc... However I always get the same response....</p>
  
  <p>Script threw an uncaught JavaScript error: target.frontMostApp().mainWindow().collectionViews()[0].cells()["User Forms"] could not be tapped because the element is not visible on line 64 of wip.js</p>
  
  <p>If I log the element tree, it can see all of the element types and returns a full element tree. If I record user interaction via Instruments, it recognises the elements, and will generate this javascript...</p>
  
  <pre><code>target.frontMostApp().mainWindow().collectionViews()[0].cells()["User Forms"].tap();
  </code></pre>
  
  <p>No matter what I do I can't get it to work. I've tried changing the accessibility settings via interface builder, ensuring the view it is a sub of does not have any accessibility set, however I can't get it to work. I also can't understand why it would recognise the elements in logElementTree and record, but not when run...</p>
  
  <p>Any ideas... Any suggestions how I may be able to modify the objective C code if this is the problem....? I've tried playing with the cat.accessibilityLabel= @"User Forms"; but I'm a newbie to objective C and I don't really know what I'm doing....</p>
  
  <p>xCode 5 / iOS7 simulator... but I've also tried in xCode 4.6.3 / iOS6.1....</p>