![]() |
![]() |
selenium-server-standalone-2.42.2erver.handler.html5.GetLocalStorageItem * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import java.util.Set; import org.openqa.selenium.html5.LocalStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class GetLocalStorageKeys extends WebDriverHandler<Set<String>> { public GetLocalStorageKeys(Session session) { super(session); } public Set<String> call() throws Exception { return Utils.getWebStorage(getUnwrappedDriver()).getLocalStorage().keySet(); } public String toString() { return "[get local storage key set]"; } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.GetLocalStorageKeys * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import org.openqa.selenium.html5.LocalStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class GetLocalStorageSize extends WebDriverHandler<Integer> { public GetLocalStorageSize(Session session) { super(session); } public Integer call() throws Exception { return Integer.valueOf(Utils.getWebStorage(getUnwrappedDriver()).getLocalStorage().size()); } public String toString() { return "[get local storage size]"; } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.GetLocalStorageSize * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import org.openqa.selenium.html5.Location; import org.openqa.selenium.html5.LocationContext; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class GetLocationContext extends WebDriverHandler<Location> { public GetLocationContext(Session session) { super(session); } public Location call() throws Exception { return Utils.getLocationContext(getUnwrappedDriver()).location(); } public String toString() { return "[get location context]"; } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.GetLocationContext * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import org.openqa.selenium.html5.SessionStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class GetSessionStorageItem extends WebDriverHandler<String> { private volatile String key; public GetSessionStorageItem(Session session) { super(session); } public String call() throws Exception { return Utils.getWebStorage(getUnwrappedDriver()).getSessionStorage().getItem(key); } public void setKey(String key) { this.key = key; } public String toString() { return String.format("[get session storage item for key: %s]", new Object[] { key }); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.GetSessionStorageItem * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import java.util.Set; import org.openqa.selenium.html5.SessionStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class GetSessionStorageKeys extends WebDriverHandler<Set<String>> { public GetSessionStorageKeys(Session session) { super(session); } public Set<String> call() throws Exception { return Utils.getWebStorage(getUnwrappedDriver()).getSessionStorage().keySet(); } public String toString() { return "[get session storage key set]"; } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.GetSessionStorageKeys * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import org.openqa.selenium.html5.SessionStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class GetSessionStorageSize extends WebDriverHandler<Integer> { public GetSessionStorageSize(Session session) { super(session); } public Integer call() throws Exception { return Integer.valueOf(Utils.getWebStorage(getUnwrappedDriver()).getSessionStorage().size()); } public String toString() { return "[get session storage size]"; } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.GetSessionStorageSize * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import org.openqa.selenium.html5.LocalStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class RemoveLocalStorageItem extends WebDriverHandler<String> { private volatile String key; public RemoveLocalStorageItem(Session session) { super(session); } public void setKey(String key) { this.key = key; } public String call() throws Exception { return Utils.getWebStorage(getUnwrappedDriver()).getLocalStorage().removeItem(key); } public String toString() { return String.format("[remove local storage item for key: %s]", new Object[] { key }); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.RemoveLocalStorageItem * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import org.openqa.selenium.html5.SessionStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class RemoveSessionStorageItem extends WebDriverHandler<String> { private volatile String key; public RemoveSessionStorageItem(Session session) { super(session); } public void setKey(String key) { this.key = key; } public String call() throws Exception { return Utils.getWebStorage(getUnwrappedDriver()).getSessionStorage().removeItem(key); } public String toString() { return String.format("[remove session storage item for key: %s]", new Object[] { key }); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.RemoveSessionStorageItem * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import java.util.Map; import org.openqa.selenium.html5.LocalStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class SetLocalStorageItem extends WebDriverHandler<Void> implements JsonParametersAware { private volatile String key; private volatile String value; public SetLocalStorageItem(Session session) { super(session); } public Void call() throws Exception { Utils.getWebStorage(getUnwrappedDriver()).getLocalStorage().setItem(key, value); return null; } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { key = ((String)allParameters.get("key")); value = ((String)allParameters.get("value")); } public String toString() { return String.format("[Set local storage item pair: (%s, %s)]", new Object[] { key, value }); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.SetLocalStorageItem * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import java.util.Map; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.html5.Location; import org.openqa.selenium.html5.LocationContext; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class SetLocationContext extends WebDriverHandler<Void> implements JsonParametersAware { private volatile Location location; public SetLocationContext(Session session) { super(session); } public Void call() throws Exception { Utils.getLocationContext(getUnwrappedDriver()).setLocation(location); return null; } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { Map<Object, Object> locationMap = (Map)allParameters.get("location"); try { latitude = ((Number)locationMap.get("latitude")).doubleValue(); } catch (ClassCastException ex) { double latitude; throw new WebDriverException("Illegal (non-double) latitude location passed: " + locationMap.get("latitude"), ex); } double latitude; try { longitude = ((Number)locationMap.get("longitude")).doubleValue(); } catch (ClassCastException ex) { double longitude; throw new WebDriverException("Illegal (non-double) longitude location passed: " + locationMap.get("longitude"), ex); } double longitude; try { altitude = ((Number)locationMap.get("altitude")).doubleValue(); } catch (ClassCastException ex) { double altitude; throw new WebDriverException("Illegal (non-double) altitude location passed: " + locationMap.get("altitude"), ex); } double altitude; location = new Location(latitude, longitude, altitude); } public String toString() { return String.format("[set location context: %s]", new Object[] { location.toString() }); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.SetLocationContext * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import java.util.Map; import org.openqa.selenium.html5.SessionStorage; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class SetSessionStorageItem extends WebDriverHandler<Void> implements JsonParametersAware { private volatile String key; private volatile String value; public SetSessionStorageItem(Session session) { super(session); } public Void call() throws Exception { Utils.getWebStorage(getUnwrappedDriver()).getSessionStorage().setItem(key, value); return null; } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { key = ((String)allParameters.get("key")); value = ((String)allParameters.get("value")); } public String toString() { return String.format("[Set session storage item pair: (%s, %s)]", new Object[] { key, value }); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.SetSessionStorageItem * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.html5; import com.google.common.base.Throwables; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import org.openqa.selenium.Capabilities; import org.openqa.selenium.HasCapabilities; import org.openqa.selenium.UnsupportedCommandException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.html5.ApplicationCache; import org.openqa.selenium.html5.DatabaseStorage; import org.openqa.selenium.html5.LocationContext; import org.openqa.selenium.html5.WebStorage; import org.openqa.selenium.remote.ExecuteMethod; import org.openqa.selenium.remote.html5.RemoteApplicationCache; import org.openqa.selenium.remote.html5.RemoteDatabaseStorage; import org.openqa.selenium.remote.html5.RemoteLocationContext; import org.openqa.selenium.remote.html5.RemoteWebStorage; class Utils { static ApplicationCache getApplicationCache(WebDriver driver) { return (ApplicationCache)convert(driver, ApplicationCache.class, "applicationCacheEnabled", RemoteApplicationCache.class); } static LocationContext getLocationContext(WebDriver driver) { return (LocationContext)convert(driver, LocationContext.class, "locationContextEnabled", RemoteLocationContext.class); } static DatabaseStorage getDatabaseStorage(WebDriver driver) { return (DatabaseStorage)convert(driver, DatabaseStorage.class, "databaseEnabled", RemoteDatabaseStorage.class); } static WebStorage getWebStorage(WebDriver driver) { return (WebStorage)convert(driver, WebStorage.class, "webStorageEnabled", RemoteWebStorage.class); } private static <T> T convert(WebDriver driver, Class<T> interfaceClazz, String capability, Class<? extends T> remoteImplementationClazz) { if (interfaceClazz.isInstance(driver)) { return (T)interfaceClazz.cast(driver); } if (((driver instanceof ExecuteMethod)) && ((driver instanceof HasCapabilities)) && (((HasCapabilities)driver).getCapabilities().is(capability))) { try { return (T)remoteImplementationClazz.getConstructor(new Class[] { ExecuteMethod.class }).newInstance(new Object[] { (ExecuteMethod)driver }); } catch (InstantiationException e) { throw new WebDriverException(e); } catch (IllegalAccessException e) { throw new WebDriverException(e); } catch (InvocationTargetException e) { throw Throwables.propagate(e.getCause()); } catch (NoSuchMethodException e) { throw new WebDriverException(e); } } throw new UnsupportedCommandException( "driver (" + driver.getClass().getName() + ") does not support " + interfaceClazz.getName()); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.html5.Utils * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions; import java.util.Map; import org.openqa.selenium.interactions.HasInputDevices; import org.openqa.selenium.interactions.Mouse; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class ClickInSession extends WebDriverHandler<Void> implements JsonParametersAware { volatile boolean leftMouseButton = true; public ClickInSession(Session session) { super(session); } public Void call() throws Exception { Mouse mouse = ((HasInputDevices)getDriver()).getMouse(); if (leftMouseButton) { mouse.click(null); } else { mouse.contextClick(null); } return null; } public String toString() { return String.format("[click: %s]", new Object[] { "nothing" }); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { if (allParameters.containsKey("button")) { int button = ((Long)allParameters.get("button")).intValue(); switch (button) { case 0: leftMouseButton = true; break; case 2: leftMouseButton = false; } } } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.ClickInSession * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions; import org.openqa.selenium.interactions.HasInputDevices; import org.openqa.selenium.interactions.Mouse; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class DoubleClickInSession extends WebDriverHandler<Void> { public DoubleClickInSession(Session session) { super(session); } public Void call() throws Exception { Mouse mouse = ((HasInputDevices)getDriver()).getMouse(); mouse.doubleClick(null); return null; } public String toString() { return String.format("[doubleclick: no args]", new Object[0]); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.DoubleClickInSession * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions; import org.openqa.selenium.interactions.HasInputDevices; import org.openqa.selenium.interactions.Mouse; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class MouseDown extends WebDriverHandler<Void> { public MouseDown(Session session) { super(session); } public Void call() throws Exception { Mouse mouse = ((HasInputDevices)getDriver()).getMouse(); mouse.mouseDown(null); return null; } public String toString() { return String.format("[mousedown: no args]", new Object[0]); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.MouseDown * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions; import java.util.Map; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.HasInputDevices; import org.openqa.selenium.interactions.Mouse; import org.openqa.selenium.interactions.internal.Coordinates; import org.openqa.selenium.internal.Locatable; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.KnownElements; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class MouseMoveToLocation extends WebDriverHandler<Void> implements JsonParametersAware { private static final String XOFFSET = "xoffset"; private static final String YOFFSET = "yoffset"; private static final String ELEMENT = "element"; String elementId; boolean elementProvided = false; int xOffset = 0; int yOffset = 0; boolean offsetsProvided = false; public MouseMoveToLocation(Session session) { super(session); } public Void call() throws Exception { Mouse mouse = ((HasInputDevices)getDriver()).getMouse(); Coordinates elementLocation = null; if (elementProvided) { WebElement element = getKnownElements().get(elementId); elementLocation = ((Locatable)element).getCoordinates(); } if (offsetsProvided) { mouse.mouseMove(elementLocation, xOffset, yOffset); } else { mouse.mouseMove(elementLocation); } return null; } public String toString() { return String.format("[mousemove: %s %b]", new Object[] { elementId, Boolean.valueOf(offsetsProvided) }); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { if ((allParameters.containsKey("element")) && (allParameters.get("element") != null)) { elementId = ((String)allParameters.get("element")); elementProvided = true; } else { elementProvided = false; } if ((allParameters.containsKey("xoffset")) && (allParameters.containsKey("yoffset"))) { try { xOffset = ((Number)allParameters.get("xoffset")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) x offset value for mouse move passed: " + allParameters.get("xoffset"), ex); } try { yOffset = ((Number)allParameters.get("yoffset")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) y offset value for mouse move passed: " + allParameters.get("yoffset"), ex); } offsetsProvided = true; } else { offsetsProvided = false; } } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions; import org.openqa.selenium.interactions.HasInputDevices; import org.openqa.selenium.interactions.Mouse; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class MouseUp extends WebDriverHandler<Void> { public MouseUp(Session session) { super(session); } public Void call() throws Exception { Mouse mouse = ((HasInputDevices)getDriver()).getMouse(); mouse.mouseUp(null); return null; } public String toString() { return String.format("[mouseup: %s]", new Object[] { "nothing" }); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.MouseUp * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; import org.openqa.selenium.interactions.HasInputDevices; import org.openqa.selenium.interactions.Keyboard; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebDriverHandler; public class SendKeyToActiveElement extends WebDriverHandler<Void> implements JsonParametersAware { private final List<CharSequence> keys = new CopyOnWriteArrayList(); public SendKeyToActiveElement(Session session) { super(session); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { List<String> rawKeys = (List)allParameters.get("value"); List<String> temp = new ArrayList(); for (String key : rawKeys) { temp.add(key); } keys.addAll(temp); } public Void call() throws Exception { Keyboard keyboard = ((HasInputDevices)getDriver()).getKeyboard(); String[] keysToSend = (String[])keys.toArray(new String[0]); keyboard.sendKeys(keysToSend); return null; } public String toString() { return String.format("[send keys to active: %s]", keys.toArray()); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.SendKeyToActiveElement * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions.touch; import java.util.Map; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.HasTouchScreen; import org.openqa.selenium.interactions.TouchScreen; import org.openqa.selenium.interactions.internal.Coordinates; import org.openqa.selenium.internal.Locatable; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.KnownElements; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebElementHandler; public class DoubleTapOnElement extends WebElementHandler<Void> implements JsonParametersAware { private static final String ELEMENT = "element"; private String elementId; public DoubleTapOnElement(Session session) { super(session); } public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen)getDriver()).getTouch(); WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable)element).getCoordinates(); touchScreen.doubleTap(elementLocation); return null; } public String toString() { return String.format("[DoubleTap: %s]", new Object[] { elementId }); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { elementId = ((String)allParameters.get("element")); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.touch.DoubleTapOnElement * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions.touch; import java.util.Map; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.interactions.HasTouchScreen; import org.openqa.selenium.interactions.TouchScreen; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebElementHandler; public class Down extends WebElementHandler<Void> implements JsonParametersAware { private static final String X = "x"; private static final String Y = "y"; private int x; private int y; public Down(Session session) { super(session); } public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen)getDriver()).getTouch(); touchScreen.down(x, y); return null; } public String toString() { return String.format("[Down]", new Object[0]); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { try { x = ((Number)allParameters.get("x")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) x touch down position value passed: " + allParameters.get("x"), ex); } try { y = ((Number)allParameters.get("y")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) y touch down position value passed: " + allParameters.get("y"), ex); } } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.touch.Down * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions.touch; import java.util.Map; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.HasTouchScreen; import org.openqa.selenium.interactions.TouchScreen; import org.openqa.selenium.interactions.internal.Coordinates; import org.openqa.selenium.internal.Locatable; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.KnownElements; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebElementHandler; public class Flick extends WebElementHandler<Void> implements JsonParametersAware { private static final String ELEMENT = "element"; private static final String XOFFSET = "xoffset"; private static final String YOFFSET = "yoffset"; private static final String SPEED = "speed"; private static final String XSPEED = "xspeed"; private static final String YSPEED = "yspeed"; private String elementId; private int xOffset; private int yOffset; private int speed; private int xSpeed; private int ySpeed; public Flick(Session session) { super(session); } public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen)getDriver()).getTouch(); if (elementId != null) { WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable)element).getCoordinates(); touchScreen.flick(elementLocation, xOffset, yOffset, speed); } else { touchScreen.flick(xSpeed, ySpeed); } return null; } public String toString() { return String.format("[Flick]", new Object[0]); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { if ((allParameters.containsKey("element")) && (allParameters.get("element") != null)) { elementId = ((String)allParameters.get("element")); try { xOffset = ((Number)allParameters.get("xoffset")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) x offset value for flick passed: " + allParameters.get("xoffset"), ex); } try { yOffset = ((Number)allParameters.get("yoffset")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) y offset value for flick passed: " + allParameters.get("yoffset"), ex); } try { speed = ((Number)allParameters.get("speed")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) speed value for flick passed: " + allParameters.get("speed"), ex); } } else if ((allParameters.containsKey("xspeed")) && (allParameters.containsKey("yspeed"))) { try { xSpeed = ((Number)allParameters.get("xspeed")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) x speed value for flick passed: " + allParameters.get("xspeed"), ex); } try { ySpeed = ((Number)allParameters.get("yspeed")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) y speed value for flick passed: " + allParameters.get("yspeed"), ex); } } } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.touch.Flick * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions.touch; import java.util.Map; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.HasTouchScreen; import org.openqa.selenium.interactions.TouchScreen; import org.openqa.selenium.interactions.internal.Coordinates; import org.openqa.selenium.internal.Locatable; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.KnownElements; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebElementHandler; public class LongPressOnElement extends WebElementHandler<Void> implements JsonParametersAware { private static final String ELEMENT = "element"; private String elementId; public LongPressOnElement(Session session) { super(session); } public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen)getDriver()).getTouch(); WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable)element).getCoordinates(); touchScreen.longPress(elementLocation); return null; } public String toString() { return String.format("[Long press: %s]", new Object[] { elementId }); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { elementId = ((String)allParameters.get("element")); } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.touch.LongPressOnElement * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions.touch; import java.util.Map; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.interactions.HasTouchScreen; import org.openqa.selenium.interactions.TouchScreen; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebElementHandler; public class Move extends WebElementHandler<Void> implements JsonParametersAware { private static final String X = "x"; private static final String Y = "y"; private int x; private int y; public Move(Session session) { super(session); } public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen)getDriver()).getTouch(); touchScreen.move(x, y); return null; } public String toString() { return String.format("[Move]", new Object[0]); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { try { x = ((Number)allParameters.get("x")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) x touch move position value passed: " + allParameters.get("x"), ex); } try { y = ((Number)allParameters.get("y")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) y touch move position value passed: " + allParameters.get("y"), ex); } } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.touch.Move * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions.touch; import java.util.Map; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.HasTouchScreen; import org.openqa.selenium.interactions.TouchScreen; import org.openqa.selenium.interactions.internal.Coordinates; import org.openqa.selenium.internal.Locatable; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.KnownElements; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebElementHandler; public class Scroll extends WebElementHandler<Void> implements JsonParametersAware { private static final String ELEMENT = "element"; private static final String XOFFSET = "xoffset"; private static final String YOFFSET = "yoffset"; String elementId; int xOffset; int yOffset; public Scroll(Session session) { super(session); } public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen)getDriver()).getTouch(); if (elementId != null) { WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable)element).getCoordinates(); touchScreen.scroll(elementLocation, xOffset, yOffset); } else { touchScreen.scroll(xOffset, yOffset); } return null; } public String toString() { return String.format("[scroll: %s]", new Object[] { elementId }); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { if (allParameters.containsKey("element")) { elementId = ((String)allParameters.get("element")); } try { xOffset = ((Number)allParameters.get("xoffset")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) x offset value for touch scroll passed: " + allParameters.get("xoffset"), ex); } try { yOffset = ((Number)allParameters.get("yoffset")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) y offset value for touch scroll passed: " + allParameters.get("yoffset"), ex); } } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.touch.Scroll * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions.touch; import java.util.Map; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.HasTouchScreen; import org.openqa.selenium.interactions.TouchScreen; import org.openqa.selenium.interactions.internal.Coordinates; import org.openqa.selenium.internal.Locatable; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.KnownElements; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebElementHandler; public class SingleTapOnElement extends WebElementHandler<Void> implements JsonParametersAware { private static final String ELEMENT = "element"; private String elementId; public SingleTapOnElement(Session session) { super(session); } public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen)getDriver()).getTouch(); WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable)element).getCoordinates(); touchScreen.singleTap(elementLocation); return null; } public String toString() { return String.format("[singleTap: %s]", new Object[] { elementId }); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { if ((allParameters.containsKey("element")) && (allParameters.get("element") != null)) { elementId = ((String)allParameters.get("element")); } } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.touch.SingleTapOnElement * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.interactions.touch; import java.util.Map; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.interactions.HasTouchScreen; import org.openqa.selenium.interactions.TouchScreen; import org.openqa.selenium.remote.server.JsonParametersAware; import org.openqa.selenium.remote.server.Session; import org.openqa.selenium.remote.server.handler.WebElementHandler; public class Up extends WebElementHandler<Void> implements JsonParametersAware { private static final String X = "x"; private static final String Y = "y"; private int x; private int y; public Up(Session session) { super(session); } public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen)getDriver()).getTouch(); touchScreen.up(x, y); return null; } public String toString() { return String.format("[Up]", new Object[0]); } public void setJsonParameters(Map<String, Object> allParameters) throws Exception { try { x = ((Number)allParameters.get("x")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) x touch up position value passed: " + allParameters.get("x"), ex); } try { y = ((Number)allParameters.get("y")).intValue(); } catch (ClassCastException ex) { throw new WebDriverException("Illegal (non-numeric) y touch up position value passed: " + allParameters.get("y"), ex); } } } /* Location: * Qualified Name: org.openqa.selenium.remote.server.handler.interactions.touch.Up * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ package org.openqa.selenium.remote.server.handler.internal; import com.google.common.base.Function; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import java.util.List; import java.util.Map; imp Further reading...For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.New!JAR listings
|