private void PerformAssessment(KidneyRARPage kr, KidneyRARAnswer answer, CheckpointResultGroup ckpg) { try { //section 1 kr.Question_KdnyPersHist_Answer(answer.KdnyPersHist_Enum); kr.Question_KdnySex_Answer(answer.KdnySex_Enum); kr.Question_kdnyAge_Answer(answer.KdnAge_int); kr.Question_KdnyFamHist_Answer(answer.KdnyFamHist_Enum); if (answer.KdnyHeight_Imperial_bool) { kr.Question_KdnyHeight(ImperialOrMetric.Imperial, answer.KdnyHeight_V1, answer.KdnyHeight_V2); } else if (answer.KdnyHeight_Metric_bool) { kr.Question_KdnyHeight(ImperialOrMetric.Metric, answer.KdnyHeight_V1); } if (answer.KdnyWeightLB_int != 0) { kr.Question_KdnyWeight(answer.KdnyWeightLB_int, WeightUnit.lb); } else if (answer.KdnyWeightKG_int != 0) { kr.Question_KdnyWeight(answer.KdnyWeightKG_int, WeightUnit.kg); } //verify Next button enabled AddCheckingResult(ckpg, "1", kr.IsNextButtonEnabled(), "section 1 next button not enabled"); AddCheckingResult(ckpg, "2", !kr.IsPreviousButtonEnabled(), "section 1 previous button not disable"); kr.TakeScreenshot($"KidneyRARBatch_{answer.Seq}_Section1"); kr.ClickNext(false, ""); Thread.Sleep(100); //section 2 kr.Question_KdnyHT_Answer(answer.KdnyHT_Enum); AddCheckingResult(ckpg, "3", kr.IsNextButtonEnabled(), "section 2 next button not enabled"); AddCheckingResult(ckpg, "4", kr.IsPreviousButtonEnabled(), "section 2 previous button not enable"); kr.TakeScreenshot($"KidneyRARBatch_{answer.Seq}_Section2"); kr.ClickNext(false, ""); //section 3 kr.Question_KdnySmoking_Answer(answer.KdnySmoking_Enum); if (answer.KdnySmoking_Enum == SmokingHistory.Yes) { kr.Question_KdnySmokingQt_Answer(answer.KdnySmokeQt_Enum); } AddCheckingResult(ckpg, "5", kr.IsNextButtonEnabled(), "section 3 next button not enabled"); AddCheckingResult(ckpg, "6", kr.IsPreviousButtonEnabled(), "section 3 previous button not enable"); kr.TakeScreenshot($"KidneyRARBatch_{answer.Seq}_Section3"); kr.ClickGetResult(); //kr.WaitElementAvailable("RAR_SavePDF"); kr.TakeScreenshot($"KidneyRARBatch_{answer.Seq}_Report"); AddCheckingResult(ckpg, "7", kr.IsAtRiskLevel(answer.Result), "Risk level is not correct"); } catch (Exception ex) { kr.TakeScreenshot($"KidneyRARBatch_{answer.Seq}_OnPageError"); AddCheckingResult(ckpg, "0000", false, ex.ToString()); } }