Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use selenium-objective-c framework

I want to set up some tests that use the Selenium Objective-C framework. This would enable me to hook into Appium whilst at the same time writing acceptance tests in the same language that I write the app in.

After downloading and adding the framework to my project, I added a test target, imported the framework and ran the tests. I got expected type errors around NSPoint, NSSize, etc. which are all contained in the library.

After some investigation I realised that Selenium Objective-C uses the Mac OS version of Foundation.framework which contains the classes NSPoint, NSSize, etc. However, my app is an iOS app, so in Foundation.framework I have CGPoint, CGSize, etc...

My question is, has anyone been able to use Selenium Objective-C? If so, how did you achieve this?

Environment: Xcode 5, iOS Simulator 7.0 iPad.

like image 343
teddy777 Avatar asked Nov 10 '22 11:11

teddy777


1 Answers

The reason you saw those issues is that the Selenium-Objective-C project used to for Mac only. In the Mac libraries NSPoint replaces CGPoint, CGSize -> NSSize

It wasn't all that much work to make it work for both, so I just checked in support for building for iOS.

https://github.com/appium/selenium-objective-c/commit/c27a5faf266719c87eda502718c90e350aba931e

like image 82
Dan Cuellar Avatar answered Nov 15 '22 07:11

Dan Cuellar