How to use afterCall method of org.openqa.selenium.support.decorators.WebDriverDecorator class

Best Selenium code snippet using org.openqa.selenium.support.decorators.WebDriverDecorator.afterCall

Source:EventFiringDecorator.java Github

copy

Full Screen

...161 listeners.forEach(listener -> fireBeforeEvents(listener, target, method, args));162 super.beforeCall(target, method, args);163 }164 @Override165 public void afterCall(Decorated<?> target, Method method, Object[] args, Object result) {166 super.afterCall(target, method, args, result);167 listeners.forEach(listener -> fireAfterEvents(listener, target, method, result, args));168 }169 @Override170 public Object onError(Decorated<?> target, Method method, Object[] args,171 InvocationTargetException e) throws Throwable {172 listeners.forEach(listener -> {173 try {174 listener.onError(target.getOriginal(), method, args, e);175 } catch (Throwable t) {176 logger.log(Level.WARNING, t.getMessage(), t);177 }178 });179 return super.onError(target, method, args, e);180 }...

Full Screen

Full Screen

Source:WebDriverDecorator.java Github

copy

Full Screen

...76 * <li>if you want to apply the same behavior modification to all methods of77 * a WebDriver instance and its derived objects you can subclass78 * WebDriverDecorator and override some of the following methods:79 * {@link #beforeCall(Decorated, Method, Object[])},80 * {@link #afterCall(Decorated, Method, Object[], Object)},81 * {@link #call(Decorated, Method, Object[])} and82 * {@link #onError(Decorated, Method, Object[], InvocationTargetException)}</li>83 * <li>if you want to modify behavior of a specific class instances only84 * (e.g. behaviour of WebElement instances) you can override one of the85 * overloaded <code>createDecorated</code> methods to create a non-trivial86 * decorator for the specific class only.</li>87 * </ul>88 * Let's consider both approaches by examples.89 * <p>90 * One of the most widely used decorator examples is a logging decorator.91 * In this case we want to add the same piece of logging code before and after92 * each invoked method:93 * <code>94 * public class LoggingDecorator extends WebDriverDecorator {95 * final Logger logger = LoggerFactory.getLogger(Thread.currentThread().getName());96 *97 * @Override98 * public void beforeCall(Decorated<?> target, Method method, Object[] args) {99 * logger.debug("before {}.{}({})", target, method, args);100 * }101 * @Override102 * public void afterCall(Decorated<?> target, Method method, Object[] args, Object res) {103 * logger.debug("after {}.{}({}) => {}", target, method, args, res);104 * }105 * }106 * </code>107 * For the second example let's implement a decorator that implicitly waits108 * for an element to be visible before any click or sendKeys method call.109 * <code>110 * public class ImplicitlyWaitingDecorator extends WebDriverDecorator {111 * private WebDriverWait wait;112 *113 * @Override114 * public Decorated<WebDriver> createDecorated(WebDriver driver) {115 * wait = new WebDriverWait(driver, Duration.ofSeconds(10));116 * return super.createDecorated(driver);117 * }118 * @Override119 * public Decorated<WebElement> createDecorated(WebElement original) {120 * return new DefaultDecorated<>(original, this) {121 * @Override122 * public void beforeCall(Method method, Object[] args) {123 * String methodName = method.getName();124 * if ("click".equals(methodName) || "sendKeys".equals(methodName)) {125 * wait.until(d -> getOriginal().isDisplayed());126 * }127 * }128 * };129 * }130 * }131 * </code>132 * This class is not a pure decorator, it allows to not only add new behavior133 * but also replace "normal" behavior of a WebDriver or derived objects.134 * <p>135 * Let's suppose you want to use JavaScript-powered clicks instead of normal136 * ones (yes, this allows to interact with invisible elements, it's a bad137 * practice in general but sometimes it's inevitable). This behavior change138 * can be achieved with the following "decorator":139 * <code>140 * public class JavaScriptPoweredDecorator extends WebDriverDecorator {141 * @Override142 * public Decorated<WebElement> createDecorated(WebElement original) {143 * return new DefaultDecorated<>(original, this) {144 * @Override145 * public Object call(Method method, Object[] args) throws Throwable {146 * String methodName = method.getName();147 * if ("click".equals(methodName)) {148 * JavascriptExecutor executor = (JavascriptExecutor) getDecoratedDriver().getOriginal();149 * executor.executeScript("arguments[0].click()", getOriginal());150 * return null;151 * } else {152 * return super.call(method, args);153 * }154 * }155 * };156 * }157 * }158 * </code>159 * It is possible to apply multiple decorators to compose behaviors added160 * by each of them. For example, if you want to log method calls and161 * implicitly wait for elements visibility you can use two decorators:162 * <code>163 * WebDriver original = new FirefoxDriver();164 * WebDriver decorated =165 * new ImplicitlyWaitingDecorator().decorate(166 * new LoggingDecorator().decorate(original));167 * </code>168 */169@Beta170public class WebDriverDecorator {171 private Decorated<WebDriver> decorated;172 public final WebDriver decorate(WebDriver original) {173 Require.nonNull("WebDriver", original);174 decorated = createDecorated(original);175 return createProxy(decorated);176 }177 public Decorated<WebDriver> getDecoratedDriver() {178 return decorated;179 }180 public Decorated<WebDriver> createDecorated(WebDriver driver) {181 return new DefaultDecorated<>(driver, this);182 }183 public Decorated<WebElement> createDecorated(WebElement original) {184 return new DefaultDecorated<>(original, this);185 }186 public Decorated<WebDriver.TargetLocator> createDecorated(WebDriver.TargetLocator original) {187 return new DefaultDecorated<>(original, this);188 }189 public Decorated<WebDriver.Navigation> createDecorated(WebDriver.Navigation original) {190 return new DefaultDecorated<>(original, this);191 }192 public Decorated<WebDriver.Options> createDecorated(WebDriver.Options original) {193 return new DefaultDecorated<>(original, this);194 }195 public Decorated<WebDriver.Timeouts> createDecorated(WebDriver.Timeouts original) {196 return new DefaultDecorated<>(original, this);197 }198 public Decorated<WebDriver.Window> createDecorated(WebDriver.Window original) {199 return new DefaultDecorated<>(original, this);200 }201 public Decorated<Alert> createDecorated(Alert original) {202 return new DefaultDecorated<>(original, this);203 }204 public Decorated<VirtualAuthenticator> createDecorated(VirtualAuthenticator original) {205 return new DefaultDecorated<>(original, this);206 }207 public void beforeCall(Decorated<?> target, Method method, Object[] args) {}208 public Object call(Decorated<?> target, Method method, Object[] args) throws Throwable {209 return decorateResult(method.invoke(target.getOriginal(), args));210 }211 public void afterCall(Decorated<?> target, Method method, Object[] args, Object res) {}212 public Object onError(Decorated<?> target, Method method, Object[] args,213 InvocationTargetException e) throws Throwable214 {215 throw e.getTargetException();216 }217 private Object decorateResult(Object toDecorate) {218 if (toDecorate instanceof WebDriver) {219 return createProxy(getDecoratedDriver());220 }221 if (toDecorate instanceof WebElement) {222 return createProxy(createDecorated((WebElement) toDecorate));223 }224 if (toDecorate instanceof Alert) {225 return createProxy(createDecorated((Alert) toDecorate));226 }227 if (toDecorate instanceof VirtualAuthenticator) {228 return createProxy(createDecorated((VirtualAuthenticator) toDecorate));229 }230 if (toDecorate instanceof WebDriver.Navigation) {231 return createProxy(createDecorated((WebDriver.Navigation) toDecorate));232 }233 if (toDecorate instanceof WebDriver.Options) {234 return createProxy(createDecorated((WebDriver.Options) toDecorate));235 }236 if (toDecorate instanceof WebDriver.TargetLocator) {237 return createProxy(createDecorated((WebDriver.TargetLocator) toDecorate));238 }239 if (toDecorate instanceof WebDriver.Timeouts) {240 return createProxy(createDecorated((WebDriver.Timeouts) toDecorate));241 }242 if (toDecorate instanceof WebDriver.Window) {243 return createProxy(createDecorated((WebDriver.Window) toDecorate));244 }245 if (toDecorate instanceof List) {246 return ((List<?>) toDecorate).stream()247 .map(this::decorateResult)248 .collect(Collectors.toList());249 }250 return toDecorate;251 }252 protected final <Z> Z createProxy(final Decorated<Z> decorated) {253 Set<Class<?>> decoratedInterfaces = extractInterfaces(decorated);254 Set<Class<?>> originalInterfaces = extractInterfaces(decorated.getOriginal());255 final InvocationHandler handler = (proxy, method, args) -> {256 try {257 if (method.getDeclaringClass().equals(Object.class)258 || decoratedInterfaces.contains(method.getDeclaringClass())) {259 return method.invoke(decorated, args);260 }261 if (originalInterfaces.contains(method.getDeclaringClass())) {262 decorated.beforeCall(method, args);263 Object result = decorated.call(method, args);264 decorated.afterCall(method, result, args);265 return result;266 }267 return method.invoke(decorated.getOriginal(), args);268 } catch (InvocationTargetException e) {269 return decorated.onError(method, e, args);270 }271 };272 Set<Class<?>> allInterfaces = new HashSet<>();273 allInterfaces.addAll(decoratedInterfaces);274 allInterfaces.addAll(originalInterfaces);275 Class<?>[] allInterfacesArray = allInterfaces.toArray(new Class<?>[0]);276 return (Z) Proxy.newProxyInstance(277 this.getClass().getClassLoader(), allInterfacesArray, handler);278 }...

Full Screen

Full Screen

Source:IntegrationTest.java Github

copy

Full Screen

...37 public void beforeCall(Decorated<?> target, Method method, Object[] args) {38 counterBefore++;39 }40 @Override41 public void afterCall(Decorated<?> target, Method method, Object[] args, Object result) {42 counterAfter++;43 }44 @Override45 public Object call(Decorated<?> target, Method method, Object[] args) throws Throwable {46 counterCall++;47 return super.call(target, method, args);48 }49 }50 @Test51 public void canDecorateWebDriverMethods() {52 CountCalls decorator = new CountCalls();53 WebDriver originalDriver = mock(WebDriver.class);54 WebDriver decoratedDriver = decorator.decorate(originalDriver);55 decoratedDriver.get("http://test.com/");...

Full Screen

Full Screen

Source:DefaultDecorated.java Github

copy

Full Screen

...38 public Object call(Method method, Object[] args) throws Throwable {39 return getDecorator().call(this, method, args);40 }41 @Override42 public void afterCall(Method method, Object result, Object[] args) {43 getDecorator().afterCall(this, method, args, result);44 }45 @Override46 public Object onError(Method method, InvocationTargetException e, Object[] args) throws Throwable {47 return getDecorator().onError(this, method, args, e);48 }49 @Override50 public String toString() {51 return String.format("Decorated {%s}", original);52 }53 @Override54 public boolean equals(Object o) {55 if (this == o) return true;56 if (o instanceof Decorated) {57 Decorated<?> that = (Decorated<?>) o;...

Full Screen

Full Screen

Source:Decorated.java Github

copy

Full Screen

...21 T getOriginal();22 WebDriverDecorator getDecorator();23 void beforeCall(Method method, Object[] args);24 Object call(Method method, Object[] args) throws Throwable;25 void afterCall(Method method, Object result, Object[] args);26 Object onError(Method method, InvocationTargetException e, Object[] args) throws Throwable;27}...

Full Screen

Full Screen

afterCall

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.By;2import org.openqa.selenium.WebDriver;3import org.openqa.selenium.WebElement;4import org.openqa.selenium.support.PageFactory;5import org.openqa.selenium.support.decorators.DecoratedWebDriver;6import org.openqa.selenium.support.decorators.Decorator;7import org.openqa.selenium.support.decorators.DefaultElementLocatorFactory;8import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;9public class DecoratorTest {10 public static void main(String[] args) {11 WebDriver driver = new DecoratedWebDriver(new WebDriverDecorator(), new MyDriver());12 ElementLocatorFactory factory = new DefaultElementLocatorFactory(driver);13 DecoratedPage page = PageFactory.initElements(factory, DecoratedPage.class);14 page.click();15 }16 public static class MyDriver implements WebDriver {17 public void get(String url) {18 System.out.println("get");19 }20 public String getCurrentUrl() {21 System.out.println("getCurrentUrl");22 return null;23 }24 public String getTitle() {25 System.out.println("getTitle");26 return null;27 }28 public List<WebElement> findElements(By by) {29 System.out.println("findElements");30 return null;31 }32 public WebElement findElement(By by) {33 System.out.println("findElement");34 return null;35 }36 public String getPageSource() {37 System.out.println("getPageSource");38 return null;39 }40 public void close() {41 System.out.println("close");42 }43 public void quit() {44 System.out.println("quit");45 }46 public Set<String> getWindowHandles() {47 System.out.println("getWindowHandles");48 return null;49 }50 public String getWindowHandle() {51 System.out.println("getWindowHandle");52 return null;53 }54 public TargetLocator switchTo() {55 System.out.println("switchTo");56 return null;57 }58 public Navigation navigate() {59 System.out.println("navigate");60 return null;61 }62 public Options manage() {63 System.out.println("manage");64 return null;65 }66 }67 public static class WebDriverDecorator extends Decorator {68 public Object decorate(ClassLoader loader, Method method, Object[] args) {69 System.out.println("call method "

Full Screen

Full Screen

afterCall

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.WebDriver;2import org.openqa.selenium.support.decorators.Decorated;3import org.openqa.selenium.support.decorators.WebDriverDecorator;4import org.openqa.selenium.support.decorators.WithTimeout;5import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;6import org.openqa.selenium.support.pagefactory.FieldDecorator;7import org.openqa.selenium.support.pagefactory.WebDriverFactory;8import org.openqa.selenium.support.ui.Clock;9import org.openqa.selenium.support.ui.FluentWait;10import org.openqa.selenium.support.ui.Wait;11import java.lang.reflect.Field;12import java.lang.reflect.InvocationHandler;13import java.lang.reflect.Method;14import java.lang.reflect.Proxy;15import java.time.Duration;16public class CustomWebDriverDecorator extends WebDriverDecorator {17 public CustomWebDriverDecorator(WebDriver driver) {18 super(driver);19 }20 public Object decorate(ClassLoader loader, Field field) {21 if (!field.isAnnotationPresent(WithTimeout.class)) {22 return super.decorate(loader, field);23 }24 WithTimeout withTimeout = field.getAnnotation(WithTimeout.class);25 Duration duration = Duration.ofSeconds(withTimeout.duration());26 Duration pollingInterval = Duration.ofMillis(withTimeout.pollingInterval());27 Wait<WebDriver> wait = new FluentWait<>(getDriver())28 .withTimeout(duration)29 .pollingEvery(pollingInterval)30 .ignoring(NoSuchElementException.class);31 FieldDecorator originalFieldDecorator = super.decorate(loader, field);32 FieldDecorator decoratedFieldDecorator = decorateFieldDecorator(originalFieldDecorator, wait);33 return decoratedFieldDecorator;34 }35 private FieldDecorator decorateFieldDecorator(FieldDecorator originalFieldDecorator, Wait<WebDriver> wait) {36 InvocationHandler handler = new DecoratedFieldDecoratorInvocationHandler(originalFieldDecorator, wait);37 return (FieldDecorator) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {FieldDecorator.class}, handler);38 }39 private class DecoratedFieldDecoratorInvocationHandler implements InvocationHandler {40 private final FieldDecorator originalFieldDecorator;41 private final Wait<WebDriver> wait;42 public DecoratedFieldDecoratorInvocationHandler(FieldDecorator originalFieldDecorator, Wait<WebDriver> wait) {43 this.originalFieldDecorator = originalFieldDecorator;44 this.wait = wait;45 }46 public Object invoke(Object proxy,

Full Screen

Full Screen

afterCall

Using AI Code Generation

copy

Full Screen

1public class MyWebDriverDecorator extends WebDriverDecorator {2 public MyWebDriverDecorator(WebDriver driver) {3 super(driver);4 }5 public WebElement findElement(By by) {6 WebElement element = super.findElement(by);7 return new MyWebElementDecorator(element);8 }9 public List<WebElement> findElements(By by) {10 List<WebElement> elements = super.findElements(by);11 List<WebElement> decoratedElements = new ArrayList<WebElement>();12 for (WebElement element : elements) {13 decoratedElements.add(new MyWebElementDecorator(element));14 }15 return decoratedElements;16 }17}18public class MyWebElementDecorator extends WebElementDecorator {19 public MyWebElementDecorator(WebElement element) {20 super(element);21 }22 public void click() {23 System.out.println("before click");24 super.click();25 System.out.println("after click");26 }27}28public class Test {29 public void test() {30 WebDriver driver = new MyWebDriverDecorator(new FirefoxDriver());31 driver.findElement(By.name("q")).sendKeys("Hello world!");32 driver.findElement(By.name("q")).submit();33 driver.quit();34 }35}

Full Screen

Full Screen

afterCall

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.WebDriver;2import org.openqa.selenium.support.decorators.Decorated;3import org.openqa.selenium.support.decorators.Decorator;4import org.openqa.selenium.support.decorators.WithTimeout;5public class DecoratorExample {6 public static void main(String[] args) {7 WebDriver driver = new Decorator().decorate(WebDriver.class, new MyDriver());8 System.out.println(driver.getTitle());9 }10 public static class MyDriver implements WebDriver, Decorated {11 public void get(String url) {12 System.out.println("get: " + url);13 }14 public String getTitle() {15 return "title";16 }17 public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException {18 return null;19 }20 public void close() {21 }22 public void quit() {23 }24 public Set<String> getWindowHandles() {25 return null;26 }27 public String getWindowHandle() {28 return null;29 }30 public TargetLocator switchTo() {31 return null;32 }33 public Navigation navigate() {34 return null;35 }36 public Options manage() {37 return null;38 }39 public WebDriver getDecorated() {40 return this;41 }42 }43}44import org.openqa.selenium.WebDriver;45import org.openqa.selenium.support.decorators.Decorated;46public class DecoratedExample {47 public static void main(String[] args) {48 WebDriver driver = new MyDriver();49 System.out.println(driver.getTitle());50 }51 public static class MyDriver implements WebDriver, Decorated {52 public void get(String url) {53 System.out.println("get: " + url);54 }55 public String getTitle() {56 return "title";57 }58 public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException {59 return null;60 }61 public void close() {62 }63 public void quit() {64 }

Full Screen

Full Screen

afterCall

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.support.decorators.WebDriverDecorator;2import org.openqa.selenium.support.decorators.WebDriverDecoratorFactory;3import org.openqa.selenium.support.decorators.WebDriverDecoratorFactoryBuilder;4import org.openqa.selenium.support.decorators.WebDriverDecoratorFactoryBuilder.JavaScriptDecorator;5import org.openqa.selenium.support.decorators.WebDriverDecoratorFactoryBuilder.JavaScriptDecorator.JavaScriptDecoratorBuilder;6import org.openqa.selenium.support.decorators.WebDriverDecoratorFactoryBuilder.JavaScriptDecorator.JavaScriptDecoratorBuilder.JavaScriptDecoratorMethod;7import org.openqa.selenium.support.decorators.WebDriverDecoratorFactoryBuilder.JavaScriptDecorator.JavaScriptDecoratorBuilder.JavaScriptDecoratorMethod.JavaScriptDecoratorMethodBuilder;8import org.openqa.selenium.support.decorators.WebDriverDecoratorFactoryBuilder.JavaScriptDecorator.JavaScriptDecoratorBuilder.JavaScriptDecoratorMethod.JavaScriptDecoratorMethodBuilder.JavaScriptDecoratorMethodParameter;9import org.openqa.selenium.support.decorators.WebDriverDecoratorFactoryBuilder.JavaScriptDecorator.JavaScriptDecoratorBuilder.JavaScriptDecoratorMethod.JavaScriptDecoratorMethodBuilder.JavaScriptDecoratorMethodParameter.JavaScriptDecoratorMethodParameterBuilder;10import java.lang.reflect.Method;11import java.util.ArrayList;12import java.util.Arrays;13import java.util.List;14import java.util.Objects;15import java.util.stream.Collectors;16public class WebDriverDecoratorFactoryBuilderTest {17 public static void main(String[] args) throws Exception {18 WebDriverDecoratorFactory factory = new WebDriverDecoratorFactoryBuilder()19 .withJavaScriptDecorator(WebDriver.class, new JavaScriptDecoratorBuilder()20 .withName("myDecorator")21 .withMethod(new JavaScriptDecoratorMethodBuilder()22 .withName("myMethod")23 .withParameter(new JavaScriptDecoratorMethodParameterBuilder()24 .withName("myParameter")25 .withType(String.class)26 .build())27 .withParameter(new JavaScriptDecoratorMethodParameterBuilder()28 .withName("myParameter2")29 .withType(Integer.class)30 .build())31 .withReturnType(String.class)32 .build())33 .build())34 .build();35 WebDriverDecorator decorator = factory.createDecorator();36 WebDriver driver = decorator.decorate(new ChromeDriver());37 String myMethod = driver.myMethod("myParameter", 1);38 System.out.println(myMethod);39 }40}

Full Screen

Full Screen

afterCall

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.support.decorators.WebDriverDecorator2def afterCall(WebDriverDecorator decorator, Method method, Object[] args, Object result) {3 String url = decorator.getWrappedDriver().currentUrl4 if (url.startsWith("data:")) {5 throw new Exception("Page is not available")6 } else {7 }8}9def driver = new WebDriverDecorator(decorator: afterCall)10driver.find("q").type("my search")11driver.find("btnG").click()12driver.quit()13driver.find("p").text == "my page"14driver.find("p").text == "my page"15driver.find("p").text == "my page

Full Screen

Full Screen

Selenium 4 Tutorial:

LambdaTest’s Selenium 4 tutorial is covering every aspects of Selenium 4 testing with examples and best practices. Here you will learn basics, such as how to upgrade from Selenium 3 to Selenium 4, to some advanced concepts, such as Relative locators and Selenium Grid 4 for Distributed testing. Also will learn new features of Selenium 4, such as capturing screenshots of specific elements, opening a new tab or window on the browser, and new protocol adoptions.

Chapters:

  1. Upgrading From Selenium 3 To Selenium 4?: In this chapter, learn in detail how to update Selenium 3 to Selenium 4 for Java binding. Also, learn how to upgrade while using different build tools such as Maven or Gradle and get comprehensive guidance for upgrading Selenium.

  2. What’s New In Selenium 4 & What’s Being Deprecated? : Get all information about new implementations in Selenium 4, such as W3S protocol adaption, Optimized Selenium Grid, and Enhanced Selenium IDE. Also, learn what is deprecated for Selenium 4, such as DesiredCapabilites and FindsBy methods, etc.

  3. Selenium 4 With Python: Selenium supports all major languages, such as Python, C#, Ruby, and JavaScript. In this chapter, learn how to install Selenium 4 for Python and the features of Python in Selenium 4, such as Relative locators, Browser manipulation, and Chrom DevTool protocol.

  4. Selenium 4 Is Now W3C Compliant: JSON Wireframe protocol is retiring from Selenium 4, and they are adopting W3C protocol to learn in detail about the advantages and impact of these changes.

  5. How To Use Selenium 4 Relative Locator? : Selenium 4 came with new features such as Relative Locators that allow constructing locators with reference and easily located constructors nearby. Get to know its different use cases with examples.

  6. Selenium Grid 4 Tutorial For Distributed Testing: Selenium Grid 4 allows you to perform tests over different browsers, OS, and device combinations. It also enables parallel execution browser testing, reads up on various features of Selenium Grid 4 and how to download it, and runs a test on Selenium Grid 4 with best practices.

  7. Selenium Video Tutorials: Binge on video tutorials on Selenium by industry experts to get step-by-step direction from automating basic to complex test scenarios with Selenium.

Selenium 101 certifications:

LambdaTest also provides certification for Selenium testing to accelerate your career in Selenium automation testing.

Run Selenium automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful