Ejemplo n.º 1
0
 public void SearchandReturn(string depart, int value1)
 {
     Flying_from_txtbox.Clear();
     TextboxHelper.ClearTextBody(Flying_from_txtbox);
     Flying_from_txtbox.SendKeys(depart);
     //          ComboboxHelper.SelectElement(Depart_date, value1);
     ComboboxHelper.SelectElement(Depart_date_cmb, value1);
 }
Ejemplo n.º 2
0
        public frmEmployee()
        {
            InitializeComponent();

            // Display data to cmbUserType
            ComboboxHelper.FillUserType(cmbUserType);

            // set value to datagridview
            dgvEmployee.DataSource = null;
            dgvEmployee.ClearSelection();
        }
Ejemplo n.º 3
0
        private void LoadTemplates()
        {
            List <TemplateModel> lstTemp          = _templateRepository.GetAll();
            List <ComboboxItem>  lstComboboxItems = new List <ComboboxItem>();

            foreach (var item in lstTemp)
            {
                lstComboboxItems.Add(new ComboboxItem()
                {
                    Id = item.Id, Text = item.Name
                });
            }
            ComboboxHelper.BindToCombobox(cbbLstTemplate.ComboBox, lstComboboxItems);
        }
Ejemplo n.º 4
0
        public void SearchandReturn(string depart, string value1)
        {
            TextboxHelper.ClearTextBody(Flying_from); ///>>>not clearing the text box
            ObjectRepository.Driver.FindElement(Flying_from).SendKeys(depart);
            ComboboxHelper.SelectElement(Depart_date, value1);

            //// SelectElement select = new SelectElement(Depart);
            ////select.SelectByIndex(2);
            ////select.SelectByValue("el-GR"); //this works only when the value attribute is populated in the html
            ////select.SelectByText("English (United States)");
            ////Console.WriteLine("Selected value : {0}", select.SelectedOption.Text);
            ////IList<IWebElement> list = select.Options;

            //ObjectRepository.Driver.FindElement(Deprt_new).SendKeys("gh");
            //ObjectRepository.Driver.FindElement(BackTo).Click();
        }
Ejemplo n.º 5
0
        //last param means  parameter with variable length
        public void PerformAction(string keyword, string locatorType, string locatorValue, params string[] args)
        {
            try
            {
                switch (keyword)
                {
                case "Click":
                    ButtonHelper.ClickButton(GetElementLocator(locatorType, locatorValue));
                    break;

                case "SendKeys":
                    TextboxHelper.TypeInTextbox(GetElementLocator(locatorType, locatorValue), args[0]);
                    break;

                case "Select":
                    ComboboxHelper.SelectElement(GetElementLocator(locatorType, locatorValue), args[0]);
                    break;

                case "WaitForElement":
                    GenericHelper.WaitforWebElementInPage(GetElementLocator(locatorType, locatorValue),
                                                          TimeSpan.FromSeconds(50));
                    break;

                case "Navigate":
                    NavigationHelper.NavigateToUrl(args[0]);
                    break;

                case "GetLinkText":
                    ButtonHelper.GetButtonText(GetElementLocator(locatorType, locatorValue));
                    break;

                case "GetLinkText_alt":
                    ButtonHelper.GetButtonText_alt(GetElementLocator(locatorType, locatorValue));
                    break;

                case "Compare":
                    GenericHelper.GetTextAndCompare(GetElementLocator(locatorType, locatorValue), args[0]);
                    break;

                default:
                    throw new NoSuchKeywordFoundException("Keyword Not Found : " + keyword);
                }
            } catch (Exception e)
            {
                Console.Write("Something went wrong: Keyword" + keyword + ", locator: " + locatorType);
            }
        }
Ejemplo n.º 6
0
        public void TestDropdownList()
        {
            NavigationHelper.NavigateToUrl(ObjectRepository.Config.GetWebsite());
            ButtonHelper.ClickButton(By.XPath("//*[@id='culture-info']/button/div"));
            //IWebElement elemet = ObjectRepository.Driver.FindElement(By.Id("culture-selector-locale"));
            //SelectElement select = new SelectElement(elemet);
            //select.SelectByIndex(2);
            //select.SelectByValue("el-GR"); //this works only when the value attribute is populated in the html
            //select.SelectByText("English (United States)");
            //Console.WriteLine("Selected value : {0}", select.SelectedOption.Text);
            //IList<IWebElement> list = select.Options;
            //foreach (IWebElement item in list)
            //{
            //    Console.WriteLine("Value: {0}, Text :{1}", item.GetAttribute("value"), item.Text);

            //}

            ComboboxHelper.SelectElement(By.Id("culture-selector-locale"), 4);
            ComboboxHelper.SelectElement(By.Id("culture-selector-locale"), "el-GR");
            foreach (string item in ComboboxHelper.GetAllItem(By.Id("culture-selector-locale")))
            {
                Console.WriteLine("Text: {0}", item);//this prints all th eoptions in the dropdown
            }
        }
Ejemplo n.º 7
0
        public static MvcHtmlString GetSelectByEnable(this HtmlHelper helper, string name, string allText = "", bool?value = null, string cls = "w180")
        {
            var list = ComboboxHelper.GetListForEnable(allText);

            return(GetSelectHtml(list, name, cls, value));
        }
Ejemplo n.º 8
0
        public static MvcHtmlString GetSelectByEnum(this HtmlHelper helper, Type enumType, string name, string allText = "", object value = null, string cls = "w180")
        {
            var list = ComboboxHelper.GetListForEnum(enumType, allText);

            return(GetSelectHtml(list, name, cls, value));
        }
Ejemplo n.º 9
0
 private void frmStock_Load(object sender, EventArgs e)
 {
     ComboboxHelper.FillCategories(cmbCategory);
     RetriveList(string.Empty);
     chkStatus.Checked = true;
 }
Ejemplo n.º 10
0
 private void LoadLanguages()
 {
     ComboboxHelper.BindToCombobox(cbbChooseLanguage.ComboBox, Constants.LANGUAGES);
 }
Ejemplo n.º 11
0
 private void cmbCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     ComboboxHelper.FillProducts(cmbProduct, Convert.ToString(cmbCategory.SelectedValue));
 }
Ejemplo n.º 12
0
 private void frmNewSale_Load(object sender, EventArgs e)
 {
     ComboboxHelper.FillCategories(cmbCategory);
 }
Ejemplo n.º 13
0
 private void frmExpense_Load(object sender, EventArgs e)
 {
     ComboboxHelper.FillExpenseCategories(cboCategory);
     RetriveExpenses(string.Empty);
 }