com.thoughtworks.selenium.SeleniumException Java Examples

The following examples show how to use com.thoughtworks.selenium.SeleniumException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SeleniumCommandProcessor.java    From qaf with MIT License 6 votes vote down vote up
private void invokeAfterCommand(SeleniumCommandTracker commandTracker) {
	if (!invokingListener) {
		invokingListener = true;

		for (SeleniumCommandListener listener : commandListeners) {
			try {
				listener.afterCommand(this, commandTracker);
			} catch (SeleniumException ex) {
				ex.printStackTrace();
			} catch (RuntimeException e) {
				e.printStackTrace();
			}
		}
		invokingListener = false;
	}
}
 
Example #2
Source File: QAFWebDriverCommandProcessor.java    From qaf with MIT License 6 votes vote down vote up
@Override
public String doCommand(String commandName, String[] args) {

	SeleniumCommandTracker commandTracker = new SeleniumCommandTracker(commandName, args);
	invokeBeforeCommand(commandTracker);
	if (null == commandTracker.getResult()) {
		try {
			String[] argsToPass = commandTracker.getArgs();
			String result = super.doCommand(commandName, argsToPass);

			commandTracker.setResult(result);
		} catch (SeleniumException e) {
			System.out.println("Error in caught doCommand: " + commandName);
			commandTracker.setException(e);
		}
	}
	invokeAfterCommand(commandTracker);
	if (commandTracker.hasException()) {
		throw commandTracker.getException();
	}
	return commandTracker.getResult();
}
 
Example #3
Source File: IsSeleniumImpl.java    From qaf with MIT License 6 votes vote down vote up
@Override
public Dimension getDocumentSize() throws SeleniumException {
	String js =
			// "new function(){" +
			"var winW = 630, winH = 460;" + "if (document.body && document.body.offsetWidth) {"
					+ " winW = document.body.offsetWidth;" + " winH = document.body.offsetHeight;" + "}"
					+ "if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) {"
					+ " winW = document.documentElement.offsetWidth;"
					+ " winH = document.documentElement.offsetHeight;" + "}"
					+ "if (window.innerWidth && window.innerHeight) {" + " winW = window.innerWidth;"
					+ " winH = window.innerHeight;" + "}" + "winW+','+winH;";
	// + "}";
	String[] d = getEval(JavaScriptHelper.getExpression(js)).split(",");

	return new Dimension(Integer.parseInt(d[0]), Integer.parseInt(d[1]));
}
 
Example #4
Source File: IsSeleniumImpl.java    From qaf with MIT License 5 votes vote down vote up
@Override
public Dimension getScreenSize() throws SeleniumException {
	int w = Integer.parseInt(getEval(JavaScriptHelper.getExpression("screen.width")));
	int h = Integer.parseInt(getEval(JavaScriptHelper.getExpression("screen.height")));

	return new Dimension(w, h);
}
 
Example #5
Source File: IsSeleniumImpl.java    From qaf with MIT License 5 votes vote down vote up
public String flexCall(String method, String... args) throws SeleniumException {
	StringBuilder argStr = new StringBuilder("");
	for (String arg : args) {
		argStr.append(",");
		argStr.append("'" + arg + "'");
	}
	String expr = String.format("selenium.callFlexMethod(%s%s)", method, argStr.toString());
	return this.getEval(expr);
}
 
Example #6
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexMouseRollOut(String target, String args) throws SeleniumException {
	executeCommand("flexMouseRollOut", target, args);
}
 
Example #7
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexRadioButton(String target, String args) throws SeleniumException {
	return executeCommand("getFlexRadioButton", target, args).replace("OK,", "");
}
 
Example #8
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexVisible(String target) throws SeleniumException {
	return executeCommand("getFlexVisible", target, "").replace("OK,", "");
}
 
Example #9
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexMouseOver(String target, String args) throws SeleniumException {
	executeCommand("flexMouseOver", target, args);
}
 
Example #10
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexSelectionIndex(String target, String args) throws SeleniumException {
	return executeCommand("getFlexSelectionIndex", target, args).replace("OK,", "");
}
 
Example #11
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexMouseDown(String target, String args) throws SeleniumException {
	executeCommand("flexMouseDown", target, args);
}
 
Example #12
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexWaitForElement(String target) throws SeleniumException {
	executeCommand("flexWaitForElement", target, "");
}
 
Example #13
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexNumSelectedItems(String target, String args) throws SeleniumException {
	return executeCommand("getFlexNumSelectedItems", target, args).replace("OK,", "");
}
 
Example #14
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexMouseDown(String target) throws SeleniumException {
	executeCommand("flexMouseDown", target, "");
}
 
Example #15
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexMouseUp(String target, String args) throws SeleniumException {
	executeCommand("flexMouseUp", target, args);
}
 
Example #16
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexAlertPresent(String target, String args) throws SeleniumException {
	return executeCommand("getFlexAlertPresent", target, args).replace("OK,", "");
}
 
Example #17
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexType(String target) throws SeleniumException {
	executeCommand("flexType", target, "");
}
 
Example #18
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void doRefreshIDToolTips(String target, String args) throws SeleniumException {
	executeCommand("doRefreshIDToolTips", target, args);
}
 
Example #19
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexTextPresent(String target) throws SeleniumException {
	return executeCommand("getFlexTextPresent", target, "").replace("OK,", "");
}
 
Example #20
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getDataGridCellText(String target) throws SeleniumException {
	return executeCommand("getDataGridCellText", target, "").replace("OK,", "");
}
 
Example #21
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexMouseRollOut(String target) throws SeleniumException {
	executeCommand("flexMouseRollOut", target, "");
}
 
Example #22
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexAlertTextPresent(String target, String args) throws SeleniumException {
	return executeCommand("getFlexAlertTextPresent", target, args).replace("OK,", "");
}
 
Example #23
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexSelectedItemAtIndex(String target) throws SeleniumException {
	return executeCommand("getFlexSelectedItemAtIndex", target, "").replace("OK,", "");
}
 
Example #24
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexComponentInfo(String target, String args) throws SeleniumException {
	return executeCommand("getFlexComponentInfo", target, args).replace("OK,", "");
}
 
Example #25
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexAlertText(String target, String args) throws SeleniumException {
	return executeCommand("getFlexAlertText", target, args).replace("OK,", "");
}
 
Example #26
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexAlertTextPresent(String target) throws SeleniumException {
	return executeCommand("getFlexAlertTextPresent", target, "").replace("OK,", "");
}
 
Example #27
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexErrorString(String target) throws SeleniumException {
	return executeCommand("getFlexErrorString", target, "").replace("OK,", "");
}
 
Example #28
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getDataGridUIComponentLabel(String target) throws SeleniumException {
	return executeCommand("getDataGridUIComponentLabel", target, "").replace("OK,", "");
}
 
Example #29
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public void flexStepper(String target, String args) throws SeleniumException {
	executeCommand("flexStepper", target, args);
}
 
Example #30
Source File: IsSeleniumImpl.java    From qaf with MIT License 4 votes vote down vote up
public String getFlexDataGridCell(String target) throws SeleniumException {
	return executeCommand("getFlexDataGridCell", target, "").replace("OK,", "");
}