1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.test.ui

File XWikiWebDriver.java

 
createWikiFromTemplateTest: Timed out after 10 seconds waiting for org.xwiki.test.ui....
testManageColumns: Timed out after 10 seconds. Unable to locate the element ...
 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
56% of files have more coverage

Code metrics

18
194
91
1
975
639
118
0.61
2.13
91
1.3

Classes

Class Line # Actions
XWikiWebDriver 61 194 0% 118 82
0.729372972.9%
 

Contributing tests

This file is covered by 257 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.test.ui;
21   
22    import java.lang.reflect.InvocationTargetException;
23    import java.lang.reflect.Method;
24    import java.util.List;
25    import java.util.Set;
26    import java.util.concurrent.TimeUnit;
27    import java.util.function.Function;
28    import java.util.logging.Level;
29   
30    import org.apache.commons.lang3.StringUtils;
31    import org.openqa.selenium.By;
32    import org.openqa.selenium.Capabilities;
33    import org.openqa.selenium.Keys;
34    import org.openqa.selenium.NoSuchElementException;
35    import org.openqa.selenium.NotFoundException;
36    import org.openqa.selenium.OutputType;
37    import org.openqa.selenium.StaleElementReferenceException;
38    import org.openqa.selenium.WebDriver;
39    import org.openqa.selenium.WebDriverException;
40    import org.openqa.selenium.WebElement;
41    import org.openqa.selenium.interactions.Keyboard;
42    import org.openqa.selenium.interactions.Mouse;
43    import org.openqa.selenium.remote.CommandExecutor;
44    import org.openqa.selenium.remote.ErrorHandler;
45    import org.openqa.selenium.remote.FileDetector;
46    import org.openqa.selenium.remote.RemoteStatus;
47    import org.openqa.selenium.remote.RemoteWebDriver;
48    import org.openqa.selenium.remote.SessionId;
49    import org.openqa.selenium.support.ui.ExpectedCondition;
50    import org.openqa.selenium.support.ui.Wait;
51    import org.openqa.selenium.support.ui.WebDriverWait;
52    import org.slf4j.Logger;
53    import org.slf4j.LoggerFactory;
54   
55    /**
56    * Wraps a {@link org.openqa.selenium.WebDriver} instance and adds new APIs useful for XWiki tests.
57    *
58    * @version $Id: 8015ba4f5cbf9d8cdbd2f73a27963b711e5076b0 $
59    * @since 7.0M2
60    */
 
61    public class XWikiWebDriver extends RemoteWebDriver
62    {
63    private final static Logger LOGGER = LoggerFactory.getLogger(XWikiWebDriver.class);
64   
65    private RemoteWebDriver wrappedDriver;
66   
67    /**
68    * How long to wait (in seconds) before failing a test because an element cannot be found. Can be overridden with
69    * setTimeout.
70    */
71    private int timeout = 10;
72   
 
73  33 toggle public XWikiWebDriver(RemoteWebDriver wrappedDriver)
74    {
75  33 this.wrappedDriver = wrappedDriver;
76   
77    // Wait when trying to find elements till the timeout expires
78  33 setDriverImplicitWait();
79    }
80   
81    // XWiki-specific APIs
82   
 
83  983 toggle public WebElement findElementWithoutWaiting(By by)
84    {
85    // Temporarily remove the implicit wait on the driver since we're doing our own waits...
86  983 manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
87  983 try {
88  983 return findElement(by);
89    } finally {
90  983 setDriverImplicitWait();
91    }
92    }
93   
94    /**
95    * Same as {@link #findElementWithoutWaiting(By)} but don't scroll to make the element visible. Useful for example
96    * whenverifying that the page has finished loading (and thus there's no element visible and we cannot scroll to
97    * it).
98    *
99    * @since 10.8.1
100    * @since 10.9
101    */
 
102  174 toggle public WebElement findElementWithoutWaitingWithoutScrolling(By by)
103    {
104    // Temporarily remove the implicit wait on the driver since we're doing our own waits...
105  174 manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
106  174 try {
107  174 return findElementWithoutScrolling(by);
108    } finally {
109  174 setDriverImplicitWait();
110    }
111    }
112   
 
113  315 toggle public List<WebElement> findElementsWithoutWaiting(By by)
114    {
115    // Temporarily remove the implicit wait on the driver since we're doing our own waits...
116  315 manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
117  315 try {
118  315 return findElements(by);
119    } finally {
120  315 setDriverImplicitWait();
121    }
122    }
123   
 
124  491 toggle public WebElement findElementWithoutWaiting(WebElement element, By by)
125    {
126    // Temporarily remove the implicit wait on the driver since we're doing our own waits...
127  491 manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
128  491 try {
129  491 return element.findElement(by);
130    } finally {
131  491 setDriverImplicitWait();
132    }
133    }
134   
 
135  500 toggle public List<WebElement> findElementsWithoutWaiting(WebElement element, By by)
136    {
137    // Temporarily remove the implicit wait on the driver since we're doing our own waits...
138  500 manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
139  500 try {
140  500 Test failure here return element.findElements(by);
141    } finally {
142  500 setDriverImplicitWait();
143    }
144    }
145   
146    /**
147    * Should be used when the result is supposed to be true (otherwise you'll incur the timeout and an error will be
148    * raised!).
149    */
 
150  22 toggle public boolean hasElement(By by)
151    {
152  22 try {
153  22 findElement(by);
154  8 return true;
155    } catch (NoSuchElementException e) {
156  14 return false;
157    }
158    }
159   
 
160  380 toggle public boolean hasElementWithoutWaiting(By by)
161    {
162  380 try {
163  380 findElementWithoutWaiting(by);
164  293 return true;
165    } catch (NoSuchElementException e) {
166  87 return false;
167    }
168    }
169   
170    /**
171    * Same as {@link #hasElementWithoutWaiting(By)} but don't scroll to make the element visible. Useful for example
172    * whenverifying that the page has finished loading (and thus there's no element visible and we cannot scroll to
173    * it).
174    *
175    * @since 10.8.1
176    * @since 10.9
177    */
 
178  174 toggle public boolean hasElementWithoutWaitingWithoutScrolling(By by)
179    {
180  174 try {
181  174 findElementWithoutWaitingWithoutScrolling(by);
182  31 return true;
183    } catch (NoSuchElementException e) {
184  143 return false;
185    }
186    }
187   
 
188  6 toggle public boolean hasElementWithoutWaiting(WebElement element, By by)
189    {
190  6 try {
191  6 findElementWithoutWaiting(element, by);
192  3 return true;
193    } catch (NoSuchElementException e) {
194  3 return false;
195    }
196    }
197   
198    /**
199    * Should be used when the result is supposed to be true (otherwise you'll incur the timeout).
200    */
 
201  33 toggle public boolean hasElement(WebElement element, By by)
202    {
203  33 try {
204  33 element.findElement(by);
205  33 return true;
206    } catch (NoSuchElementException e) {
207  0 return false;
208    }
209    }
210   
 
211  5908 toggle public <T> void waitUntilCondition(ExpectedCondition<T> condition)
212    {
213    // Temporarily remove the implicit wait on the driver since we're doing our own waits...
214  5908 manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
215  5908 Wait<WebDriver> wait = new WebDriverWait(this, getTimeout());
216  5908 try {
217    // Handle both Selenium 2 and Selenium 3
218  5908 try {
219  5908 Method method = WebDriverWait.class.getMethod("until", Function.class);
220    // We're in Selenium3, it requires a java Function passed to the wait
221  133 try {
222  133 method.invoke(wait, new Function<WebDriver, T>()
223    {
 
224  142 toggle @Override public T apply(WebDriver webDriver)
225    {
226  142 return condition.apply(webDriver);
227    }
228    });
229    } catch (IllegalAccessException e) {
230  0 throw new RuntimeException("Error converting to selenium3", e);
231    } catch (InvocationTargetException e) {
232  0 if (e.getCause() instanceof RuntimeException) {
233  0 throw (RuntimeException) e.getCause();
234    } else {
235  0 throw new RuntimeException("Failed to invoke 'until' method for Selenium3", e);
236    }
237    }
238    } catch (NoSuchMethodException e) {
239    // We're in Selenium 2!
240  5775 Test failure here wait.until(condition);
241    }
242    } finally {
243    // Reset timeout
244  5908 setDriverImplicitWait();
245    }
246    }
247   
248    /**
249    * Forces the driver to wait for a {@link #getTimeout()} number of seconds when looking up page elements
250    * before declaring that it cannot find them.
251    */
 
252  8404 toggle public void setDriverImplicitWait()
253    {
254  8404 setDriverImplicitWait(getTimeout());
255    }
256   
257    /**
258    * Forces the driver to wait for passed number of seconds when looking up page elements before declaring that it
259    * cannot find them.
260    */
 
261  8404 toggle public void setDriverImplicitWait(int timeout)
262    {
263  8404 manage().timeouts().implicitlyWait(timeout, TimeUnit.SECONDS);
264    }
265   
 
266  22272 toggle public int getTimeout()
267    {
268  22272 return this.timeout;
269    }
270   
271    /**
272    * @param timeout the number of seconds after which we consider the action to have failed
273    */
 
274  11 toggle public void setTimeout(int timeout)
275    {
276  11 this.timeout = timeout;
277    }
278   
279    /**
280    * Wait until the element given by the locator is displayed. Give up after timeout seconds.
281    *
282    * @param locator the locator for the element to look for.
283    */
 
284  558 toggle public void waitUntilElementIsVisible(final By locator)
285    {
286  558 Test failure here waitUntilElementIsVisible(null, locator);
287    }
288   
289    /**
290    * Wait until the element specified by the locator is displayed. Give up after timeout seconds.
291    *
292    * @param parentElement where to look for the specified element, {@code null} to look everywhere
293    * @param locator the locator for the element to look for
294    * @since 7.2
295    */
 
296  625 toggle public void waitUntilElementIsVisible(WebElement parentElement, final By locator)
297    {
298  625 Test failure here waitUntilElementsAreVisible(parentElement, new By[] {locator}, true);
299    }
300   
301    /**
302    * Wait until the element given by the locator is displayed. Give up after specified timeout (in seconds).
303    * <p>
304    * Only use this API if you absolutely need a longer timeout than the default, otherwise use
305    * {@link #waitUntilElementIsVisible(org.openqa.selenium.By)}.
306    *
307    * @param locator the locator for the element to look for
308    * @param timeout the timeout after which to give up
309    * @since 5.4RC1
310    */
 
311  0 toggle public void waitUntilElementIsVisible(final By locator, int timeout)
312    {
313  0 int currentTimeout = getTimeout();
314  0 try {
315  0 setTimeout(timeout);
316  0 waitUntilElementsAreVisible(new By[] {locator}, true);
317    } finally {
318  0 setTimeout(currentTimeout);
319    }
320    }
321   
322    /**
323    * Wait until one or all of an array of element locators are displayed.
324    *
325    * @param locators the array of element locators to look for
326    * @param all if true then don't return until all elements are found. Otherwise return after finding one
327    */
 
328  3 toggle public void waitUntilElementsAreVisible(final By[] locators, final boolean all)
329    {
330  3 waitUntilElementsAreVisible(null, locators, all);
331    }
332   
333    /**
334    * Wait until one or all of an array of element locators are displayed.
335    *
336    * @param parentElement where to look for the specified elements, {@code null} to look everywhere
337    * @param locators the array of element locators to look for
338    * @param all if true then don't return until all elements are found. Otherwise return after finding one
339    * @since 7.2
340    */
 
341  628 toggle public void waitUntilElementsAreVisible(final WebElement parentElement, final By[] locators, final boolean all)
342    {
343  628 Test failure here waitUntilCondition(new ExpectedCondition<WebElement>()
344    {
 
345  1442 toggle @Override
346    public WebElement apply(WebDriver driver)
347    {
348  1442 WebElement element = null;
349  1442 for (By locator : locators) {
350  1445 try {
351  1445 if (parentElement != null) {
352    // Use the locator from the passed parent element.
353  72 element = parentElement.findElement(locator);
354    } else {
355    // Use the locator from the root.
356  1373 element = driver.findElement(locator);
357    }
358    } catch (NotFoundException e) {
359    // This exception is caught by WebDriverWait
360    // but it returns null which is not necessarily what we want.
361  808 if (all) {
362  805 return null;
363    }
364  3 continue;
365    }
366    // At this stage it's possible the element is no longer valid (for example if the DOM has
367    // changed). If it's no longer attached to the DOM then consider we haven't found the element
368    // yet.
369  637 try {
370  627 if (element.isDisplayed()) {
371  627 if (!all) {
372  2 return element;
373    }
374  0 } else if (all) {
375  0 return null;
376    }
377    } catch (StaleElementReferenceException e) {
378    // Consider we haven't found the element yet
379  0 return null;
380    }
381    }
382  625 return element;
383    }
384    });
385    }
386   
387    /**
388    * Waits until the given locator corresponds to either a hidden or a deleted element.
389    *
390    * @param locator the locator to wait for
391    */
 
392  40 toggle public void waitUntilElementDisappears(final By locator)
393    {
394  40 waitUntilElementDisappears(null, locator);
395    }
396   
397    /**
398    * Waits until the given locator corresponds to either a hidden or a deleted element.
399    *
400    * @param parentElement the element from which to start the search
401    * @param locator the locator to wait for
402    */
 
403  46 toggle public void waitUntilElementDisappears(final WebElement parentElement, final By locator)
404    {
405  46 waitUntilCondition(new ExpectedCondition<Boolean>()
406    {
 
407  70 toggle @Override
408    public Boolean apply(WebDriver driver)
409    {
410  70 try {
411  70 WebElement element = null;
412    // Note: Make sure to perform the find operation without waiting, since if the element is already
413    // gone (what we really want here) there is no point to wait for it.
414  70 if (parentElement != null) {
415    // Use the locator from the passed parent element.
416  6 element = findElementWithoutWaiting(parentElement, locator);
417    } else {
418    // Use the locator from the root.
419  64 element = findElementWithoutWaiting(locator);
420    }
421  30 return !element.isDisplayed();
422    } catch (NotFoundException e) {
423  39 return Boolean.TRUE;
424    } catch (StaleElementReferenceException e) {
425    // The element was removed from DOM in the meantime
426  3 return Boolean.TRUE;
427    }
428    }
429    });
430    }
431   
432    /**
433    * Shows hidden elements, as if they would be shown on hover. Currently implemented using JavaScript. Will throw a
434    * {@link RuntimeException} if the web driver does not support JavaScript or JavaScript is disabled.
435    *
436    * @param locator locator used to find the element, in case multiple elements are found, the first is used
437    */
 
438  0 toggle public void makeElementVisible(By locator)
439    {
440  0 makeElementVisible(findElement(locator));
441    }
442   
 
443  0 toggle public void makeElementVisible(WebElement element)
444    {
445    // RenderedWebElement.hover() don't seem to work, workarounded using JavaScript call
446  0 executeJavascript("arguments[0].style.visibility='visible'", element);
447    }
448   
449    /**
450    * Waits until the given element has a non-empty value for an attribute.
451    *
452    * @param locator the element to wait on
453    * @param attributeName the name of the attribute to check
454    */
 
455  0 toggle public void waitUntilElementHasNonEmptyAttributeValue(final By locator, final String attributeName)
456    {
457  0 waitUntilCondition(new ExpectedCondition<Boolean>()
458    {
 
459  0 toggle @Override
460    public Boolean apply(WebDriver driver)
461    {
462  0 try {
463  0 WebElement element = driver.findElement(locator);
464  0 return !element.getAttribute(attributeName).isEmpty();
465    } catch (NotFoundException e) {
466  0 return false;
467    } catch (StaleElementReferenceException e) {
468    // The element was removed from DOM in the meantime
469  0 return false;
470    }
471    }
472    });
473    }
474   
475    /**
476    * Waits until the given element has a certain value for an attribute.
477    *
478    * @param locator the element to wait on
479    * @param attributeName the name of the attribute to check
480    * @param expectedValue the attribute value to wait for
481    */
 
482  8 toggle public void waitUntilElementHasAttributeValue(final By locator, final String attributeName,
483    final String expectedValue)
484    {
485  8 waitUntilCondition(new ExpectedCondition<Boolean>()
486    {
 
487  18 toggle @Override
488    public Boolean apply(WebDriver driver)
489    {
490  18 try {
491  18 WebElement element = driver.findElement(locator);
492  18 return expectedValue.equals(element.getAttribute(attributeName));
493    } catch (NotFoundException e) {
494  0 return false;
495    } catch (StaleElementReferenceException e) {
496    // The element was removed from DOM in the meantime
497  0 return false;
498    }
499    }
500    });
501    }
502   
503    /**
504    * Waits until the given element ends with a certain value for an attribute.
505    *
506    * @param locator the element to wait on
507    * @param attributeName the name of the attribute to check
508    * @param expectedValue the attribute value to wait for
509    */
 
510  1 toggle public void waitUntilElementEndsWithAttributeValue(final By locator, final String attributeName,
511    final String expectedValue)
512    {
513  1 waitUntilCondition(new ExpectedCondition<Boolean>()
514    {
 
515  2 toggle @Override
516    public Boolean apply(WebDriver driver)
517    {
518  2 try {
519  2 WebElement element = driver.findElement(locator);
520  2 return element.getAttribute(attributeName).endsWith(expectedValue);
521    } catch (NotFoundException e) {
522  0 return false;
523    } catch (StaleElementReferenceException e) {
524    // The element was removed from DOM in the meantime
525  0 return false;
526    }
527    }
528    });
529    }
530   
531    /**
532    * Waits until the given element has a certain value as its inner text.
533    *
534    * @param locator the element to wait on
535    * @param expectedValue the content value to wait for
536    * @since 3.2M3
537    */
 
538  0 toggle public void waitUntilElementHasTextContent(final By locator, final String expectedValue)
539    {
540  0 waitUntilCondition(new ExpectedCondition<Boolean>()
541    {
 
542  0 toggle @Override
543    public Boolean apply(WebDriver driver)
544    {
545  0 WebElement element = driver.findElement(locator);
546  0 return Boolean.valueOf(expectedValue.equals(element.getText()));
547    }
548    });
549    }
550   
 
551  5247 toggle public Object executeJavascript(String javascript, Object... arguments)
552    {
553  5247 return executeScript(javascript, arguments);
554    }
555   
556    /**
557    * There is no easy support for alert/confirm window methods yet, see -
558    * http://code.google.com/p/selenium/issues/detail?id=27 -
559    * http://www.google.com/codesearch/p?hl=en#2tHw6m3DZzo/branches
560    * /merge/common/test/java/org/openqa/selenium/AlertsTest.java The aim is : <code>
561    * Alert alert = this.getDriver().switchTo().alert();
562    * alert.accept();
563    * </code> Until then, the following hack does override the confirm method in Javascript to return the given value.
564    *
565    * @param accept {@code true} to accept the confirmation dialog, {@code false} to cancel it
566    */
 
567  5 toggle public void makeConfirmDialogSilent(boolean accept)
568    {
569  5 String script = String.format("window.confirm = function() { return %s; }", accept);
570  5 executeScript(script);
571    }
572   
573    /**
574    * @see #makeConfirmDialogSilent(boolean)
575    * @since 3.2M3
576    */
 
577  0 toggle public void makeAlertDialogSilent()
578    {
579  0 executeScript("window.alert = function() { return true; }");
580    }
581   
582    /**
583    * Waits until the provided javascript expression returns {@code true}.
584    * <p>
585    * The wait is done while the expression returns {@code false}.
586    *
587    * @param booleanExpression the javascript expression to wait for to return {@code true}. The expression must have a
588    * {@code return} statement on the last line, e.g. {@code "return window.jQuery != null"}
589    * @param arguments any arguments passed to the javascript expression
590    * @throws IllegalArgumentException if the evaluated expression does not return a boolean result
591    * @see #executeJavascript(String, Object...)
592    * @since 6.2
593    */
 
594  4638 toggle public void waitUntilJavascriptCondition(final String booleanExpression, final Object... arguments)
595    throws IllegalArgumentException
596    {
597  4638 waitUntilCondition(new ExpectedCondition<Boolean>()
598    {
 
599  4638 toggle @Override
600    public Boolean apply(WebDriver driver)
601    {
602  4638 boolean result = false;
603   
604  4638 Object rawResult = executeJavascript(booleanExpression, arguments);
605  4638 if (rawResult instanceof Boolean) {
606  4638 result = (Boolean) rawResult;
607    } else {
608  0 throw new IllegalArgumentException("The executed javascript does not return a boolean value");
609    }
610   
611  4638 return result;
612    }
613    });
614    }
615   
616    // WebDriver APIs
617   
 
618  2096 toggle @Override
619    public void get(String s)
620    {
621  2096 this.wrappedDriver.get(s);
622    }
623   
 
624  1527 toggle @Override
625    public String getCurrentUrl()
626    {
627  1527 return this.wrappedDriver.getCurrentUrl();
628    }
629   
 
630  47 toggle @Override
631    public String getTitle()
632    {
633  47 return this.wrappedDriver.getTitle();
634    }
635   
 
636  543 toggle @Override
637    public List<WebElement> findElements(By by)
638    {
639  543 return this.wrappedDriver.findElements(by);
640    }
641   
642    // Make sure the element is visible by scrolling it into view. Otherwise it's possible for example that the
643    // visible floating save bar would hide the element.
 
644  6851 toggle private WebElement scrollTo(WebElement element)
645    {
646  6851 executeScript("arguments[0].scrollIntoView();", element);
647  6850 return element;
648    }
649   
 
650  7816 toggle @Override
651    public WebElement findElement(By by)
652    {
653  7816 Test failure here WebElement element = this.wrappedDriver.findElement(by);
654  6799 return this.scrollTo(element);
655    }
656   
 
657  26 toggle @Override
658    public String getPageSource()
659    {
660  26 return this.wrappedDriver.getPageSource();
661    }
662   
 
663  1 toggle @Override
664    public void close()
665    {
666  1 this.wrappedDriver.close();
667    }
668   
 
669  30 toggle @Override
670    public void quit()
671    {
672  30 this.wrappedDriver.quit();
673    }
674   
 
675  0 toggle @Override
676    public Set<String> getWindowHandles()
677    {
678  0 return this.wrappedDriver.getWindowHandles();
679    }
680   
 
681  53 toggle @Override
682    public String getWindowHandle()
683    {
684  53 return this.wrappedDriver.getWindowHandle();
685    }
686   
 
687  14 toggle @Override
688    public TargetLocator switchTo()
689    {
690  14 return this.wrappedDriver.switchTo();
691    }
692   
 
693  13 toggle @Override
694    public Navigation navigate()
695    {
696  13 return this.wrappedDriver.navigate();
697    }
698   
 
699  16926 toggle @Override
700    public Options manage()
701    {
702  16926 return this.wrappedDriver.manage();
703    }
704   
705    // Remote WebDriver APIs
706   
 
707  0 toggle @Override
708    public void setFileDetector(FileDetector detector)
709    {
710  0 this.wrappedDriver.setFileDetector(detector);
711    }
712   
 
713  10 toggle @Override
714    public SessionId getSessionId()
715    {
716  10 return this.wrappedDriver.getSessionId();
717    }
718   
 
719  0 toggle @Override
720    public ErrorHandler getErrorHandler()
721    {
722  0 return this.wrappedDriver.getErrorHandler();
723    }
724   
 
725  0 toggle @Override
726    public void setErrorHandler(ErrorHandler handler)
727    {
728  0 this.wrappedDriver.setErrorHandler(handler);
729    }
730   
 
731  0 toggle @Override
732    public CommandExecutor getCommandExecutor()
733    {
734  0 return this.wrappedDriver.getCommandExecutor();
735    }
736   
 
737  357 toggle @Override
738    public Capabilities getCapabilities()
739    {
740  357 return this.wrappedDriver.getCapabilities();
741    }
742   
 
743  0 toggle @Override
744    public RemoteStatus getRemoteStatus()
745    {
746  0 return this.wrappedDriver.getRemoteStatus();
747    }
748   
 
749  19 toggle @Override
750    public <X> X getScreenshotAs(OutputType<X> outputType) throws WebDriverException
751    {
752  19 return this.wrappedDriver.getScreenshotAs(outputType);
753    }
754   
 
755  20 toggle @Override
756    public WebElement findElementById(String using)
757    {
758  20 return this.scrollTo(this.wrappedDriver.findElementById(using));
759    }
760   
 
761  0 toggle @Override
762    public List<WebElement> findElementsById(String using)
763    {
764  0 return this.wrappedDriver.findElementsById(using);
765    }
766   
 
767  9 toggle @Override
768    public WebElement findElementByLinkText(String using)
769    {
770  9 return this.scrollTo(this.wrappedDriver.findElementByLinkText(using));
771    }
772   
 
773  0 toggle @Override
774    public List<WebElement> findElementsByLinkText(String using)
775    {
776  0 return this.wrappedDriver.findElementsByLinkText(using);
777    }
778   
 
779  0 toggle @Override
780    public WebElement findElementByPartialLinkText(String using)
781    {
782  0 return this.scrollTo(this.wrappedDriver.findElementByPartialLinkText(using));
783    }
784   
 
785  0 toggle @Override
786    public List<WebElement> findElementsByPartialLinkText(String using)
787    {
788  0 return this.wrappedDriver.findElementsByPartialLinkText(using);
789    }
790   
 
791  0 toggle @Override
792    public WebElement findElementByTagName(String using)
793    {
794  0 return this.scrollTo(this.wrappedDriver.findElementByTagName(using));
795    }
796   
 
797  0 toggle @Override
798    public List<WebElement> findElementsByTagName(String using)
799    {
800  0 return this.wrappedDriver.findElementsByTagName(using);
801    }
802   
 
803  0 toggle @Override
804    public WebElement findElementByName(String using)
805    {
806  0 return this.scrollTo(this.wrappedDriver.findElementByName(using));
807    }
808   
 
809  0 toggle @Override
810    public List<WebElement> findElementsByName(String using)
811    {
812  0 return this.wrappedDriver.findElementsByName(using);
813    }
814   
 
815  15 toggle @Override
816    public WebElement findElementByClassName(String using)
817    {
818  15 return this.scrollTo(this.wrappedDriver.findElementByClassName(using));
819    }
820   
 
821  2 toggle @Override
822    public List<WebElement> findElementsByClassName(String using)
823    {
824  2 return this.wrappedDriver.findElementsByClassName(using);
825    }
826   
 
827  4 toggle @Override
828    public WebElement findElementByCssSelector(String using)
829    {
830  4 return this.scrollTo(this.wrappedDriver.findElementByCssSelector(using));
831    }
832   
 
833  2 toggle @Override
834    public List<WebElement> findElementsByCssSelector(String using)
835    {
836  2 return this.wrappedDriver.findElementsByCssSelector(using);
837    }
838   
 
839  4 toggle @Override
840    public WebElement findElementByXPath(String using)
841    {
842  4 return this.scrollTo(this.wrappedDriver.findElementByXPath(using));
843    }
844   
 
845  0 toggle @Override
846    public List<WebElement> findElementsByXPath(String using)
847    {
848  0 return this.wrappedDriver.findElementsByXPath(using);
849    }
850   
 
851  13818 toggle @Override
852    public Object executeScript(String script, Object... args)
853    {
854  13818 return this.wrappedDriver.executeScript(script, args);
855    }
856   
 
857  0 toggle @Override
858    public Object executeAsyncScript(String script, Object... args)
859    {
860  0 return this.wrappedDriver.executeAsyncScript(script, args);
861    }
862   
 
863  0 toggle @Override
864    public void setLogLevel(Level level)
865    {
866  0 this.wrappedDriver.setLogLevel(level);
867    }
868   
 
869  123 toggle @Override
870    public Keyboard getKeyboard()
871    {
872  123 return this.wrappedDriver.getKeyboard();
873    }
874   
 
875  112 toggle @Override
876    public Mouse getMouse()
877    {
878  112 return this.wrappedDriver.getMouse();
879    }
880   
 
881  0 toggle @Override
882    public FileDetector getFileDetector()
883    {
884  0 return this.wrappedDriver.getFileDetector();
885    }
886   
 
887  0 toggle @Override
888    public String toString()
889    {
890  0 return this.wrappedDriver.toString();
891    }
892   
893    /**
894    * Compared to using clear() + sendKeys(), this method ensures that an "input" event is triggered on the JavaScript
895    * side for an empty ("") value. Without this, the clear() method triggers just a "change" event.
896    *
897    * @param textInputElement an element accepting text input