本文整理汇总了Java中org.sikuli.script.App类的典型用法代码示例。如果您正苦于以下问题:Java App类的具体用法?Java App怎么用?Java App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
App类属于org.sikuli.script包,在下文中一共展示了App类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: openApp
import org.sikuli.script.App; //导入依赖的package包/类
/**
* Open the given Application
*/
@Action(object = ObjectType.APP,
desc = "Open the Application [<Data>]",
input = InputType.YES)
public void openApp() {
try {
String loc, id;
if (Data.contains(",")) {
loc = Data.split(",")[0];
id = Data.split(",")[1];
} else {
id = loc = Data;
}
appList.put(id, App.open(loc));
Report.updateTestLog(Action, "Open action is done", Status.DONE);
Thread.sleep(1000);
} catch (Exception ex) {
Report.updateTestLog(Action, ex.getMessage(), Status.FAIL);
Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex);
}
}
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:24,代码来源:Application.java
示例2: testSomething
import org.sikuli.script.App; //导入依赖的package包/类
@Test
public void testSomething() throws FindFailed {
App.focus("firefox");
Screen screen = new Screen();
goToURL(screen, "http://currentlabel.co.uk/flexuscalculus/");
screen.wait("src/images/pompei.png", 20);
Match pompei = screen.find("src/images/pompei.png");
pompei.setTargetOffset(70, 0);
pompei.click();
clearField(screen);
screen.type("0");
pompei.setTargetOffset(170, 0);
pompei.click();
clearField(screen);
screen.type("0");
pompei.setTargetOffset(270, 0);
pompei.click();
clearField(screen);
screen.type("0");
pompei.setTargetOffset(370, 0);
pompei.click();
clearField(screen);
screen.type("0");
pompei.setTargetOffset(470, 0);
pompei.click();
clearField(screen);
screen.type("0");
pompei.setTargetOffset(470, -70);
pompei.click(); // deselect last cell of popei row.
assertNotNull("Pompei row should be zeroed out",
screen.wait("src/images/pompeiRowOfZeros.png", 5));
}
开发者ID:paul-hammant,项目名称:MySikuliExample,代码行数:35,代码来源:MySikuliTest.java
示例3: open
import org.sikuli.script.App; //导入依赖的package包/类
/**
* Opens the created application. For loadtime intensiv application change the default sleep time with {@link
* #setSleepTime(Integer)}.
*
* @return this {@link Application}.
*/
@LogToResult(message = "open application")
@Override
public Application open() {
App app = super.open();
if (app == null) {
loader.getExceptionHandler().handleException("Application '" + this.getName() + " could not be opened! ... Please check the application name or path!", resumeOnException);
return null;
}
/*** automatic sleep for long loading applications, see {@link #setSleepTime(Integer)} **/
sleep(sleepMillis);
final String appID = "" + app.getName() +
((app.getPID() != null && app.getPID() > 0) ? " PID:" + app.getPID() : "");
final int tries = 5;
LOGGER.debug("verify app " + appID + " is running");
if (!app.isRunning(tries)) {
LOGGER.warn("verified {} times if application '" + appID + "' is running", tries);
loader.getExceptionHandler().handleException("Application '" + appID + "' failed to open or is not running", resumeOnException);
}
LOGGER.info("Application '" + appID + "' is running");
return this;
}
开发者ID:ConSol,项目名称:sakuli,代码行数:29,代码来源:Application.java
示例4: closeApp
import org.sikuli.script.App; //导入依赖的package包/类
public void closeApp(String appCommand) {
if (isInteger(appCommand)) {
try {
new App(Integer.parseInt(appCommand)).close();
} catch (NullPointerException e) {
SikuliLogger.log("Application not found with given PID. Maybe it's closed earlier?");
SikuliLogger.logDebug(e.getStackTrace());
}
} else {
App.close(appCommand);
}
}
开发者ID:Hi-Fi,项目名称:remotesikulilibrary,代码行数:13,代码来源:Server.java
示例5: switchApp
import org.sikuli.script.App; //导入依赖的package包/类
public void switchApp(String appCommand) {
if (isInteger(appCommand)) {
new App(Integer.parseInt(appCommand)).focus();
} else {
App.focus(appCommand);
}
}
开发者ID:Hi-Fi,项目名称:remotesikulilibrary,代码行数:8,代码来源:Server.java
示例6: getRegionFromFocusedWindow
import org.sikuli.script.App; //导入依赖的package包/类
/**
* @return a {@link Region} object from the current focused window or NULL on errors.
*/
@LogToResult(logClassInstance = false)
public Region getRegionFromFocusedWindow() {
org.sikuli.script.Region origRegion = App.focusedWindow();
if (origRegion != null) {
return new Region(origRegion, resumeOnException);
}
loader.getExceptionHandler().handleException("couldn't extract a Region from the current focused window", resumeOnException);
return null;
}
开发者ID:ConSol,项目名称:sakuli,代码行数:13,代码来源:Environment.java
示例7: focusWindow
import org.sikuli.script.App; //导入依赖的package包/类
/**
* focus a specific window of the application.
*
* @param windowNumber indemnifies the window
* @return this {@link Application}.
*/
@LogToResult(message = "focus application in window")
public Application focusWindow(Integer windowNumber) {
LOGGER.debug("Focus window \"" + windowNumber + "\" in application \"" + getName() + "\".");
App app = super.focus(windowNumber);
if (app == null) {
LOGGER.warn("Application '{}' could not be focused! ... Please check if the application has been opened before or is already focused!", getName());
return this;
}
/*** automatic sleep for long loading applications, see {@link #setSleepTime(Integer)} **/
sleep(sleepMillis);
return this;
}
开发者ID:ConSol,项目名称:sakuli,代码行数:19,代码来源:Application.java
示例8: before
import org.sikuli.script.App; //导入依赖的package包/类
@Before
public void before() {
sikuli = new Screen();
ImagePath.add("src/test/resources/sikuli-images/win-10-calculator.sikuli");
sikuliApp = App.open("calc.exe");
}
开发者ID:marcoslimaqa,项目名称:sikuli-factory,代码行数:7,代码来源:Win10CalculatorTest.java
示例9: runFirst
import org.sikuli.script.App; //导入依赖的package包/类
@Override
public void runFirst() {
virtualIndex = slider.getVirtualPartIndex(virtualparts);
r = App.focusedWindow();
prev = Mouse.at();
}
开发者ID:SlideKB,项目名称:SlideBar,代码行数:7,代码来源:Scroller.java
示例10: updateRegionToFocusedApp
import org.sikuli.script.App; //导入依赖的package包/类
public void updateRegionToFocusedApp() {
Helper.setRegion(App.focusedWindow());
SikuliLogger.log(Helper.getRegion());
}
开发者ID:Hi-Fi,项目名称:remotesikulilibrary,代码行数:5,代码来源:Server.java
示例11: startApp
import org.sikuli.script.App; //导入依赖的package包/类
public int startApp(String appCommand) {
return App.open(appCommand).getPID();
}
开发者ID:Hi-Fi,项目名称:remotesikulilibrary,代码行数:4,代码来源:Server.java
示例12: getClipboard
import org.sikuli.script.App; //导入依赖的package包/类
/**
* @return the current content of the clipboard as {@link String} or NULL on errors
*/
@LogToResult(message = "get string from system clipboard", logClassInstance = false)
public String getClipboard() {
return App.getClipboard();
}
开发者ID:ConSol,项目名称:sakuli,代码行数:8,代码来源:Environment.java
示例13: setClipboard
import org.sikuli.script.App; //导入依赖的package包/类
/**
* sets the String parameter to the system clipboard
*
* @param text as {@link String}
* @return this {@link Environment}.
*/
@LogToResult(message = "put to clipboard", logClassInstance = false)
public Environment setClipboard(String text) {
App.setClipboard(text);
return this;
}
开发者ID:ConSol,项目名称:sakuli,代码行数:12,代码来源:Environment.java
注:本文中的org.sikuli.script.App类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论