Пример #1
0
 private static ObjectPropertyForElement setObjectProperties(MSHTML.IHTMLElement element, ObjectPropertyForElement data)
 {
     Util.deghlightElement(previousElement);
     previousElement = element;
     Util.highlightElement(element);
     data.page       = new Page();
     data.page.title = getTitle();
     data.prop       = CognizantITSObject.getProperties(element);
     data.frame      = getFrameData(element);
     return(data);
 }
Пример #2
0
 internal static void sendSpiedObjectToSave(MSHTML.IHTMLElement element)
 {
     try
     {
         SpySaveObject sObject = new SpySaveObject();
         setObjectProperties(element, sObject);
         sObject.objectname = CognizantITSObject.getObjectName(element, sObject.prop);
         WebSocketClient.send(sObject.ToString());
     }
     catch (Exception ex)
     {
         Util.showNotification(ex.ToString());
     }
 }
Пример #3
0
 internal static void sendRecordedObject(MSHTML.IHTMLElement element, String method)
 {
     try
     {
         RecordObjectElement rObject = new RecordObjectElement();
         rObject.method = method;
         setObjectProperties(element, rObject);
         rObject.objectname = CognizantITSObject.getObjectName(element, rObject.prop);
         WebSocketClient.send(rObject.ToString());
     }
     catch (Exception ex)
     {
         Util.showNotification(ex.ToString());
     }
 }
        internal static void contextClick(String menuItem)
        {
            if (menuItem.Contains("Text"))
            {
                CognizantITS.sendRecordedObject(contextElement, menuItem, "@" + CognizantITSObject.getTextORValue(contextElement));
            }
            else if (menuItem.Contains("Title"))
            {
                CognizantITS.sendRecordedObject(menuItem, "@" + Helper.getHelper().getTitle());
            }
            else if (menuItem.Contains("Url"))
            {
                CognizantITS.sendRecordedObject(menuItem, "@" + Helper.getHelper().getURL());
            }
            else if (menuItem.ToLower().Equals("open"))
            {
                CognizantITS.sendRecordedObject("Open", "@" + Helper.getHelper().getURL());
            }
            else if (menuItem.Equals("capturePageTimings"))
            {
                CognizantITS.sendRecordedObject(menuItem, "@" + Helper.getHelper().getTitle().Split(' ')[0]);
            }
            else if (menuItem.Contains("add"))
            {
                switch (menuItem)
                {
                case "addElementWithInput":
                    CognizantITS.sendRecordedObject(contextElement, null, "@" + CognizantITSObject.getTextORValue(contextElement));
                    break;

                case "addElement":
                    CognizantITS.sendRecordedObject(contextElement, null);
                    break;

                case "addBrowserWithInput":
                    CognizantITS.sendRecordedObject("", "@" + CognizantITSObject.getTextORValue(contextElement));
                    break;
                }
            }
            else if (menuItem.Contains("Element"))
            {
                CognizantITS.sendRecordedObject(contextElement, menuItem);
            }
            else
            {
                CognizantITS.sendRecordedObject(menuItem);
            }
        }