appium_object-c
来源:互联网 发布:上海复旦大学网络教育 编辑:程序博客网 时间:2024/05/24 00:22
#import <Selenium/SERemoteWebDriver.h>
@implementation SeleniumTest
-(void) run
{
SECapabilities *caps = [SECapabilities new];
[caps setPlatform:@"Mac"];
[caps setBrowserName:@"iOS"];
[caps setVersion:@"6.1"];
[caps addCapabilityForKey:@"app" andValue:@"/Users/mac_hy/Library/Developer/Xcode/DerivedData/ZDPrometheus-eanlmixqosrcqbaqvpsbixofcqto/Build/Products/Debug-iphonesimulator/guest.app"];
NSError *error;
SERemoteWebDriver *wd = [[SERemoteWebDriver alloc] initWithServerAddress:@"127.0.0.1" port:4723 desiredCapabilities:caps requiredCapabilities:nil error:&error];
[[wd findElementBy:[SEBY xPath:@"//window[1]/image[3]"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/image[3]"]] click];
[[wd findElementBy:[SEBY name:@"tabbar item unselected 01"]] click];
[[wd findElementBy:[SEBY name:@"手机号码"]] sendKeys:@"131012345678"];
// 131012345678
[[wd findElementBy:[SEBY xPath:@"//window[1]/textfield[1]"]] sendKeys:@"131012345678"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/secure[1]"]] sendKeys:@"123456"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/button[7]"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/scrollview[1]"]] click];
[wd executeScript:@"mobile: swipe" arguments:[[NSArray alloc] initWithObjects:[[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInteger:1, @"touchCount", [NSNumber numberWithFloat:59f, @"startX", [NSNumber numberWithFloat:286f, @"startY", [NSNumber numberWithFloat:70f, @"endX", [NSNumber numberWithFloat:297f, @"endY", [NSNumber numberWithFloat:0.9494141f, @"duration", nil], nil]];
[[wd findElementBy:[SEBY xPath:@"//window[1]/text[1]"]] click];
[[wd findElementBy:[SEBY name:@"apply business dropdown arrow "]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/tableview[1]/cell[2]/button[1]"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/textfield[1]"]] sendKeys:@"13101234567"];
[[wd findElementBy:[SEBY name:@"apply business button submit"]] click];
[wd acceptAlert];
[[wd findElementBy:[SEBY xPath:@"//window[4]/alert[1]/text[1]"]] click];
[[wd findElementBy:[SEBY name:@"确定"]] click];
[[wd findElementBy:[SEBY name:@"tabbar item unselected 01"]] click];
[[wd findElementBy:[SEBY name:@"注册"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/textfield[1]"]] sendKeys:@"18321333675"];
[[wd findElementBy:[SEBY name:@"sign up agreement button"]] click];
[wd executeScript:@" "];
[wd executeScript:@"用户协议"];
[[wd findElementBy:[SEBY name:@"navigation bar button back"]] click];
[[wd findElementBy:[SEBY name:@"sign up agreement button unsel"]] click];
[[wd findElementBy:[SEBY name:@"发送验证码"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/textfield[1]"]] sendKeys:@"804592"];
[[wd findElementBy:[SEBY name:@"(null)"]] sendKeys:@"804592"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/secure[1]"]] sendKeys:@"123456"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/secure[2]"]] sendKeys:@"123456"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/button[2]"]] click];
}
@implementation SeleniumTest
-(void) run
{
SECapabilities *caps = [SECapabilities new];
[caps setPlatform:@"Mac"];
[caps setBrowserName:@"iOS"];
[caps setVersion:@"6.1"];
[caps addCapabilityForKey:@"app" andValue:@"/Users/mac_hy/Library/Developer/Xcode/DerivedData/ZDPrometheus-eanlmixqosrcqbaqvpsbixofcqto/Build/Products/Debug-iphonesimulator/guest.app"];
NSError *error;
SERemoteWebDriver *wd = [[SERemoteWebDriver alloc] initWithServerAddress:@"127.0.0.1" port:4723 desiredCapabilities:caps requiredCapabilities:nil error:&error];
[[wd findElementBy:[SEBY xPath:@"//window[1]/image[3]"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/image[3]"]] click];
[[wd findElementBy:[SEBY name:@"tabbar item unselected 01"]] click];
[[wd findElementBy:[SEBY name:@"手机号码"]] sendKeys:@"131012345678"];
// 131012345678
[[wd findElementBy:[SEBY xPath:@"//window[1]/textfield[1]"]] sendKeys:@"131012345678"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/secure[1]"]] sendKeys:@"123456"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/button[7]"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/scrollview[1]"]] click];
[wd executeScript:@"mobile: swipe" arguments:[[NSArray alloc] initWithObjects:[[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInteger:1, @"touchCount", [NSNumber numberWithFloat:59f, @"startX", [NSNumber numberWithFloat:286f, @"startY", [NSNumber numberWithFloat:70f, @"endX", [NSNumber numberWithFloat:297f, @"endY", [NSNumber numberWithFloat:0.9494141f, @"duration", nil], nil]];
[[wd findElementBy:[SEBY xPath:@"//window[1]/text[1]"]] click];
[[wd findElementBy:[SEBY name:@"apply business dropdown arrow "]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/tableview[1]/cell[2]/button[1]"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/textfield[1]"]] sendKeys:@"13101234567"];
[[wd findElementBy:[SEBY name:@"apply business button submit"]] click];
[wd acceptAlert];
[[wd findElementBy:[SEBY xPath:@"//window[4]/alert[1]/text[1]"]] click];
[[wd findElementBy:[SEBY name:@"确定"]] click];
[[wd findElementBy:[SEBY name:@"tabbar item unselected 01"]] click];
[[wd findElementBy:[SEBY name:@"注册"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/textfield[1]"]] sendKeys:@"18321333675"];
[[wd findElementBy:[SEBY name:@"sign up agreement button"]] click];
[wd executeScript:@" "];
[wd executeScript:@"用户协议"];
[[wd findElementBy:[SEBY name:@"navigation bar button back"]] click];
[[wd findElementBy:[SEBY name:@"sign up agreement button unsel"]] click];
[[wd findElementBy:[SEBY name:@"发送验证码"]] click];
[[wd findElementBy:[SEBY xPath:@"//window[1]/textfield[1]"]] sendKeys:@"804592"];
[[wd findElementBy:[SEBY name:@"(null)"]] sendKeys:@"804592"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/secure[1]"]] sendKeys:@"123456"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/secure[2]"]] sendKeys:@"123456"];
[[wd findElementBy:[SEBY xPath:@"//window[1]/button[2]"]] click];
}
- appium_object-c
- c
- c
- c
- c
- C
- c
- c
- c
- C+
- c
- C
- c
- c
- c
- C
- C
- c
- 好久不看汇编了
- 关于生成并发唯一性流水号的解决方案
- Java学习笔记 - 单例设计模式 (一)
- IPTABLES 允许PING 出,但不允许PING进;允许DNS;允许25出【备忘】
- Hadoop MapReduce之ReduceTask任务执行(一)
- appium_object-c
- 禁止缓存
- java socket编程
- 图片拉伸方法
- 从后台传递List到前台js中使用
- appium-python
- oracle 查看表注释,列注释,列类型
- listener trace, server trace用法
- ARM处理器架构-----异常/中断处理