Projects >> operaprestodriver >>664b3946f059e5e6af67539946a22b2a3d85540a

Chunk
Conflicting content
	protected ScopeServices services;
	protected ScopeActions actionHandler;
	
<<<<<<< HEAD
	private static String operaDriverVersion = null;	
	
	// ***** CONSTRUCTORS *****
=======
	
	public OperaDriver() {
		this(null);
	}
	
	/**
	 * Constructor that starts opera.
	 */
>>>>>>> 0a9e1e975a02efec859ecdd6230570a0de0d6a85
	public OperaDriver(OperaDriverSettings settings){
		if(settings != null) {
			this.settings = settings;
Solution content
	protected ScopeServices services;
	protected ScopeActions actionHandler;
	private static String operaDriverVersion = null;	
	
	// ***** CONSTRUCTORS *****
	public OperaDriver(OperaDriverSettings settings){
		if(settings != null) {
			this.settings = settings;
File
OperaDriver.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
Method declaration
Chunk
Conflicting content
		windowManager.filterActiveWindow();
	}

<<<<<<< HEAD
	private void closeWindow() {
		exec.action("Close page");
=======
	public String getCurrentUrl() {
		return debugger.executeJavascript("return document.location.href");
>>>>>>> 0a9e1e975a02efec859ecdd6230570a0de0d6a85
	}
	
	public String getTitle() {
Solution content
		windowManager.filterActiveWindow();
	}

	private void closeWindow() {
		exec.action("Close page");

	public String getCurrentUrl() {
		return debugger.executeJavascript("return document.location.href");
	}
	
	public String getTitle() {
File
OperaDriver.java
Developer's decision
Concatenation
Kind of conflict
Method invocation
Method signature
Return statement
Chunk
Conflicting content
	public String getPageSource() {
		return debugger.executeJavascript("return document.documentElement.outerHTML");
	}
<<<<<<< HEAD
	
	// FIXME - should this be added to the official API?  -- jamesl (07/12/2010)
=======

	public String getTitle() {
		return debugger.executeJavascript("return top.document.title ? top.document.title : '';");
	}

	public String getWindowHandle() {
		return debugger.executeJavascript("return top.window.name ? top.window.name : top.document.title;");
	}

	public Set getWindowHandles() {
		
		List windowIds = windowManager.getWindowHandles();
		Set handles = new TreeSet();
		
		if(OperaIntervals.ENABLE_DEBUGGER.getValue() != 1) {
			for (Integer windowId : windowIds) {
				handles.add(windowId.toString());
			}
			return handles;
		}

		windowManager.clearFilter();
		
		for (Integer windowId : windowIds) {
			//windowManager.filterWindow(windowId);
			String handleName = debugger.executeJavascript("return top.window.name ? top.window.name : (top.document.title ? top.document.title : 'undefined');", windowId);
			handles.add(handleName);
		}
		
		windowManager.filterActiveWindow();
		debugger.resetRuntimesList();
		return handles;
	}
	
	public int getWindowCount() {
		return windowManager.getWindowHandles().size();
	}

	public Options manage() {
		return new OperaOptions();
	}

	public Navigation navigate() {
		return new OperaNavigation();
	}

	public void quit() {
		services.quit();
	}

	public TargetLocator switchTo() {
		return new OperaTargetLocator();
	}
	
	private class OperaTargetLocator implements TargetLocator {

		public WebElement activeElement() {
			return OperaDriver.this.findActiveElement();
		}

		public WebDriver defaultContent() {
			//change to _top
			windowManager.filterActiveWindow();
			debugger.resetFramePath();
			while(findElementsByTagName("frameset").size() > 0) {
				switchTo().frame(0);
			}
			//waitForLoadToComplete();
			return OperaDriver.this;
		}

		public WebDriver frame(int frameIndex) {
			//make sure we execute this one on "_top"
			debugger.resetFramePath();
			int framesLength = Integer.valueOf(debugger.executeJavascript("return document.frames.length"));
			
			if(frameIndex < 0 || frameIndex >= framesLength)
				throw new NoSuchFrameException("Invalid frame index : " + frameIndex);

			debugger.changeRuntime(frameIndex);
			
			return OperaDriver.this;
		}

		public WebDriver frame(String frameName) {
			debugger.resetFramePath();	
			debugger.changeRuntime(frameName);
			return OperaDriver.this;
		}
		

		public WebDriver window(String windowName) {
			windowManager.clearFilter();
			
			List windowIds = windowManager.getWindowHandles();
			
			Integer id = 0;
			
			for (Integer windowId : windowIds) {
				String name = debugger.executeJavascript("return top.window.name ? top.window.name : top.document.title;", windowId);
				if(name.equals(windowName)) {
					id = windowId;
					break;
				}
			}
			
			if(id == 0)
				throw new NoSuchWindowException("Window with name "  + windowName + " not found");
			windowManager.setActiveWindowId(id);
			
			windowManager.filterActiveWindow();
			debugger.resetRuntimesList();
			
			defaultContent(); //set runtime to _top
			debugger.executeJavascript("window.focus()", false); //steal focus
			return OperaDriver.this;
		}
		
	}
	
	/**
	 * TODO: Add to official API?
	 * @return list of frames available for chosing
	 */
>>>>>>> 0a9e1e975a02efec859ecdd6230570a0de0d6a85
	public List listFrames(){
		return debugger.listFramePaths();
	}
Solution content
	public String getPageSource() {
		return debugger.executeJavascript("return document.documentElement.outerHTML");
	}
	
	// FIXME - should this be added to the official API?  -- jamesl (07/12/2010)
	public String getTitle() {
		return debugger.executeJavascript("return top.document.title ? top.document.title : '';");
	}

	public String getWindowHandle() {
		return debugger.executeJavascript("return top.window.name ? top.window.name : top.document.title;");
	}

	public Set getWindowHandles() {
		
		List windowIds = windowManager.getWindowHandles();
		Set handles = new TreeSet();
		
		if(OperaIntervals.ENABLE_DEBUGGER.getValue() != 1) {
			for (Integer windowId : windowIds) {
				handles.add(windowId.toString());
			}
			return handles;
		}

		windowManager.clearFilter();
		
		for (Integer windowId : windowIds) {
			//windowManager.filterWindow(windowId);
			String handleName = debugger.executeJavascript("return top.window.name ? top.window.name : (top.document.title ? top.document.title : 'undefined');", windowId);
			handles.add(handleName);
		}
		
		windowManager.filterActiveWindow();
		debugger.resetRuntimesList();
		return handles;
	}
	
	public int getWindowCount() {
		return windowManager.getWindowHandles().size();
	}

	public Options manage() {
		return new OperaOptions();
	}

	public Navigation navigate() {
		return new OperaNavigation();
	}

	public void quit() {
		services.quit();
	}

	public TargetLocator switchTo() {
		return new OperaTargetLocator();
	}
	
	private class OperaTargetLocator implements TargetLocator {

		public WebElement activeElement() {
			return OperaDriver.this.findActiveElement();
		}

		public WebDriver defaultContent() {
			//change to _top
			windowManager.filterActiveWindow();
			debugger.resetFramePath();
			while(findElementsByTagName("frameset").size() > 0) {
				switchTo().frame(0);
			}
			//waitForLoadToComplete();
			return OperaDriver.this;
		}

		public WebDriver frame(int frameIndex) {
			//make sure we execute this one on "_top"
			debugger.resetFramePath();
			int framesLength = Integer.valueOf(debugger.executeJavascript("return document.frames.length"));
			
			if(frameIndex < 0 || frameIndex >= framesLength)
				throw new NoSuchFrameException("Invalid frame index : " + frameIndex);

			debugger.changeRuntime(frameIndex);
			
			return OperaDriver.this;
		}

		public WebDriver frame(String frameName) {
			debugger.resetFramePath();	
			debugger.changeRuntime(frameName);
			return OperaDriver.this;
		}
		

		public WebDriver window(String windowName) {
			windowManager.clearFilter();
			
			List windowIds = windowManager.getWindowHandles();
			
			Integer id = 0;
			
			for (Integer windowId : windowIds) {
				String name = debugger.executeJavascript("return top.window.name ? top.window.name : top.document.title;", windowId);
				if(name.equals(windowName)) {
					id = windowId;
					break;
				}
			}
			
			if(id == 0)
				throw new NoSuchWindowException("Window with name "  + windowName + " not found");
			windowManager.setActiveWindowId(id);
			
			windowManager.filterActiveWindow();
			debugger.resetRuntimesList();
			
			defaultContent(); //set runtime to _top
			debugger.executeJavascript("window.focus()", false); //steal focus
			return OperaDriver.this;
		}
		
	}
	
        // FIXME - should this be added to the official API?  -- jamesl (07/12/2010)
	public List listFrames(){
		return debugger.listFramePaths();
	}
File
OperaDriver.java
Developer's decision
Manual
Kind of conflict
Class declaration
Comment
Method declaration
Chunk
Conflicting content
=======
	
	public WebElement findActiveElement() {
		return findSingleElement("document.activeElement;", "active element");
<<<<<<< HEAD
	}	
	
	// FIXME - this needs to be benchmarked; is xpath faster? -- jamesl (07/12/2010)
	}
	

	// TODO Benchmark, XPath is supposed to be faster?
>>>>>>> 0a9e1e975a02efec859ecdd6230570a0de0d6a85
	public WebElement findElementByLinkText(String using) {
		return findSingleElement("(function(){\n"+
	        "var links = document.getElementsByTagName('a'), element = null;\n"+
Solution content
	
	public WebElement findActiveElement() {
		return findSingleElement("document.activeElement;", "active element");
	}	
	
	// FIXME - this needs to be benchmarked; is xpath faster? -- jamesl (07/12/2010)
	public WebElement findElementByLinkText(String using) {
		return findSingleElement("(function(){\n"+
	        "var links = document.getElementsByTagName('a'), element = null;\n"+
File
OperaDriver.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
		return findSingleElement("(function(){\n"+
	        "var links = document.getElementsByTagName('a'), element = null;\n"+
	        "for (var i = 0; i < links.length && !element; ++i) {\n"+
<<<<<<< HEAD
	        "if (links[i].textContent == '" + using + "') {\n"+
=======
	        "if(links[i].textContent.replace(/\\s+/g, ' ') == \"" + using +"\".replace(/\\s+/g, ' ')) {\n"+
>>>>>>> 0a9e1e975a02efec859ecdd6230570a0de0d6a85
	        "element = links[i];\n"+
	        "}\n"+
	        "}\n"+
Solution content
		return findSingleElement("(function(){\n"+
	        "var links = document.getElementsByTagName('a'), element = null;\n"+
	        "for (var i = 0; i < links.length && !element; ++i) {\n"+
	        "if(links[i].textContent.replace(/\\s+/g, ' ') == \"" + using +"\".replace(/\\s+/g, ' ')) {\n"+
	        "element = links[i];\n"+
	        "}\n"+
	        "}\n"+
File
OperaDriver.java
Developer's decision
Version 2
Kind of conflict
Variable
Chunk
Conflicting content
				"elements.push(link);\n"+
					"}\n"+
				"}\n" +
<<<<<<< HEAD
				"return elements;", "link text");
	}	
=======
				"return elements; })()", "link text");
	}
	
	protected List processElements(Integer id){		
		List ids = debugger.examineObjects(id);
		List toReturn = new ArrayList();
		for (Integer objectId : ids)
			toReturn.add(new OperaWebElement(this, objectId));
		return toReturn;
	}
>>>>>>> 0a9e1e975a02efec859ecdd6230570a0de0d6a85
	
	public List findElementsByPartialLinkText(String using) {
		return findMultipleElements("var links = document.links, link = null, i = 0, elements = [];\n" +
Solution content
				"elements.push(link);\n"+
					"}\n"+
				"}\n" +
				"return elements; })()", "link text");
	}
	
	protected List processElements(Integer id){		
		List ids = debugger.examineObjects(id);
		List toReturn = new ArrayList();
		for (Integer objectId : ids)
			toReturn.add(new OperaWebElement(this, objectId));
		return toReturn;
	}
	
	public List findElementsByPartialLinkText(String using) {
		return findMultipleElements("var links = document.links, link = null, i = 0, elements = [];\n" +
File
OperaDriver.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Chunk
Conflicting content
			return (value == null) ? null : new Cookie(name, value);
		}
	}
<<<<<<< HEAD
=======
	
	public void operaAction(String using, String... params) {
            
		exec.action(using, params);
	}
	
	public Set getOperaActionList() {
		return exec.getActionList();
	}
	
	/**
	 * @deprecated Don't use sleep!
	 */
	private static void sleep(long timeInMillis) {
		try {
			Thread.sleep(timeInMillis);
		} catch (InterruptedException e) {
			// ignore
		}
	}

	public WebElement findElementByTagName(String using) {
		if(using.contains(":")) {//has prefix
			String[] tagInfo = using.split(":");
			return findSingleElement("(function() { var elements = document.getElementsByTagName('" + tagInfo[1] + "'), element = null;" +
					"for( var i = 0; i < elements.length; i++ ) {" +
					"if( elements[i].prefix == '" + tagInfo[0] + "' ) {" +
					"element = elements[i];" +
					"}" +
					"}" +
					"return element; })()", "tag name");
		}
		return findSingleElement("document.getElementsByTagName('" + using +"')[0];", "tag name");
	}


	public List findElementsByTagName(String using) {
		if(using.contains(":")) {//has prefix
			String[] tagInfo = using.split(":");
			return findMultipleElements("(function() { var elements = document.getElementsByTagName('" + tagInfo[1] + "'), output = [];" +
					"for( var i = 0; i < elements.length; i++ ) {" +
					"if( elements[i].prefix == '" + tagInfo[0] + "' ) {" +
					"output.push(elements[i]);" +
					"}" +
					"}" +
					"return output; })()", "tag name");
		}
		return findMultipleElements("document.getElementsByTagName('"+ using + "');\n", "tag name");
	}

	public WebElement findElementByCssSelector(String using) {
            return findSingleElement("document.querySelector('" + using +"');", "selector");
	}

	public List findElementsByCssSelector(String using) {
    	
            return findMultipleElements("document.querySelectorAll('"+ using + "'), returnValue = [], i=0;for(;returnValue[i]=results[i];i++); return returnValue;", "selector");
	}

	private final List findMultipleElements(String script, String type) {
		Integer id = debugger.getObject(script);

		if (id == null) {
			throw new NoSuchElementException("Cannot find element(s) with " + type);
		}
		return processElements(id);
	}
	
	private final WebElement findSingleElement(String script, String type) {
            Integer id = debugger.getObject(script);

            if (id != null) {
                    return new OperaWebElement(this, id);
            }

            throw new NoSuchElementException("Cannot find element with " + type);
	}
	
	/*
	public String saveScreenshot(String fileName, int timeout, String... hashes) {
		return screenWatcher(fileName, timeout, true, hashes);
	}

	public ScreenShotReply saveScreenshot(Canvas canvas, long timeout, boolean includeImage, String... hashes) {
		
		 * FIXME: This _needs_ be cleaned up.  All things related to 
		 * `timeout` should, ideally, be removed and handled elsewhere.
		 
		
		//
		// * No reason to wait if we have idle control.  Builds without
		// * OperaIdle enabled will fail if timeout is 1 or less.
		// 
		if(services.isOperaIdleAvailable()) {
			timeout = 1;
		} else if (!services.isOperaIdleAvailable() && timeout <= 1) {
			timeout = 10;
		}

        return exec.screenWatcher(canvas, timeout, includeImage, hashes);
	}
	
	private String screenWatcher(String fileName, int timeout, boolean saveFile, String... hashes) {
		Canvas canvas = new Canvas();
		canvas.setX(0);
		canvas.setY(0);
		
		String[] dimensions = debugger.executeJavascript("return (window.innerWidth + \",\" + window.innerHeight);").split(",");
		canvas.setH(Integer.valueOf(dimensions[1]));
		canvas.setW(Integer.valueOf(dimensions[0]));
		canvas.setViewPortRelative(true);
		 
		ScreenShotReply screenshot = saveScreenshot(canvas, timeout, saveFile, hashes);
		
		if(saveFile && screenshot.getPng() != null) {
			FileOutputStream stream;
			
			try {
				stream = new FileOutputStream(fileName);
				stream.write(screenshot.getPng());
				stream.close();
			} catch (Exception e) {
				throw new WebDriverException("Failed to write file: " + e.getMessage());
			}
		}
		
		return screenshot.getMd5();
	}
	*/
	
	public ScreenShotReply saveScreenshot(long timeout, String... hashes)
	{
		/*
		if(services.isOperaIdleAvailable()) {
			timeout = 1;
		} else if (!services.isOperaIdleAvailable() && timeout <= 1) {
			timeout = 10;
		}
		*/
		return operaRunner.saveScreenshot(timeout, hashes);
	}
	
	public boolean isOperaIdleAvailable()
	{
		return services.isOperaIdleAvailable();
	}
	
	public Object executeScript(String script, Object... args) {
            Object object = debugger.scriptExecutor(script, args);

            //we probably have an element OR list
            if(object instanceof ScriptResult) {
                ScriptResult result = (ScriptResult) object;
                Integer objectId = result.getObjectId();
                if(objectId == null)
                    return null;
                if(result.getClassName().endsWith("Element"))
                    return new OperaWebElement(this, objectId);
                if(result.getClassName().equals("NodeList"))
                    return processElements(objectId);
                if(result.getClassName().equals("Array") || result.getClassName().equals("Object"))
                    return debugger.examineScriptResult(objectId);         	
            }
            return object;
	}
	
	public boolean isJavascriptEnabled() {
            // FIXME we always assume it is true
            // TODO it should not be possible to register esdbg if js is disabled?
            return true;
	}

	@Deprecated
	public void cleanUp() {
		services.close();
	}

	public void executeActions(OperaAction action) {
            List actions = action.getActions();
            for (UserInteraction userInteraction : actions) {
                userInteraction.execute(this);
            }
            waitForLoadToComplete();
	}
	
	/**
	 * @deprecated This should not be used!
	 */
	@Deprecated
	public boolean isConnected() {
		return services.isConnected();
	}
	
	public void key(String key) {
		keyDown(key);
		keyUp(key);
		
		if(key.equalsIgnoreCase("enter")) {
			sleep(OperaIntervals.EXEC_SLEEP.getValue());
			waitForLoadToComplete();
		}
	}

	public void keyDown(String key) {
            exec.key(key, false);
	}

	public void keyUp(String key) {
            exec.key(key, true);
	}

	public void releaseKeys() {
            exec.releaseKeys();
	}

	public void type(String using) {
            exec.type(using);
	}
	
	public void mouseEvent(int x, int y, int value) {
            exec.mouseAction(x, y, value, 1);
	}
	
	public void addConsoleListener(IConsoleListener listener) {
            services.addConsoleListener(listener);
	}

    public void binaryStopped(int code) {
        services.onBinaryStopped(code);
    }
    
    /**
     * Cache of OperaDriver version.
     */
    private static String operaDriverVersion = null;

    /**
     * Gets the OperaDriver version.  Once the version number has been
     * loaded from an external flat file, it will be cached and returned
     * from cache on future calls.
     * @return 
     * 
     * @return OperaDriver version number as a String
     * @throws IOException if the version file cannot be found
     */
    public String getOperaDriverVersion() throws IOException {
    	if (operaDriverVersion == null) {
    		InputStream stream = OperaDriver.class.getResourceAsStream("/com/opera/core/systems/VERSION");
    		
    		StringBuilder stringBuilder = new StringBuilder();
    		Scanner scanner = new Scanner(stream);

    		try {
    			while (scanner.hasNext()) {
    				stringBuilder.append(scanner.nextLine());
    			}
    			
    			operaDriverVersion = stringBuilder.toString();
    		} catch (Exception e) {
    			throw new FatalException("Could not load the version information:"
    					+ e.getMessage());
    		} finally {
    			scanner.close();
    		}
    	}
    	return operaDriverVersion;
    }
    
    protected IEcmaScriptDebugger getScriptDebugger() {
		return debugger;
	}

	protected IOperaExec getExecService() {
		return exec;
	}

	protected IWindowManager getWindowManager() {
		return windowManager;
	}

	protected ScopeServices getScopeServices() {
		return services;
	}
>>>>>>> 0a9e1e975a02efec859ecdd6230570a0de0d6a85
}
Solution content
			return (value == null) ? null : new Cookie(name, value);
		}
	}
	
	public void operaAction(String using, String... params) {
            
		exec.action(using, params);
	}
	
	public Set getOperaActionList() {
		return exec.getActionList();
	}
	
	/**
	 * @deprecated Don't use sleep!
	 */
	private static void sleep(long timeInMillis) {
		try {
			Thread.sleep(timeInMillis);
		} catch (InterruptedException e) {
			// ignore
		}
	}

	public WebElement findElementByTagName(String using) {
		if(using.contains(":")) {//has prefix
			String[] tagInfo = using.split(":");
			return findSingleElement("(function() { var elements = document.getElementsByTagName('" + tagInfo[1] + "'), element = null;" +
					"for( var i = 0; i < elements.length; i++ ) {" +
					"if( elements[i].prefix == '" + tagInfo[0] + "' ) {" +
					"element = elements[i];" +
					"}" +
					"}" +
					"return element; })()", "tag name");
		}
		return findSingleElement("document.getElementsByTagName('" + using +"')[0];", "tag name");
	}


	public List findElementsByTagName(String using) {
		if(using.contains(":")) {//has prefix
			String[] tagInfo = using.split(":");
			return findMultipleElements("(function() { var elements = document.getElementsByTagName('" + tagInfo[1] + "'), output = [];" +
					"for( var i = 0; i < elements.length; i++ ) {" +
					"if( elements[i].prefix == '" + tagInfo[0] + "' ) {" +
					"output.push(elements[i]);" +
					"}" +
					"}" +
					"return output; })()", "tag name");
		}
		return findMultipleElements("document.getElementsByTagName('"+ using + "');\n", "tag name");
	}

	public WebElement findElementByCssSelector(String using) {
            return findSingleElement("document.querySelector('" + using +"');", "selector");
	}

	public List findElementsByCssSelector(String using) {
            return findMultipleElements("document.querySelectorAll('"+ using + "'), returnValue = [], i=0;for(;returnValue[i]=results[i];i++); return returnValue;", "selector");
	}

	private final List findMultipleElements(String script, String type) {
		Integer id = debugger.getObject(script);

		if (id == null) {
			throw new NoSuchElementException("Cannot find element(s) with " + type);
		}
		return processElements(id);
	}
	
	private final WebElement findSingleElement(String script, String type) {
            Integer id = debugger.getObject(script);

            if (id != null) {
                    return new OperaWebElement(this, id);
            }

            throw new NoSuchElementException("Cannot find element with " + type);
	}
	
	public ScreenShotReply saveScreenshot(long timeout, String... hashes)
	{
		return operaRunner.saveScreenshot(timeout, hashes);
	}
	
	public boolean isOperaIdleAvailable()
	{
		return services.isOperaIdleAvailable();
	}
	
	public Object executeScript(String script, Object... args) {
            Object object = debugger.scriptExecutor(script, args);

            //we probably have an element OR list
            if(object instanceof ScriptResult) {
                ScriptResult result = (ScriptResult) object;
                Integer objectId = result.getObjectId();
                if(objectId == null)
                    return null;
                if(result.getClassName().endsWith("Element"))
                    return new OperaWebElement(this, objectId);
                if(result.getClassName().equals("NodeList"))
                    return processElements(objectId);
                if(result.getClassName().equals("Array") || result.getClassName().equals("Object"))
                    return debugger.examineScriptResult(objectId);         	
            }
            return object;
	}
	
	// FIXME -- turn this into a real check -- jmesl (10/12/2010)
	public boolean isJavascriptEnabled() {
            return true;
	}

	@Deprecated
	public void cleanUp() {
		services.close();
	}

	public void executeActions(OperaAction action) {
            List actions = action.getActions();
            for (UserInteraction userInteraction : actions) {
                userInteraction.execute(this);
            }
            waitForLoadToComplete();
	}
	
	/**
	 * @deprecated This should not be used!
	 */
	@Deprecated
	public boolean isConnected() {
		return services.isConnected();
	}
	
	public void key(String key) {
		keyDown(key);
		keyUp(key);
		
		if(key.equalsIgnoreCase("enter")) {
			sleep(OperaIntervals.EXEC_SLEEP.getValue());
			waitForLoadToComplete();
		}
	}

	public void keyDown(String key) {
            exec.key(key, false);
	}

	public void keyUp(String key) {
            exec.key(key, true);
	}

	public void releaseKeys() {
            exec.releaseKeys();
	}

	public void type(String using) {
            exec.type(using);
	}
	
	public void mouseEvent(int x, int y, int value) {
            exec.mouseAction(x, y, value, 1);
	}
	
	public void addConsoleListener(IConsoleListener listener) {
            services.addConsoleListener(listener);
	}

    public void binaryStopped(int code) {
        services.onBinaryStopped(code);
    }
    
    /**
     * Cache of OperaDriver version.
     */
    private static String operaDriverVersion = null;

    /**
     * Gets the OperaDriver version.  Once the version number has been
     * loaded from an external flat file, it will be cached and returned
     * from cache on future calls.
     * @return 
     * 
     * @return OperaDriver version number as a String
     * @throws IOException if the version file cannot be found
     */
    public String getOperaDriverVersion() throws IOException {
    	if (operaDriverVersion == null) {
    		InputStream stream = OperaDriver.class.getResourceAsStream("/com/opera/core/systems/VERSION");
    		
    		StringBuilder stringBuilder = new StringBuilder();
    		Scanner scanner = new Scanner(stream);

    		try {
    			while (scanner.hasNext()) {
    				stringBuilder.append(scanner.nextLine());
    			}
    			
    			operaDriverVersion = stringBuilder.toString();
    		} catch (Exception e) {
    			throw new FatalException("Could not load the version information:"
    					+ e.getMessage());
    		} finally {
    			scanner.close();
    		}
    	}
    	
    	return operaDriverVersion;
    }
    
    protected IEcmaScriptDebugger getScriptDebugger() {
		return debugger;
	}

	protected IOperaExec getExecService() {
		return exec;
	}

	protected IWindowManager getWindowManager() {
		return windowManager;
	}

	protected ScopeServices getScopeServices() {
		return services;
	}
}
File
OperaDriver.java
Developer's decision
Manual
Kind of conflict
Annotation
Attribute
Comment
Method declaration