Beispiel #1
0
        public void SetDate_For_WebDateChooser_Using_IdEndsWith(string ctrl_id, DateTime?dt)
        {//wdcDateCreated
            const string postfix_String = "_input";
            string       generatedId    = ctrl_id + postfix_String;
            var          webEle         = this.GetEle_Textbox_IdEndsWith(generatedId);

            string fullId = webEle.GetAttribute("id");//this id will be used to get control reference for WebDateChooser

            string requiredControlId = fullId.Remove(fullId.Length - postfix_String.Length);

            if (dt.HasValue)
            {
                string dateValueObj = Helpers.GetJavascript_DateObject(dt.Value);

                /*
                 * igdrp_getComboById('C1_ERP_CC_BODY_wdcDateCreated')
                 * var date = new Date(dateText); dp.set_value(date);
                 */
                this.Driver.RunJavascript(string.Format("igdrp_getComboById('{0}').setValue({1});", requiredControlId, dateValueObj));
            }
            else
            {
                this.Driver.RunJavascript(string.Format("igdrp_getComboById('{0}').set_value(null)", requiredControlId));
            }
            DriverHelpers.Blur(webEle, this.Driver);
        }
Beispiel #2
0
 public TSelf Wait(int seconds, EnumSearchLocation location = EnumSearchLocation.IFrame)
 {
     if (location == EnumSearchLocation.MainWindow)
     {
         DriverHelpers.WaitForSometime(base.PrimaryDriver, seconds);
     }
     else
     {
         DriverHelpers.WaitForSometime(base.IFrameDriver, seconds);
     }
     return(this as TSelf);
 }
Beispiel #3
0
        /// <summary>
        /// Path must be separated by \
        /// </summary>
        /// <param name="fullPathUnderProjectFolder"></param>
        /// <returns></returns>
        protected void Tree_SelectLeafUnderProjectByPath(string fullPathUnderProjectFolder)
        {
            string[] pathArr = fullPathUnderProjectFolder.Split('\\');

            IWebDriver driver = this.PrimaryDriver;

            var parentTreeNode = TreePanelHelper.Tree_Select_ProjectFolder(driver);

            int ctr = 0;

            while (ctr < pathArr.Length - 1)
            {
                parentTreeNode = TreePanelHelper.Tree_SubFolder_Toggle(driver, parentTreeNode, pathArr[ctr], true);
                ctr++;
            }

            TreePanelHelper.Tree_SelectLeafUnderFolder(driver, parentTreeNode, pathArr[ctr]);

            DriverHelpers.WaitForSometime(driver);
        }
Beispiel #4
0
 private TSelf WaitTill_ElementNotExists_OnIFrame(By by, int timeoutInSeconds, Action <IWebElement> callback = null)
 {
     DriverHelpers.Wait_WithCallback(base.IFrameDriver, by, timeoutInSeconds, callback);
     return(this as TSelf);
 }
Beispiel #5
0
 private TSelf WaitTill_ElementNotExists_OnMain(By by, int timeoutInSeconds, Action <IWebElement> callback = null)
 {
     DriverHelpers.Wait_WithCallback(base.PrimaryDriver, by, timeoutInSeconds, callback);
     return(this as TSelf);
     //return this.Wait_WithCallback(this as T, true, by, timeoutInSeconds, callback);
 }
Beispiel #6
0
        //protected T Wait_WithCallback(T refObj, bool isPrimary, By by, int timeoutInSeconds, Action<IWebElement> callback = null)
        //{
        //    var driver = isPrimary ? base.PrimaryDriver : base.IFrameDriver;
        //    DriverHelpers.Wait_WithCallback(driver, by, timeoutInSeconds, callback);

        //    return this as T;
        //}
        public virtual TSelf Wait(int seconds)
        {
            DriverHelpers.WaitForSometime(base.PrimaryDriver, seconds);
            return(this as TSelf);
        }