예제 #1
0
 public void assigningVehcleToExistingAccountInit()
 {
     System.Threading.Thread.Sleep(1000);
     borrarArchivosTemp("E:\\workspace\\Maria_Repository\\assigningVehicleToAccount\\attachments\\");
     assigningVehcleToExistingAccount();
     System.Threading.Thread.Sleep(1000);
     CAC_accountCreationWithVehicle.accountCreationWithVehicle();
     System.Threading.Thread.Sleep(200);
     if (accountClosed)
     {
         Console.WriteLine("No se puede asignar un Vehículo a la cuenta " + accountNumbr.Substring(7, 16) + " porque está cerrada");
         Assert.Fail("No se puede asignar un Vehículo a la cuenta " + accountNumbr.Substring(7, 16) + " porque está cerrada");
     }
     System.Threading.Thread.Sleep(1000);
     Console.WriteLine("Se le asignado el vehículo con la matrícula " + matriNu + " a la cuenta " + accountNumbr.Substring(7, 16) + " correctamente");
     Console.WriteLine("Se ha probado en la versión del CAC BO: " + BOVersion.Substring(1, 16) + " y CAC Manager: " + BOVersion.Substring(17));
 }
        public static void vehicleCreation()
        {
            Actions action = new Actions(driver);

            System.Threading.Thread.Sleep(1000);
            action.ClickAndHold(driver.FindElement(By.LinkText("Gestión de cuentas"))).Build().Perform();
            System.Threading.Thread.Sleep(1000);
            driver.FindElement(By.LinkText("Seleccionar cuenta")).Click();
            System.Threading.Thread.Sleep(2000);
            elementClick("ctl00_ButtonsZone_BtnSearch_IB_Label");
            IWebElement         tableres = driver.FindElement(By.Id("ctl00_ContentZone_TblResults"));
            IList <IWebElement> table    = tableres.FindElements(By.TagName("tr"));
            int selectAccount            = ranNumbr(2, table.Count);

            takeScreenShot("E:\\Selenium\\", "accountSearchPage", timet + ".jpeg");
            takeScreenShot("E:\\workspace\\Maria_Repository\\ReloadCreation\\attachments\\", "accountSearchPage", ".jpeg");
            driver.FindElement(By.XPath("//*[@id='ctl00_ContentZone_TblResults']/tbody/tr[" + selectAccount + "]/td[1]/a")).Click();
            System.Threading.Thread.Sleep(1000);
            accountNumbr = driver.FindElement(By.Id("ctl00_SectionZone_LblTitle")).Text;
            takeScreenShot("E:\\Selenium\\", "accountPage", timet + ".jpeg");
            takeScreenShot("E:\\workspace\\Maria_Repository\\ReloadCreation\\attachments\\", "accountPage", ".jpeg");
            System.Threading.Thread.Sleep(1000);
            if (driver.PageSource.Contains("CUENTA CERRADA"))
            {
                accountClosed = true;
                return;
            }
            elementClick("ctl00_ButtonsZone_BtnValidate_IB_Label");
            System.Threading.Thread.Sleep(500);
            elementClick("ctl00_ContentZone_BtnFees"); //botón Recargos;
            System.Threading.Thread.Sleep(1000);
            takeScreenShot("E:\\Selenium\\", "ReloadPage", timet + ".jpeg");
            takeScreenShot("E:\\workspace\\Maria_Repository\\ReloadCreation\\attachments\\", "ReloadPage", ".jpeg");
            System.Threading.Thread.Sleep(1000);
            new SelectElement(driver.FindElement(By.Id("ctl00_ContentZone_list_all_fees"))).SelectByText(applicationTypeText);
            System.Threading.Thread.Sleep(1000);
            elementClick("ctl00_ContentZone_btn_add");
            System.Threading.Thread.Sleep(500);
            elementClick("ctl00_ButtonsZone_BtnSubmit_IB_Label");
            System.Threading.Thread.Sleep(2000);
            CAC_accountCreationWithVehicle.accountCreationWithVehicle();
            reloadConfirmation();
        }
예제 #3
0
 public void accountCreationAssigningTagInit()
 {
     System.Threading.Thread.Sleep(1000);
     borrarArchivosTemp("E:\\workspace\\Maria_Repository\\accountCreationAssigningTag\\attachments\\");
     CAC_accountCreationOnly.accountCreation();
     System.Threading.Thread.Sleep(2000);
     elementClick("ctl00_ButtonsZone_BtnValidate_IB_Label");
     System.Threading.Thread.Sleep(1000);
     CAC_accountCreationWithVehicle.accountCreationWithVehicle();
     System.Threading.Thread.Sleep(500);
     accountCreationAssigningTag();
     System.Threading.Thread.Sleep(1000);
     if (errorTagAssignment)
     {
         Console.WriteLine("ERROR AL ASIGNAR TAG a la cuenta: " + accountNumbr.Substring(7, 9) + ", " + confirmationMessage);
         Assert.Fail("Tag Invalido: No se puede asignar un Tag al Vehiculo " + matriNu + " de la cuenta " + accountNumbr.Substring(7, 9));
         return;
     }
     Console.WriteLine("Se ha creado la cuenta: " + accountNumbr.Substring(7, 9) + " con un Vehiculo con la matricula " + matriNu + " y el tag asignado No.: " + tagIdNmbr);
     System.Threading.Thread.Sleep(3000);
     Console.WriteLine("Se ha probado en la versión del CAC BO: " + BOVersion.Substring(1, 16) + " y CAC Manager: " + BOVersion.Substring(17));
 }
        public static void tagMissed()
        {
            Actions action = new Actions(driver);

            System.Threading.Thread.Sleep(1000);
            action.ClickAndHold(driver.FindElement(By.LinkText("Gestión de cuentas"))).Build().Perform();
            System.Threading.Thread.Sleep(1000);
            driver.FindElement(By.LinkText("Seleccionar cuenta")).Click();
            System.Threading.Thread.Sleep(2000);
            elementClick("ctl00_ButtonsZone_BtnSearch_IB_Label");
            IWebElement         tableres = driver.FindElement(By.Id("ctl00_ContentZone_TblResults"));
            IList <IWebElement> table    = tableres.FindElements(By.TagName("tr"));
            int selectAccount            = ranNumbr(2, table.Count);

            takeScreenShot("E:\\Selenium\\", "accountSearchPage", timet + ".jpEg");
            takeScreenShot("E:\\workspace\\Maria_Repository\\ReloadCreation\\attachments\\", "accountSearchPage", ".jpEg");
            driver.FindElement(By.XPath("//*[@id='ctl00_ContentZone_TblResults']/tbody/tr[" + selectAccount + "]/td[1]/a")).Click();
            System.Threading.Thread.Sleep(1000);
            accountNumbr = driver.FindElement(By.Id("ctl00_SectionZone_LblTitle")).Text;
            takeScreenShot("E:\\Selenium\\", "accountPage", timet + ".jpeg");
            takeScreenShot("E:\\workspace\\Maria_Repository\\ReloadCreation\\attachments\\", "accountPage", ".jpeg");
            System.Threading.Thread.Sleep(1000);
            if (driver.PageSource.Contains("CUENTA CERRADA"))
            {
                accountClosed = true;
                return;
            }
            elementClick("ctl00_ButtonsZone_BtnValidate_IB_Label");
            System.Threading.Thread.Sleep(500);
            elementClick("ctl00_ContentZone_BtnFees"); //botón Recargos;
            System.Threading.Thread.Sleep(1000);
            takeScreenShot("E:\\Selenium\\", "ReloadPage", timet + ".jpeg");
            takeScreenShot("E:\\workspace\\Maria_Repository\\ReloadCreation\\attachments\\", "ReloadPage", ".jpeg");
            System.Threading.Thread.Sleep(1000);
            new SelectElement(driver.FindElement(By.Id("ctl00_ContentZone_list_all_fees"))).SelectByText(applicationTypeText);
            System.Threading.Thread.Sleep(1000);
            elementClick("ctl00_ContentZone_btn_add");
            System.Threading.Thread.Sleep(500);
            elementClick("ctl00_ButtonsZone_BtnSubmit_IB_Label");
            System.Threading.Thread.Sleep(2000);
            string numberVehicles = driver.FindElement(By.Id("ctl00_ContentZone_lbl_vehicles")).Text;
            int    NumbVeh        = Int32.Parse(numberVehicles);

            if (NumbVeh == 0)
            {
                CAC_accountCreationWithVehicle.accountCreationWithVehicle();
            }
            else
            {
                driver.FindElement(By.Id("ctl00_ButtonsZone_BtnValidate_IB_Label")).Click();
                System.Threading.Thread.Sleep(1500);
            }
            elementClick("ctl00_ContentZone_BtnTags");
            takeScreenShot("E:\\Selenium\\", "tagAssignmentMainPage", timet + ".jpEg");
            takeScreenShot("E:\\workspace\\Maria_Repository\\ReloadCreation\\attachments\\", "tagAssignmentMainPage", ".jpeg");
            System.Threading.Thread.Sleep(1000);
            elementClick("ctl00_ContentZone_chk_0");
            string tagid = driver.FindElement(By.XPath("//*[@id='ctl00_ContentZone_m_table_members']/tbody/tr[2]/td[6]")).Text;

            if (tagid.Equals(""))
            {
                elementClick("ctl00_ContentZone_btn_token_assignment");
                System.Threading.Thread.Sleep(500);
                driver.FindElement(By.Id("ctl00_ContentZone_txt_pan_token_txt_token_box_data")).SendKeys(ranNumbr(1, 99999) + "");
                System.Threading.Thread.Sleep(500);
                elementClick("ctl00_ContentZone_btn_init_tag");
                System.Threading.Thread.Sleep(500);
                elementClick("ctl00_ContentZone_chk_0");
            }
            elementClick("ctl00_ContentZone_btn_token_stolen");
            System.Threading.Thread.Sleep(1000);
            elementClick("ctl00_ContentZone_btn_stolen");
            System.Threading.Thread.Sleep(1500);
            reloadConfirmation();
        }