Reimplemented version of Selenium.framework for compatibility with ObjFW.
- Support for several webdriver servers - GeckoDriver, ChromeDriver, InternetExplorerWebdriverServer, MicrosoftWebDriver (Edge Browser)
- Screenshot support via stb_image - PNG, BMP, TGA and HDR are supported.
#import <ObjFW/ObjFW.h>
#import <Selenium/Selenium.h>
@interface AppDelegate: OFObject<OFApplicationDelegate>
@end
OF_APPLICATION_DELEGATE(AppDelegate)
@implementation AppDelegate
- (void)applicationDidFinishLaunching
{
SECapabilities *c = [SECapabilities new];
c.browserName = @"firefox";
SERemoteWebDriver *driver = [[SERemoteWebDriver alloc] initWithServerAddress:@"localhost" port:4444 desiredCapabilities:c requiredCapabilities:nil error:NULL];
driver.url = [OFURL URLWithString:@"https://google.com"];
[driver quit];
[OFApplication terminate];
}
@end
#import <ObjFW/ObjFW.h>
#import <Selenium/Selenium.h>
@interface AppDelegate: OFObject<OFApplicationDelegate>
@end
OF_APPLICATION_DELEGATE(AppDelegate)
@implementation AppDelegate
- (void)applicationDidFinishLaunching
{
SERemoteWebDriver *driver = [[SEGeckoDriver alloc] initWithExecutable:@"/usr/local/bin/geckodriver"];
SECapabilities *c = [SECapabilities new];
[driver startSessionWithDesiredCapabilities:c requiredCapabilities:nil];
driver.url = [OFURL URLWithString:@"https://google.com"];
[driver quit];
[OFApplication terminate];
}
@end
#import <ObjFW/ObjFW.h>
#import <Selenium/Selenium.h>
@interface AppDelegate: OFObject<OFApplicationDelegate>
@end
OF_APPLICATION_DELEGATE(AppDelegate)
@implementation AppDelegate
- (void)applicationDidFinishLaunching
{
SERemoteWebDriver *driver = [[SEGeckoDriver alloc] initWithServerAddress:@"localhost" port:4444];
SECapabilities *c = [SECapabilities new];
[driver startSessionWithDesiredCapabilities:c requiredCapabilities:nil];
driver.url = [OFURL URLWithString:@"https://google.com"];
[driver quit];
[OFApplication terminate];
}
@end
#import <ObjFW/ObjFW.h>
#import <Selenium/Selenium.h>
@interface AppDelegate: OFObject<OFApplicationDelegate>
@end
OF_APPLICATION_DELEGATE(AppDelegate)
@implementation AppDelegate
- (void)applicationDidFinishLaunching
{
SECapabilities *c = [SECapabilities new];
SERemoteWebDriver *driver = [[SEGeckoDriver alloc] initWithServerAddress:@"localhost" port:4444 desiredCapabilities:c requiredCapabilities:nil error:NULL];
driver.url = [OFURL URLWithString:@"https://google.com"];
[driver quit];
[OFApplication terminate];
}
@end
For more information and examples look at Appium.app or source.
- Clang 3.8+
- ObjFW v0.9-dev+