Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
ikylin committed May 29, 2012
1 parent 19cd680 commit c147a5f
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 0 deletions.
9 changes: 9 additions & 0 deletions watij/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/watij"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions watij/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>watij</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>
6 changes: 6 additions & 0 deletions watij/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Mon May 28 11:17:20 CST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
8 changes: 8 additions & 0 deletions watij/.settings/org.maven.ide.eclipse.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Mon May 28 11:17:18 CST 2012
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1
27 changes: 27 additions & 0 deletions watij/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.bst.brower</groupId>
<artifactId>watij</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>watij</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>


<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
27 changes: 27 additions & 0 deletions watij/src/main/java/com/bst/brower/watij/TestConcord.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.bst.brower.watij;

import junit.framework.TestCase;
import static watij.finders.SymbolFactory.name;
import watij.runtime.ie.IE;

public class TestConcord extends TestCase {
public void testconcordfunction() throws Exception {
IE ie = new IE();
// 打开 IE 浏览器
ie.start();
// 转到 concord77
ie
.goTo("http://concord77.cn.ibm.com/files/app?lang=en_US#/pinnedfiles");
// 窗口最大化
ie.maximize();
// 安全认证
ie.link(name, "overridelink").click();
// 在输入框内输入用户名和密码
ie.textField(name, "j_username").set("Abdul_000_006");
ie.textField(name, "j_password").set("passw0rd");
// 点击登陆
ie.button("登录").click();
// 保存结果图
ie.screenCapture("D:\\Savelogin.png");
}
}
20 changes: 20 additions & 0 deletions watij/src/main/java/com/bst/brower/watij/TestWatijIBM.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.bst.brower.watij;
import static watij.finders.SymbolFactory.name;
import junit.framework.TestCase;
import watij.runtime.ie.IE;

public class TestWatijIBM extends TestCase {
public void testgooglesearch() throws Exception {
IE ie = new IE();
// 打开 IE 浏览器
ie.start();
// 转到百度主页
ie.goTo("www.baidu.com");
// 在输入框内输入“IBM”
ie.textField(name, "wd").set("IBM");
// 点击“百度一下”进行查找
ie.button("百度一下").click();
// 等待 3 秒
ie.wait(3);
}
}

0 comments on commit c147a5f

Please sign in to comment.