您的位置:首页 > 其它

selenium一个具体页面的实现(结合autoit3和sikuli)

2016-04-15 22:28 507 查看

1、添加成果界面及dom结构





2、点击上传证明后的界面及dom结构





3、利用上篇文章我们就可以很容易对上述页面进行操作

package com.wiley.enterprise;

import org.openqa.selenium.By;
import org.sikuli.script.FindFailed;
import org.testng.annotations.Test;

public class AddProperty extends BaseTest {

@Test(description = "添加成果")
public void addProperty() throws FindFailed, InterruptedException{
// 成果名称
this.sendKeys(By.name("title"), "计算机二进制设计");
// 成果类型
this.selectByValue("patent_type_id", "211");
// 证书编号
this.sendKeys(By.name("cert_no"), "123456");
// 获得年度
this.selectByValue("cert_year", "2013");
// 上传证明
this.clickEle(By.xpath("//span[@title='上传证明']"));
this.uploadFile(By.xpath("//span[@to='upload-list-cert_file_id']"), "E:\\test\\add_cq.png");
this.clickEle(By.xpath("//button[text()='保存']"));
}
}


4、查看结果

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  selenium autoit3 sikuli