-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
watij/src/main/java/com/bst/brower/watij/TestWatijIBM.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |