Esempio n. 1
0
        public static void CheckFocusInBehaviourAndTime(string pathToDecryptedPacket, string tempFolder)
        {
            //Check count FocusIn event
            var          focusInStore  = new List <FocusInStruct>();
            const string nameTag       = "event-dump";
            const string nameBehaviour = "Behavior:FocusIn";
            var          content       = SystemSettings.GetContentOfXml(Path.Combine(tempFolder, NameOutPutFile));
            var          listTags      = content.GetElementsByTagName(nameTag);

            foreach (XmlElement tag in listTags)
            {
                if (tag.GetAttribute("category") == nameBehaviour)
                {
                    var tempStore = new FocusInStruct();
                    tempStore.TimeStamp = tag.GetAttribute("time");
                    if (tag.FirstChild.Attributes != null)
                    {
                        var appId = tag.FirstChild.Attributes[1].Value;
                        tempStore.ApplicationId = appId;
                    }
                    focusInStore.Add(tempStore);
                }
            }

            var countFocusIn = 0;

            foreach (var eventFocusIn in focusInStore)
            {
                if (eventFocusIn.ApplicationId.ToLower().Contains((@"Enkata Technologies Inc\Activity Tracker\OS Runtime\Enkata.Analytics.VideoRecordingHost.exe").ToLower()) | eventFocusIn.ApplicationId.ToLower().Contains((@"Calc.exe").ToLower()))
                {
                    eventFocusIn.TimeStamp.Contains(AT.GetDate());
                    countFocusIn = countFocusIn + 1;
                }
            }
            if (Program.ScreenRecording == "ON")
            {
                Assert.IsTrue(countFocusIn >= 2);
            }
            else
            {
                Assert.IsTrue(countFocusIn >= 1);
            }
        }
Esempio n. 2
0
        public static List <FocusInStruct> GetAllFocusInBehaviour(string pathToDecryptedPacket)
        {
            var          focusInStore  = new List <FocusInStruct>();
            const string nameTag       = "event-dump";
            const string nameBehaviour = "Behavior:FocusIn";
            var          content       = SystemSettings.GetContentOfXml(pathToDecryptedPacket);
            var          listTags      = content.GetElementsByTagName(nameTag);

            foreach (XmlElement tag in listTags)
            {
                var tempStore = new FocusInStruct();
                if (tag.GetAttribute("category") == nameBehaviour || tag.GetAttribute("category") == "CustomFocusIn")
                {
                    if (tag.FirstChild.Attributes != null)
                    {
                        var appId = tag.FirstChild.Attributes[1].Value;
                        tempStore.ApplicationId = appId;
                    }
                    focusInStore.Add(tempStore);
                }
            }
            return(focusInStore);
        }