Esempio n. 1
0
        public ScenarioResult Select_Item_By_Keyboard(TParams p)
        {
            var sr = new ScenarioResult();

            _comboBox.Items.Clear();

            var numKeyPresses = p.ru.GetRange(1, _comboBox.Items.Count);
            var szItems       = CreateItems(NumItems);

            sr.IncCounters(AddItems(p, _comboBox, szItems, NumItems), "failed to add items to ObjectCollection", p.log);

            //scroll items using the down arrow key
            sr.IncCounters(SelectItemWithKeyboard(_comboBox, "{DOWN}", numKeyPresses), "failed to select items with the DOWN arrow key", p.log);
            sr.IncCounters(_numEvents == numKeyPresses, "failed to handle SelectedIndexChanged event properly going down; nEvents was " + _numEvents + ", nKeys was " + numKeyPresses, p.log);

            //scroll items using the up arrow key
            sr.IncCounters(SelectItemWithKeyboard(_comboBox, "{UP}", numKeyPresses), "failed to select items with the UP arrow key", p.log);
            sr.IncCounters(_numEvents == numKeyPresses, "failed to handle SelectedIndexChanged event properly going up; nEvents was " + _numEvents + ", nKeys was " + numKeyPresses, p.log);

            return(sr);
        }