View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.testtools.selenium;
17  
18  import org.junit.Assert;
19  import org.kuali.rice.testtools.common.JiraAwareFailable;
20  import org.kuali.rice.testtools.common.JiraAwareFailureUtils;
21  import org.openqa.selenium.By;
22  import org.openqa.selenium.WebDriver;
23  import org.openqa.selenium.WebElement;
24  
25  import java.util.List;
26  
27  /**
28   * <p>
29   * Jira Aware Automated Functional Test Base.
30   * </p><p>
31   * <ul>
32   *     <li>{@see JiraAwareWebDriverUtils}</li>
33   *     <li>{@see JiraAwareFailable}</li>
34   *     <li>{@see JiraAwareFailure}</li>
35   * </ul>
36   * TODO: promote the various jiraAware methods from WebDriverLegacyITBase
37   * </p>
38   *
39   * @author Kuali Rice Team (rice.collab@kuali.org)
40   */
41  public abstract class JiraAwareAftBase extends AutomatedFunctionalTestBase implements JiraAwareFailable {
42  
43      /**
44       * Test state, used for Saucelabs REST API call to set test state via @{see SauceLabsWebDriverHelper#tearDown}.
45       */
46      private boolean passed = false;
47  
48      /**
49       * Implement to check for Incident Report or other on screen errors, should call {@see JiraAwareFailable#fail} to fail,
50       * without calling any of the jiraAwareFail methods to avoid an infinite loop.
51       *
52       * @param locator used in failure message if there is an incident report can be blank
53       * @param message used in failure message if there is an incident report can be blank
54       */
55      protected abstract void checkForIncidentReport(String locator, String message);
56  
57      /**
58       * WebDriver used in fail and pass to display jGrowl messages.
59       *
60       * @return WebDriver used to display jGrowl messages on fail and pass
61       */
62      protected abstract WebDriver getDriver();
63  
64      /**
65       * {@see WebDriverUtils#assertButtonDisabledByText}
66       *
67       * @param buttonText of button to assert is disabled
68       */
69      protected void assertButtonDisabledByText(String buttonText) {
70          JiraAwareWebDriverUtils.assertButtonDisabledByText(getDriver(), buttonText, this);
71      }
72  
73      /**
74       * {@see WebDriverUtils.assertButtonEnabledByText}.
75       *
76       * @param buttonText of button to assert is disabled
77       */
78      protected void assertButtonEnabledByText(String buttonText) {
79          JiraAwareWebDriverUtils.assertButtonEnabledByText(getDriver(), buttonText, this);
80      }
81  
82      protected void assertDataTableContains(String[][] data) throws InterruptedException {
83          boolean dataPresent = true;
84          String missingMessage = "";
85          String dataTableRow;
86          for (int i = 0, s = data.length; i < s; i++) {
87              dataTableRow = findDataTableRow(data[i][0]).getText();
88              for (int j = 1, t = data[i].length; j < t; j++) {
89                  if (!dataTableRow.contains(data[i][j])) {
90                      dataPresent = false;
91                      missingMessage += data[i][j] + " not present in data table row containing " + data[i][0] + ". ";
92                  }
93              }
94              WebDriverUtils.jGrowl(getDriver(), "Assert DataTable Row", false, "Assert datatable row '" + dataTableRow
95                      + "' contains '" + data[i] + "' " + dataPresent);
96          }
97          if (!dataPresent) {
98              jiraAwareFail(missingMessage);
99          }
100     }
101 
102     protected void assertDataTableContains(String[][] data, String tableClass) throws InterruptedException {
103         boolean dataPresent = true;
104         String missingMessage = "";
105         String dataTableRow;
106         for (int i = 0, s = data.length; i < s; i++) {
107             dataTableRow = findDataTableRow(data[i][0], tableClass).getText();
108             for (int j = 1, t = data[i].length; j < t; j++) {
109                 if (!dataTableRow.contains(data[i][j])) {
110                     dataPresent = false;
111                     missingMessage += data[i][j] + " not present in data table row containing " + data[i][0] + ". ";
112                 }
113             }
114         }
115         if (!dataPresent) {
116             jiraAwareFail(missingMessage);
117         }
118     }
119 
120     protected void assertElementPresentByName(String name) {
121         assertElementPresentByName(name, this.getClass().toString());
122     }
123 
124     protected void assertElementPresentByName(String name, String message) {
125         try {
126             findElement(By.name(name));
127         } catch (Exception e) {
128             jiraAwareFail(name + " not present " + message);
129         }
130     }
131 
132     protected void assertElementPresentByXpath(String locator) {
133         assertElementPresentByXpath(locator, this.getClass().toString());
134     }
135 
136     protected void assertElementPresentByXpath(String locator, String message) {
137         try {
138             findElement(By.xpath(locator));
139         } catch (Exception e) {
140             jiraAwareFail(By.xpath(locator), message, e);
141         }
142     }
143 
144     protected void assertElementPresentByLinkText(String linkText) {
145         try {
146             findElement(By.linkText(linkText));
147         } catch (Exception e) {
148             jiraAwareFail(By.cssSelector(linkText), this.getClass().toString(), e);
149         }
150 
151     }
152 
153     protected void assertElementPresent(String locator) {
154         try {
155             findElement(By.cssSelector(locator));
156         } catch (Exception e) {
157             jiraAwareFail(By.cssSelector(locator), this.getClass().toString(), e);
158         }
159     }
160 
161     protected void assertEquals(boolean expected, boolean actual) {
162         if (expected != actual) {
163             jiraAwareFail("Expected \"" + expected + "\" but saw \"" + actual + "\" instead");
164         }
165     }
166 
167     protected void assertEquals(int expected, int actual) {
168         if (expected != actual) {
169             jiraAwareFail("Expected \"" + expected + "\" but saw \"" + actual + "\" instead");
170         }
171     }
172 
173     protected void assertEquals(String message, int expected, int actual) {
174         if (expected != actual) {
175             jiraAwareFail("Expected \"" + expected + "\" but saw \"" + actual + "\" instead " + message);
176         }
177     }
178 
179 
180     protected void assertEquals(String expected, String actual) {
181         if (!expected.equals(actual)) {
182             jiraAwareFail("Expected \"" + expected + "\" but saw \"" + actual + "\" instead");
183         }
184     }
185 
186     /**
187      * If booleanToAssertFalse is true call {@see jiraAwareFail}.
188      *
189      * @param booleanToAssertFalse
190      */
191     protected void assertFalse(boolean booleanToAssertFalse) {
192         JiraAwareWebDriverUtils.assertFalse(booleanToAssertFalse, this);
193     }
194 
195     /**
196      * If booleanToAssertFalse is true call {@see jiraAwareFail}.
197      *
198      * @param message to include if booleanToAssertTrue is true
199      * @param booleanToAssertFalse
200      */
201     protected void assertFalse(String message, boolean booleanToAssertFalse) {
202         JiraAwareWebDriverUtils.assertFalse(message, booleanToAssertFalse, this);
203     }
204 
205     protected void assertIsVisible(String locator) {
206         if (!isVisible(locator)) {
207             jiraAwareFail(locator + " is not visible and should be");
208         }
209     }
210 
211     protected void assertIsVisible(By by, String message) {
212         if (!isVisible(by)) {
213             jiraAwareFail(by + " not visible " + message);
214         }
215     }
216 
217     protected void assertIsVisibleById(String id) {
218         if (!isVisibleById(id)) {
219             jiraAwareFail(id + " is not visible and should be");
220         }
221     }
222 
223     protected void assertIsVisibleByXpath(String xpath, String message) {
224         if (!isVisibleByXpath(xpath)) {
225             jiraAwareFail(xpath + " not visible " + message);
226         }
227     }
228 
229     protected void assertIsNotVisible(By by) {
230         assertIsNotVisible(by, this.getClass().toString());
231     }
232 
233     protected void assertIsNotVisible(By by, String message) {
234         if (isVisible(by)) {
235             jiraAwareFail(by + " is visible and should not be " + message);
236         }
237     }
238 
239     protected void assertIsNotVisible(String locator) {
240         if (isVisible(locator)) {
241             jiraAwareFail(locator + " is visible and should not be");
242         }
243     }
244 
245     protected void assertIsNotVisibleByXpath(String xpath) {
246         if (isVisible(By.xpath(xpath))) {
247             jiraAwareFail(xpath + " is visible and should not be");
248         }
249     }
250 
251     protected void assertIsNotVisibleByXpath(String xpath, String message) {
252         if (isVisibleByXpath(xpath)) {
253             jiraAwareFail(xpath + " visible and should not be " + message);
254         }
255     }
256 
257     protected void assertLabeledTextNotPresent(String[][] labeledText) {
258         boolean allLabeledTextNotPresent = true;
259         String missingMessage = "";
260         for (int i = 0, s = labeledText.length; i < s; i++) {
261             if (isLabeledTextPresent(labeledText[i][0], labeledText[i][1])) {
262                 allLabeledTextNotPresent = false;
263                 missingMessage += "Text: " + labeledText[i][1] + " labeled by: " + labeledText[i][0] + " present. ";
264             }
265         }
266         if (!allLabeledTextNotPresent) {
267             jiraAwareFail(missingMessage);
268         }
269     }
270 
271     protected void assertLabeledTextPresent(String[][] labeledText) {
272         boolean allLabeledTextPresent = true;
273         String missingMessage = "";
274         for (int i = 0, s = labeledText.length; i < s; i++) {
275             if (!isLabeledTextPresent(labeledText[i][0], labeledText[i][1])) {
276                 allLabeledTextPresent = false;
277                 missingMessage += "Text: " + labeledText[i][1] + " labeled by: " + labeledText[i][0] + " not present. ";
278             }
279         }
280         if (!allLabeledTextPresent) {
281             jiraAwareFail(missingMessage);
282         }
283     }
284 
285     protected void assertLabeledTextPresent(String label, String text) {
286         if (!isLabeledTextPresent(label, text)) {
287             jiraAwareFail("Text: " + text + " labeled by: " + label + " not present");
288         }
289     }
290 
291     protected void assertResultCount(String count) throws InterruptedException {
292         jiraAwareWaitFor(By.cssSelector("li.uif-infoMessageItem"), "result count for " + this.getClass().toString());
293         assertTextPresent(count + " items retrieved, displaying all items.", "li.uif-infoMessageItem", this.getClass().toString());
294     }
295 
296     /**
297      * <b>WARNING:</b> this only does a check against the page source.  The form url can have random character that match
298      * simple text.  A narrowly scoped locator for {@see #assertTextPresent(String String String)}
299      *
300      * @param text
301      */
302     protected void assertTextPresent(String text) {
303         assertTextPresent(text, this.getClass().toString());
304     }
305 
306     /**
307      * <b>WARNING:</b> this only does a check against the page source.  The form url can have random character that match simple text
308      * @param text
309      */
310     protected void assertTextPresent(String text, String message) {
311         WebDriverUtils.jGrowl(getDriver(), "Assert Text Present", false, "Assert text '" + text + "' is present.");
312         String pageSource = getDriver().getPageSource();
313         if (!pageSource.contains(text)) {
314             jiraAwareFail(text + " not present " + message);
315         }
316         WebDriverUtils.highlightElement(getDriver(), By.xpath("//*[contains(text(), '" + text + "')]"));
317     }
318 
319     /**
320      * @param text
321      */
322     protected void assertTextPresent(String text, String cssSelector, String message){
323         WebElement element = findElement(By.cssSelector(cssSelector));
324         if (!element.getText().contains(text)){
325             jiraAwareFail(text + " for " + cssSelector + " not present " + message);
326         }
327     }
328 
329     /**
330      * Asset that the given text does not occur in the page
331      * Warning, this only does a check against the page source.  The form url can have random character that match simple text
332      * @param text the text to search for
333      */
334     protected void assertTextNotPresent(String text) {
335         assertTextNotPresent(text, this.getClass().toString());
336     }
337 
338     /**
339      * Assert that the given text does not occur in the page, and add an additional message to the failure
340      * @param text the text to search for
341      * @param message the message to add to the failure
342      */
343     protected void assertTextNotPresent(String text, String message) {
344         String contents = getDriver().getPageSource();
345         if (contents.contains(text)) {
346             jiraAwareFail(text + " is present and should not be " + message);
347         }
348     }
349 
350     /**
351      * @param text
352      */
353     protected void assertTextNotPresent(String text, String cssSelector, String message){
354         WebElement element = findElement(By.cssSelector(cssSelector));
355         if (element.getText().contains(text)){
356             jiraAwareFail(text + " for " + cssSelector + " is present and shouldn't be " + message);
357         }
358     }
359 
360     /**
361      * If booleanToAssertTrue is false call {@see jiraAwareFail}.
362      *
363      * @param booleanToAssertTrue
364      */
365     protected void assertTrue(boolean booleanToAssertTrue) {
366         JiraAwareWebDriverUtils.assertTrue(booleanToAssertTrue, this);
367     }
368 
369     /**
370      * If booleanToAssertTrue is false call {@see jiraAwareFail}.
371      *
372      * @param message to include if booleanToAssertTrue is false
373      * @param booleanToAssertTrue
374      */
375     protected void assertTrue(String message, boolean booleanToAssertTrue) {
376         JiraAwareWebDriverUtils.assertTrue(message, booleanToAssertTrue, this);
377     }
378 
379     /**
380      * {@inheritDoc}
381      * <p>
382      * Set passed to false, call jGrowl sticky with the given message, then fails using  {@see JiraAwareFailable#fail}.
383      * </p>
384      * @param message to display with failure
385      */
386     @Override
387     public void fail(String message) {
388         passed = false;
389         WebDriverUtils.jGrowl(getDriver(), "Failure " + getClass().getSimpleName(), true, message);
390         Assert.fail(message); // The final fail that JiraAwareFailure calls, do not change this to a JiraAwareFailure.
391     }
392 
393     protected WebElement findDataTableRow(String keyText) throws InterruptedException {
394         return findDataTableRow(keyText, "dataTable");
395     }
396 
397     protected WebElement findDataTableRow(String keyText, String className) throws InterruptedException {
398         jiraAwareWaitFor(By.className(className));
399         WebElement element = findElement(By.className(className));
400         return findElement(By.xpath("./*/tr//*[contains(text(), '" + keyText + "')]/ancestor::tr"), element);
401     }
402 
403     /**
404      * {@see WebDriverUtils#findElement}.
405      *
406      * @param by to find element with
407      * @return WebElement found with given by
408      */
409     protected WebElement findElement(By by) {
410         try {
411             return WebDriverUtils.findElement(getDriver(), by);
412         } catch (Exception e) {
413             jiraAwareFail(by.toString(), e.getMessage(), e);
414         }
415         return null; // required by compiler, never reached
416     }
417 
418     protected WebElement findElement(By by, WebElement elementToFindOn) {
419         try {
420             WebElement found = elementToFindOn.findElement(by);
421             WebDriverUtils.highlightElement(getDriver(), found);
422             return found;
423         } catch (Exception e) {
424             jiraAwareFail(by.toString(), e.getMessage() + " " + this.getClass().toString(), e);
425         }
426         return null; // required by compiler, never reached
427     }
428 
429     protected boolean isLabeledTextPresent(String label, String text) {
430         WebElement element = findElement(By.xpath("//tr/th/*/label[contains(text(), '" + label + "')]/ancestor::tr/td"));
431         String labeledText = element.getText().trim();
432         WebDriverUtils.jGrowl(getDriver(), "Is Labeled Text Present", false, "Is text '" + text + "' present for label '" + label + "'? " + labeledText.contains(text));
433         return labeledText.contains(text);
434     }
435 
436     protected boolean isVisible(String locator) {
437         return isVisible(By.cssSelector(locator));
438     }
439 
440     protected boolean isVisible(By by) {
441         List<WebElement> elements = getDriver().findElements(by);
442         for (WebElement element: elements) {
443             if (element.isDisplayed()) {
444                 return true;
445             }
446         }
447         return false;
448     }
449 
450     protected boolean isVisibleById(String id) {
451         return isVisible(By.id(id));
452     }
453 
454     protected boolean isVisibleByXpath(String locator) {
455         return isVisible(By.xpath(locator));
456     }
457 
458     /**
459      * {@inheritDoc}
460      * {@see #checkForIncidentReport} and {@see JiraAwareFailureUtils#fail}.
461      *
462      * @param message to check for a Jira match and fail with.
463      */
464     @Override
465     public void jiraAwareFail(String message) {
466         checkForIncidentReport("", message);
467         JiraAwareFailureUtils.fail(message, this);
468     }
469 
470     /**
471      * {@inheritDoc}
472      * {@see #checkForIncidentReport} and {@see JiraAwareFailureUtils#fail}.
473      *
474      * @param contents to check for a Jira match
475      * @param message to check for a Jira match and fail with.
476      */
477     @Override
478     public void jiraAwareFail(String contents, String message) {
479         checkForIncidentReport(contents, message);
480         JiraAwareFailureUtils.fail(contents, message, this);
481     }
482 
483     /**
484      * {@see #checkForIncidentReport} and {@see JiraAwareFailureUtils#fail}.
485      *
486      * @param by to check for a Jira match
487      * @param message to check for a Jira match and fail with.
488      * @param throwable to check for a Jira match
489      */
490     protected void jiraAwareFail(By by, String message, Throwable throwable) {
491         jiraAwareFail(by.toString(), message, throwable);
492     }
493 
494     /**
495      * {@inheritDoc}
496      * {@see #checkForIncidentReport} and {@see JiraAwareFailureUtils#fail}.
497      *
498      * @param contents to check for a Jira match
499      * @param message to check for a Jira match and fail with.
500      * @param throwable to check for a Jira match
501      */
502     @Override
503     public void jiraAwareFail(String contents, String message, Throwable throwable) {
504         checkForIncidentReport(contents, message);
505         JiraAwareFailureUtils.fail(contents, message, throwable, this);
506     }
507 
508     /**
509      * {@see #checkForIncidentReport} and {@see JiraAwareFailureUtils#fail}.
510      *
511      * @param contents to check for a Jira match
512      * @param message to check for a Jira match and fail with.
513      * @param throwable to check for a Jira match
514      * @param failable to call fail on
515      */
516     protected void jiraAwareFail(String contents, String message, Throwable throwable, JiraAwareFailable failable) {
517         checkForIncidentReport(contents, message);
518         JiraAwareFailureUtils.fail(contents, message, throwable, failable);
519     }
520 
521     /**
522      * {@see #checkForIncidentReport} and {@see JiraAwareFailureUtils#fail}.
523      *
524      * @param by to click on
525      * @param message on failure
526      * @throws InterruptedException
527      */
528     protected void jiraAwareWaitAndClick(By by, String message) throws InterruptedException {
529         jiraAwareWaitAndClick(by, message, this);
530     }
531 
532     /**
533      * {@see #jiraAwareWaitFor}
534      *
535      * @param by to click on
536      * @param message on failure
537      * @param failable to fail on if not found
538      * @throws InterruptedException
539      */
540     protected void jiraAwareWaitAndClick(By by, String message, JiraAwareFailable failable) throws InterruptedException {
541         try {
542             jiraAwareWaitFor(by, message, failable);
543             WebElement element = findElement(by);
544 //            String name = element.getAttribute("name");
545 //            if (name == null || "".equals(name)) {
546 //                name = element.getAttribute("id");
547 //            }
548 //            WebDriverUtils.jGrowl(getDriver(), "Click " + name, false, "Click " + name);
549             element.click();
550         } catch (Exception e) {
551             failable.jiraAwareFail(by.toString(), message, e);
552         }
553     }
554 
555     /**
556      * {@see WebDriverUtils#waitFor}.
557      *
558      * @param by to find
559      * @return WebElement found with given by
560      * @throws InterruptedException
561      */
562     protected WebElement jiraAwareWaitFor(By by) throws InterruptedException {
563         return jiraAwareWaitFor(by, this.getClass().toString());
564     }
565 
566     /**
567      * {@see WebDriverUtils#waitFor}.
568      *
569      * @param by to find
570      * @param message on failure
571      * @return WebElement found with given by
572      * @throws InterruptedException
573      */
574     protected WebElement jiraAwareWaitFor(By by, String message) throws InterruptedException {
575         try {
576             return WebDriverUtils.waitFor(getDriver(), WebDriverUtils.configuredImplicityWait(), by, message);
577         } catch (Throwable t) {
578             jiraAwareFail(by, message + " " + this.getClass().toString(), t);
579         }
580         return null; // required, but the jiraAwareFail will will end test before this statement is reached
581     }
582 
583     /**
584      * {@see WebDriverUtils#waitFor}.
585      *
586      * @param by to find
587      * @param message on failure
588      * @throws InterruptedException
589      */
590     protected void jiraAwareWaitFors(By by, String message) throws InterruptedException {
591         try {
592             WebDriverUtils.waitFors(getDriver(), WebDriverUtils.configuredImplicityWait(), by, message);
593         } catch (Throwable t) {
594             jiraAwareFail(by, message, t);
595         }
596     }
597 
598     /**
599      * {@see WebDriverUtils#waitFor}.
600      *
601      * @param by to find
602      * @param message on failure
603      * @param failable to fail if given by is not found
604      * @throws InterruptedException
605      */
606     protected void jiraAwareWaitFor(By by, String message, JiraAwareFailable failable) throws InterruptedException {
607         try {
608             WebDriverUtils.waitFor(getDriver(), WebDriverUtils.configuredImplicityWait(), by, message);
609         } catch (Throwable t) {
610             jiraAwareFail(by.toString(), message, t, failable);
611         }
612     }
613 
614     /**
615      * {@see WebDriverUtils#waitFor}.
616      *
617      * @param by to find
618      * @param seconds to wait
619      * @param message on failure
620      * @return WebElement found with given by
621      * @throws InterruptedException
622      */
623     protected WebElement jiraAwareWaitFor(By by, int seconds, String message) throws InterruptedException {
624         try {
625             return WebDriverUtils.waitFor(getDriver(), seconds, by, message);
626         } catch (Throwable t) {
627             jiraAwareFail(by, message, t);
628         }
629         return null; // required, but the jiraAwareFail will will end test before this statement is reached
630     }
631 
632     /**
633      * @return passed
634      */
635     public boolean isPassed() {
636         return passed;
637     }
638 
639     protected void selectOptionByName(String name, String optionValue) throws InterruptedException {
640         selectOption(By.name(name), optionValue);
641     }
642 
643     protected void selectOptionByXpath(String locator, String optionValue) throws InterruptedException {
644         selectOption(By.name(locator), optionValue);
645     }
646 
647     /**
648      * Uses Selenium's findElements method which does not throw a test exception if not found.
649      * @param by
650      * @param optionValue
651      * @throws InterruptedException
652      */
653     protected void selectOption(By by, String optionValue) throws InterruptedException {
654         WebElement select1 = findElement(by);
655         List<WebElement> options = select1.findElements(By.tagName("option"));
656 
657         String name = select1.getAttribute("name");
658 
659         if (options == null || options.size() == 0) {
660             jiraAwareFail("No options for select "
661                     + select1.toString()
662                     + " was looking for value "
663                     + optionValue
664                     + " using "
665                     + by.toString());
666         }
667 
668         for (WebElement option : options) {
669             if (option.getAttribute("value").equals(optionValue)) {
670                 WebDriverUtils.jGrowl(getDriver(), "Select " + option.getText(), false, "Select " + option.getText() + " from " + name);
671                 option.click();
672                 break;
673             }
674         }
675     }
676 
677     /**
678      * <p>
679      * Set the test state to passed, call jGrowl sticky with success, required to be called at the conclusion of a test
680      * for the saucelabs state of a test to be updated to passed.
681      * </p>
682      */
683     protected void passed() {
684         passed = true;
685         WebDriverUtils.jGrowl(getDriver(), "Success " + getClass().getSimpleName(), true, "Passed");
686     }
687 
688     protected WebElement waitAndType(By by, String text, String message) throws InterruptedException {
689         try {
690             jiraAwareWaitFor(by, message);
691             WebElement element = findElement(by);
692             String name = element.getAttribute("name");
693             WebDriverUtils.jGrowl(getDriver(), "Type", false, "Type into " + name + " the text: " + text);
694             WebDriverUtils.highlightElement(getDriver(), element);
695             element.sendKeys(text);
696             return element;
697         } catch (Exception e) {
698             JiraAwareFailureUtils.failOnMatchedJira(by.toString(), message, this);
699             jiraAwareFail(e.getMessage()
700                     + " "
701                     + by.toString()
702                     + "  unable to type text '"
703                     + text
704                     + "'  "
705                     + message
706                     + " current url "
707                     + getDriver().getCurrentUrl()
708                     + "\n"
709                     + AutomatedFunctionalTestUtils.deLinespace(getDriver().getPageSource()));
710         }
711         return null;
712     }
713 }