private void PracticeExamBtn_Click(object sender, EventArgs e) { stopButton.Enabled = true; ButtonState(false); HTOAuto.DoPracticeExam(HTO.HTOAuto.Exam.Tech); ButtonState(true); stopButton.Enabled = false; }
public static void DoPracticeExam(Exam exam) { bool status = ClickOnButton(HTOMenuButtons.MainMenu); status = ClickOnButton(HTOMenuButtons.PracticeExam); if (status == false) { return; } var checkedButton = mf.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked); var selectedPool = checkedButton.Text; var totalExamQuestions = 35; if (selectedPool == "General") { driver.FindElementById("generatenewpracticeexamtopicT315").Click(); } else if (selectedPool == "Extra") { driver.FindElementById("generatenewpracticeexamtopicT416").Click(); totalExamQuestions = 50; } else { driver.FindElementById("generatenewpracticeexamtopicT218").Click(); } status = ClickOnButton("generatenewpracticeexambutton"); if (status == false) { return; } for (int i = 0; i < totalExamQuestions; i++) { status = HTOAuto.AnswerCurrentQuestion(); if (status == false) { Console.WriteLine("Unable to answer this question. Exiting exam early"); // exitpracticeexamearlybutton ClickOnButton("exitpracticeexamearlybutton"); break; } else { // IncreamentQuestionCounter(); } // RandomSleep(1000, 5000); } }
private void BtnTest_Click(object sender, EventArgs e) { Console.WriteLine("Name: " + this.Name); Console.WriteLine("X: " + this.Location.X); Console.WriteLine("Y: " + this.Location.Y); var pt = new Point(2000, 0); this.Location = pt; this.Refresh(); HTOAuto.LoginTest(); }
static void Main() { //Random rnd = new Random(DateTime.Now.Millisecond); //for (int i = 0; i < 10; i++) //{ // var sleepTime = rnd.Next(500, 5000); // Console.WriteLine("Sleeping for " + sleepTime + " ms"); // System.Threading.Thread.Sleep(sleepTime); //} //Application.SetCompatibleTextRenderingDefault(false); //mf = new MainForm(); //Application.Run(mf); HTOAuto.Initialization(); }
private void answerButton_Click(object sender, EventArgs e) { stopButton.Enabled = true; ButtonState(false); bool status = false; // TODO: This section should be a function { try { status = HTO.HTOAuto.AnswerCurrentQuestion(); if (status == true) { Console.WriteLine("Successfully answered question"); } } catch (Exception err) { Console.WriteLine("Exception Thrown while answering question. Error: " + err.Message); status = false; } // Unable to answer question, so try clicking on alternate buttons. if (status == false) { // try clicking OK button var okbuttonStatus = HTOAuto.clickOnElement("okbutton"); // Now try answering question again. if (okbuttonStatus == true) { status = HTO.HTOAuto.AnswerCurrentQuestion(); } // If there is no OK button, try Skip button. if (okbuttonStatus == false) { var skipButtonStatus = HTOAuto.ClickOnSkipButton(); } } } ButtonState(true); stopButton.Enabled = false; }
private void LoginBtn_Click(object sender, EventArgs e) { Console.WriteLine("Name: " + this.Name); Console.WriteLine("X: " + this.Location.X); Console.WriteLine("Y: " + this.Location.Y); var pt = new Point(2000, 0); this.Location = pt; this.Refresh(); stopButton.Enabled = true; ButtonState(false); HTOAuto.StartAutomation(); ButtonState(true); stopButton.Enabled = false; techPool.Enabled = true; generalPoool.Enabled = true; extraPool.Enabled = true; //this.Refresh(); }
private void Testbtn_Click(object sender, EventArgs e) { stopButton.Enabled = true; ButtonState(false); HTOAuto.ClickOnButton(HTOMenuButtons.MainMenu); System.Threading.Thread.Sleep(3000); HTOAuto.ClickOnButton(HTOMenuButtons.ChooseTopics); System.Threading.Thread.Sleep(3000); HTOAuto.ClickOnButton(HTOMenuButtons.Study); System.Threading.Thread.Sleep(3000); HTOAuto.ClickOnButton(HTOMenuButtons.ViewCourses); System.Threading.Thread.Sleep(3000); HTOAuto.ClickOnButton(HTOMenuButtons.PracticeExam); System.Threading.Thread.Sleep(3000); HTOAuto.ClickOnButton(HTOMenuButtons.MyAccount); System.Threading.Thread.Sleep(3000); HTOAuto.ClickOnButton(HTOMenuButtons.TopScores); System.Threading.Thread.Sleep(3000); // HTOAuto.ClickOnButton(HTOMenuButtons.StudyHistory); ButtonState(true); stopButton.Enabled = false; }