Changeset 1247


Ignore:
Timestamp:
07/01/13 17:34:55 (11 years ago)
Author:
pharms
Message:
  • extended, improved and corrected HTML logging for HTML 5
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-htmlmonitor/src/main/js/autoquest-htmlmonitor.js

    r1244 r1247  
    9292    //{ "tag": "details", "actions": [  ] }, 
    9393    { "tag": "dfn", "actions": [ "onclick" ] }, 
    94     { "tag": "div", "actions": [ "onclick" ] }, 
     94    { "tag": "div", "actions": [ "onclick", 
     95                                 "onscroll" ] }, 
    9596    //{ "tag": "dl", "actions": [  ] }, 
    9697    { "tag": "dt", "actions": [ "onclick" ] }, 
     
    116117    { "tag": "img", "actions": [ "onabort", 
    117118                                 "onclick" ] }, 
    118     { "tag": "input_text", "actions": [ "onchange", 
     119    { "tag": "input_button", "actions": [ "onclick", 
     120                                          "onfocus" ] }, 
     121    { "tag": "input_checkbox", "actions": [ "onchange", 
     122                                            "onclick", 
     123                                            "onfocus" ] }, 
     124    { "tag": "input_color", "actions": [ "onchange", 
     125                                         "onclick", 
     126                                         "onfocus", 
     127                                         "onselect" ] }, 
     128    { "tag": "input_date", "actions": [ "onchange", 
     129                                        "onclick", 
    119130                                        "onfocus", 
    120131                                        "onselect" ] }, 
     132    { "tag": "input_datetime", "actions": [ "onchange", 
     133                                            "onclick", 
     134                                            "onfocus", 
     135                                            "onselect" ] }, 
     136    { "tag": "input_datetime-local", "actions": [ "onchange", 
     137                                                  "onclick", 
     138                                                  "onfocus", 
     139                                                  "onselect" ] }, 
     140    { "tag": "input_email", "actions": [ "onchange", 
     141                                         "onclick", 
     142                                         "onfocus", 
     143                                         "onselect" ] }, 
     144    { "tag": "input_file", "actions": [ "onchange", 
     145                                        "onclick", 
     146                                        "onfocus", 
     147                                        "onselect" ] }, 
     148    { "tag": "input_image", "actions": [ "onclick", 
     149                                         "onfocus" ] }, 
     150    { "tag": "input_month", "actions": [ "onchange", 
     151                                         "onclick", 
     152                                         "onfocus", 
     153                                         "onselect" ] }, 
     154    { "tag": "input_number", "actions": [ "onchange", 
     155                                          "onclick", 
     156                                          "onfocus", 
     157                                          "onselect" ] }, 
    121158    { "tag": "input_password", "actions": [ "onchange", 
    122                                             "onfocus" ] }, 
    123     { "tag": "input_checkbox", "actions": [ "onchange", 
    124159                                            "onclick", 
    125160                                            "onfocus" ] }, 
     
    127162                                         "onclick", 
    128163                                         "onfocus" ] }, 
     164    { "tag": "input_range", "actions": [ "onchange", 
     165                                         "onclick", 
     166                                         "onfocus", 
     167                                         "onselect" ] }, 
     168    { "tag": "input_reset", "actions": [ "onclick", 
     169                                         "onfocus" ] }, 
     170    { "tag": "input_search", "actions": [ "onchange", 
     171                                          "onclick", 
     172                                          "onfocus", 
     173                                          "onselect" ] }, 
    129174    { "tag": "input_submit", "actions": [ "onclick", 
    130175                                          "onfocus" ] }, 
    131     { "tag": "input_reset", "actions": [ "onclick", 
    132                                          "onfocus" ] }, 
    133     { "tag": "input_file", "actions": [ "onclick", 
    134                                         "onfocus" ] }, 
    135     { "tag": "input_image", "actions": [ "onclick", 
    136                                          "onfocus" ] }, 
    137     { "tag": "input_button", "actions": [ "onclick", 
    138                                           "onfocus" ] }, 
     176    { "tag": "input_tel", "actions": [ "onchange", 
     177                                       "onclick", 
     178                                       "onfocus", 
     179                                       "onselect" ] }, 
     180    { "tag": "input_text", "actions": [ "onchange", 
     181                                        "onclick", 
     182                                        "onfocus", 
     183                                        "onselect" ] }, 
     184    { "tag": "input_time", "actions": [ "onchange", 
     185                                        "onclick", 
     186                                        "onfocus", 
     187                                        "onselect" ] }, 
     188    { "tag": "input_url", "actions": [ "onchange", 
     189                                       "onclick", 
     190                                       "onfocus", 
     191                                       "onselect" ] }, 
     192    { "tag": "input_week", "actions": [ "onchange", 
     193                                        "onclick", 
     194                                        "onfocus", 
     195                                        "onselect" ] }, 
    139196    { "tag": "input", "actions": [ "onchange", 
     197                                   "onclick", 
    140198                                   "onfocus" ] }, 
    141199    { "tag": "ins", "actions": [ "onclick" ] }, 
     
    437495function registerEventHandler(node, nodePath, action) { 
    438496    var parameters = { action : action, path : nodePath}; 
     497     
     498    if ((action === "onscroll") && (node === document.body)) { 
     499        node = window; 
     500    } 
     501     
    439502    if (jQuery(node).on) { 
    440503        jQuery(node).on(action.substring(2), parameters, handleJQueryEvent); 
     
    535598    eventType = eventName.toLowerCase(); 
    536599 
     600    // check, if the preceeding event is more concrete, i.e. the new event to be handled is only 
     601    // a propagation through the DOM and needs, therefore, not be handled 
    537602    if (autoquestRecordedEvents.length > 0) { 
    538603        eventObj = autoquestRecordedEvents[autoquestRecordedEvents.length - 1]; 
    539604 
    540         // check if an event showed up several times either for the same or for a parent GUI element 
    541605        if ((eventObj.type === eventName) && (eventObj.nodePath.indexOf(nodePath) === 0)) { 
    542606            // the event is of the same type. 
    543607            if (eventObj.nodePath.length > nodePath.length) { 
    544                 // the same event showed up for the parent GUI element. This must not be handled. 
    545                 // So ignore it 
     608                // the new event is the same event as the previous one, but fired for the parent 
     609                // GUI element of the previous event. This must not be handled. So ignore it 
    546610                log("discarding event " + eventName + " on " + node + 
    547611                    " as it is already handled by a child"); 
     
    561625     
    562626    if (!eventObj) { 
    563         // create a new event and add it to the list 
     627        // we can not reuse the previous event. So create a new event and add it to the list 
    564628        eventObj = new Event(eventType, nodePath); 
    565629        log("storing event " + eventName); 
     
    574638    tagName = getTagName(node); 
    575639     
     640    // ensure to not monitor details for GUI elements marked as unmonitored 
    576641    if (node.getAttribute && node.getAttribute("class")) { 
    577642        unmonitored = node.getAttribute("class").indexOf("autoquest-unmonitored") >= 0; 
     
    582647     
    583648    if (!unmonitored && ("input_password" !== tagName)) { 
     649        // add further parameters for GUI elements which are monitored and which are no password 
     650        // fields 
    584651        if ((eventType === "onkeypress") || 
    585652            (eventType === "onkeydown") || 
     
    605672    } 
    606673 
     674    // finally send the recorded data 
    607675    if (autoquestRecordedEvents.length >= autoquestPackageSize) { 
    608676        log("initiating sending events"); 
  • trunk/autoquest-plugin-html/data/guimappings/guimapping-html.txt

    r1223 r1247  
    5959input_button = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLButton 
    6060input_checkbox = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLCheckBox 
    61 input_file = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLButton 
     61input_file = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLTextField 
    6262input_image = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLButton 
    6363input_number = de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLComboBox 
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/AbstractDefaultLogParser.java

    r1234 r1247  
    210210                { 
    211211                    // this only denotes, that the final session tag is missing, because the 
    212                     // file wasn't completed. Ignore this. 
     212                    // file wasn't completed. Ignore this but complete the session 
     213                    eventBuffer.add(new BufferEntry("sessionSwitch", null)); 
     214                    processEvents(); 
    213215                } 
    214216                else { 
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore/HTMLEventTypeFactory.java

    r1239 r1247  
    2828import de.ugoe.cs.autoquest.eventcore.gui.ValueSelection; 
    2929import de.ugoe.cs.autoquest.eventcore.guimodel.ICheckBox; 
     30import de.ugoe.cs.autoquest.eventcore.guimodel.IComboBox; 
    3031import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement; 
    3132import de.ugoe.cs.autoquest.eventcore.guimodel.IRadioButton; 
     
    101102                result = new TextInput(value, null); 
    102103            } 
    103             else if ((guiElement instanceof IRadioButton) || (guiElement instanceof ICheckBox)) { 
     104            else if ((guiElement instanceof IRadioButton) || (guiElement instanceof ICheckBox) || 
     105                     (guiElement instanceof IComboBox)) 
     106            { 
    104107                result = new ValueSelection<String>(value); 
    105108            } 
Note: See TracChangeset for help on using the changeset viewer.