View Javadoc

1   /*
2    * Copyright 2008 united internet (unitedinternet.com) ralf2511
3    *
4    *  Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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   */
17  package com.unitedinternet.portal.selenium.utils.logging;
18  
19  /**
20   * Notification Interface for loggingselenium caller. If you are interested
21   * in notifications then instantiate the interface and set the instance with
22   * the setCallbackNotifier-function.
23   *
24   * @author ralf2511
25   */
26  public interface LoggingNotifier {
27      /**
28       * Call back function to inform the calling application in case of error.
29       * Then you can do additional logging or ring a bell or what ever you want.
30       *
31       * @param instance Instance of the calling application
32       * @param commandName The selenium command name
33       * @param args The Arguments of the selenium command
34       * @param result The selenium Answer
35       * @param exception The problem
36       * @param cmdStartMillis Start time
37       * @return True (default behavior): make screen shot after this call
38       *   False: do not make a screen shot
39       */
40      Boolean errorLogging(Object instance, String commandName, String[] args, String result, Throwable exception,
41              long cmdStartMillis);
42  
43      /**
44       * Call back function to inform the calling application in case of error.
45       * Then do can do your make your own screen shot in case of remote connection.
46       *
47       * @param instance Instance of the calling application
48       * @param pathFile Full path and file to the resource
49       * @return True (default behavior): make internal screen shot
50       *   False: do not make a (additionally?!) screen shot
51       */
52      Boolean makeScreenshot(Object instance, String pathFile);
53  
54  }