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);
 }
        public frmEmployee()
        {
            InitializeComponent();

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

            // set value to datagridview
            dgvEmployee.DataSource = null;
            dgvEmployee.ClearSelection();
        }
示例#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);
        }
示例#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();
        }
示例#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);
            }
        }
示例#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
            }
        }
示例#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));
        }
示例#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));
        }
示例#9
0
 private void frmStock_Load(object sender, EventArgs e)
 {
     ComboboxHelper.FillCategories(cmbCategory);
     RetriveList(string.Empty);
     chkStatus.Checked = true;
 }
示例#10
0
 private void LoadLanguages()
 {
     ComboboxHelper.BindToCombobox(cbbChooseLanguage.ComboBox, Constants.LANGUAGES);
 }
 private void cmbCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     ComboboxHelper.FillProducts(cmbProduct, Convert.ToString(cmbCategory.SelectedValue));
 }
 private void frmNewSale_Load(object sender, EventArgs e)
 {
     ComboboxHelper.FillCategories(cmbCategory);
 }
 private void frmExpense_Load(object sender, EventArgs e)
 {
     ComboboxHelper.FillExpenseCategories(cboCategory);
     RetriveExpenses(string.Empty);
 }