Ejemplo n.º 1
0
        public void ModuleLessonSelection(string moduleName, int lessonNumber)
        {
            RepoItemInfo rInfo             = null;
            string       selectedComboText = string.Empty;

            //var comboText;

            if (moduleName.Equals("Module1", StringComparison.CurrentCultureIgnoreCase))
            {
                rInfo = repos.STAGINGSigniaTeleCarePortal.ManageLessons.Module1LessonsInfo;
            }
            else if (moduleName.Equals("Module2", StringComparison.CurrentCultureIgnoreCase))
            {
                rInfo = repos.STAGINGSigniaTeleCarePortal.ManageLessons.Module2LessonsInfo;
            }
            else if (moduleName.Equals("Module3", StringComparison.CurrentCultureIgnoreCase))
            {
                rInfo = repos.STAGINGSigniaTeleCarePortal.ManageLessons.Module3LessonsInfo;
            }
            else if (moduleName.Equals("Module4", StringComparison.CurrentCultureIgnoreCase))
            {
                rInfo = repos.STAGINGSigniaTeleCarePortal.ManageLessons.Module4LessonsInfo;
            }

            IList <DivTag> moduleLessonsList = rInfo.CreateAdapters <Ranorex.DivTag>();
//			var comboText1=moduleLessonsList[lessonNumber-1].FindDescendants<OptionTag>().FirstOrDefault(x=>x.Selected);
//
//			selectedComboText=comboText.InnerText;

            //comboText.
            var comboText = moduleLessonsList[lessonNumber - 1].FindDescendants <OptionTag>().Select(x => new
            {
                selected  = x.Selected,
                innerText = x.InnerText
            }
                                                                                                     ).ToList();

            selectedComboText = comboText.FirstOrDefault(x => x.selected).innerText;


            ////			var test = dropDwn.FindDescendants<SpanTag>().Select(y=> new
            ////			                                                     {
            ////			                                                        innertext = y.InnerText,
            ////			                                                        elem = y
            ////			                                                     }
            ////			                                                    );


//			var optionTags=moduleLessonsList[lessonNumber-1].FindDescendants<OptionTag>();
//
//			foreach(OptionTag ot in optionTags)
//			{
//				if(ot.Selected)
//				{
//					selectedComboText = ot.InnerText;
//				}
//			}
            Ranorex.Report.Info(selectedComboText);
        }
Ejemplo n.º 2
0
        public void SelectModuleLesson(string moduleName, int lessonNumber, string lessonName)
        {
            RepoItemInfo rInfo             = null;
            string       selectedComboText = string.Empty;

            if (moduleName.Equals("Module1", StringComparison.CurrentCultureIgnoreCase))
            {
                rInfo = repos.STAGINGSigniaTeleCarePortal.ManageLessons.Module1LessonsInfo;
            }
            else if (moduleName.Equals("Module2", StringComparison.CurrentCultureIgnoreCase))
            {
                rInfo = repos.STAGINGSigniaTeleCarePortal.ManageLessons.Module2LessonsInfo;
            }
            else if (moduleName.Equals("Module3", StringComparison.CurrentCultureIgnoreCase))
            {
                rInfo = repos.STAGINGSigniaTeleCarePortal.ManageLessons.Module3LessonsInfo;
            }
            else if (moduleName.Equals("Module4", StringComparison.CurrentCultureIgnoreCase))
            {
                rInfo = repos.STAGINGSigniaTeleCarePortal.ManageLessons.Module4LessonsInfo;
            }

            IList <DivTag> moduleLessonsList = rInfo.CreateAdapters <Ranorex.DivTag>();

            moduleLessonsList.ElementAt(lessonNumber - 1).FindDescendants <OptionTag>().
            FirstOrDefault(x => x.InnerText.Trim().
                           Equals(lessonName, StringComparison.CurrentCultureIgnoreCase)).Select();

//			var optionTags=moduleLessonsList[lessonNumber-1].FindDescendants<OptionTag>();
//
//			foreach(OptionTag ot in optionTags)
//			{
//				if(ot.InnerText.Equals(lessonName))
//				{
//					ot.Select();
//				}
//			}
            //Ranorex.Report.Info(selectedComboText);
        }