コード例 #1
0
ファイル: WebControls.cs プロジェクト: geeksree/cSharpGeeks
 public WebControl(Browser aBrowser,Locator aLocator)
 {
     myControlAccess = new ControlAccess();
     myControlAccess.Browser = aBrowser;
     myControlAccess.LocatorType = aLocator.LocatorType;
     myControlAccess.Locator = aLocator.ControlLocator;
     myControlAccess.ControlType = ControlType.Custom;
     myControlAccess.IntializeControlAccess();
     //Control = myControlAccess.GetControl();
 }
コード例 #2
0
ファイル: WebControls.cs プロジェクト: geeksree/cSharpGeeks
 public WebControl(Browser aBrowser,LocatorType aLocatorType,string aLocator,ControlType aControlType)
 {
     myControlAccess = new ControlAccess();
     myControlAccess.Browser = aBrowser;
     myControlAccess.LocatorType = aLocatorType;
     myControlAccess.Locator = aLocator;
     myControlAccess.ControlType = aControlType;
     myControlAccess.IntializeControlAccess();
     //Control = myControlAccess.GetControl();
 }
コード例 #3
0
ファイル: Utility.cs プロジェクト: geeksree/cSharpGeeks
        internal static WebControl GetWebControlFromIContol(IControl aControl, Browser aBrowser, Locator aLocator, ControlType aConrolType)
        {
            WebControl aWebControl = null;
            
            if (aConrolType == ControlType.Button)
            {
                WebButton aWebButton = new WebButton(aBrowser, aLocator);
                aWebButton.Control = aControl;
                aWebControl = aWebButton;
            }

            if (aConrolType == ControlType.EditBox)
            {
                WebEditBox aWebEditBox = new WebEditBox(aBrowser, aLocator);
                aWebEditBox.Control = aControl;
                aWebControl = aWebEditBox;
            }
            
            if (aConrolType == ControlType.Custom)
            {
                aWebControl = new WebControl(aBrowser, aLocator);
                aWebControl.Control = aControl;
                //aWebControl = aWebEditBox;
            }
            if (aConrolType == ControlType.Calender)
            {
                WebCalender aWebCalender = new WebCalender(aBrowser, aLocator);
                aWebCalender.Control = aControl;
                aWebControl = aWebCalender;
            }
            
            if (aConrolType == ControlType.ComboBox)
            {
                WebComboBox aWebComboBox = new WebComboBox(aBrowser, aLocator);
                aWebComboBox.Control = aControl;
                aWebControl = aWebComboBox;
            }

            if (aConrolType == ControlType.CheckBox)
            {
                WebCheckBox aWebCheckBox = new WebCheckBox(aBrowser, aLocator);
                aWebCheckBox.Control = aControl;
                aWebControl = aWebCheckBox;
            }

            if (aConrolType == ControlType.Dialog)
            {
                WebDialog aWebDialog = new WebDialog(aBrowser, aLocator);
                aWebDialog.Control = aControl;
                aWebControl = aWebDialog;
            }

            if (aConrolType == ControlType.Frame)
            {
                WebFrame aWebFrame = new WebFrame(aBrowser, aLocator);
                aWebFrame.Control = aControl;
                aWebControl = aWebFrame;
            }

            if (aConrolType == ControlType.Image)
            {
                WebImage aWebImage = new WebImage(aBrowser, aLocator);
                aWebImage.Control = aControl;
                aWebControl = aWebImage;
            }

            if (aConrolType == ControlType.Label)
            {
                WebLabel aWebLabel = new WebLabel(aBrowser, aLocator);
                aWebLabel.Control = aControl;
                aWebControl = aWebLabel;
            }

            if (aConrolType == ControlType.Link)
            {
                WebLink aWebLink = new WebLink(aBrowser, aLocator);
                aWebLink.Control = aControl;
                aWebControl = aWebLink;
            }

            if (aConrolType == ControlType.ListBox)
            {
                WebListBox aWebListBox = new WebListBox(aBrowser, aLocator);
                aWebListBox.Control = aControl;
                aWebControl = aWebListBox;
            }

            if (aConrolType == ControlType.Page)
            {
                WebPage aWebPage = new WebPage(aBrowser, aLocator);
                aWebPage.Control = aControl;
                aWebControl = aWebPage;
            }

            if (aConrolType == ControlType.RadioButton)
            {
                WebRadioButton aWebRadioButton = new WebRadioButton(aBrowser, aLocator);
                aWebRadioButton.Control = aControl;
                aWebControl = aWebRadioButton;
            }

            if (aConrolType == ControlType.SpanArea)
            {
                WebSpanArea aWebSpanArea = new WebSpanArea(aBrowser, aLocator);
                aWebSpanArea.Control = aControl;
                aWebControl = aWebSpanArea;
            }

            if (aConrolType == ControlType.WebTable)
            {
                WebTable aWebTable = new WebTable(aBrowser, aLocator);
                aWebTable.Control = aControl;
                aWebControl = aWebTable;
            }

            if (aConrolType == ControlType.WebRow)
            {
                WebRow aWebRow = new WebRow(aBrowser, aLocator);
                aWebRow.Control = aControl;
                aWebControl = aWebRow;
            }

            if (aConrolType == ControlType.WebCell)
            {
                WebCell aWebCell = new WebCell(aBrowser, aLocator);
                aWebCell.Control = aControl;
                aWebControl = aWebCell;
            }
            
            
            return aWebControl;
        }
コード例 #4
0
ファイル: Utility.cs プロジェクト: geeksree/cSharpGeeks
        internal static List<WebControl> GetWebControlsFromIControlList(List<IControl> aIControlList, Browser aBrowser, Locator aLocator,ControlType aConrolType)
        {
            List<WebControl> aWebControlList = new List<WebControl>();

            foreach (IControl aControl in aIControlList)
            {
                aWebControlList.Add(GetWebControlFromIContol(aControl, aBrowser, aLocator, aConrolType));               
            }

            return aWebControlList;
        }
コード例 #5
0
ファイル: WebPage.cs プロジェクト: geeksree/cSharpGeeks
 public WebPage(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.Page)
 { }
コード例 #6
0
ファイル: WebSpanArea.cs プロジェクト: geeksree/cSharpGeeks
 public WebSpanArea(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.SpanArea)
 { }
コード例 #7
0
ファイル: WebCalender.cs プロジェクト: geeksree/cSharpGeeks
 public WebCalender(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.Calender)
 {
     browser = aBrowser;
     locator = aLocator;
 }
コード例 #8
0
ファイル: WebRow.cs プロジェクト: geeksree/cSharpGeeks
 public WebRow(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.WebRow)
 {
     browser = aBrowser;
     locator = aLocator;
 }
コード例 #9
0
ファイル: WebCell.cs プロジェクト: geeksree/cSharpGeeks
  public WebCell(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.WebCell)
 { }
コード例 #10
0
        public object InjectJSInBrowser(Browser aBrowser, string JavaScript)
        {
            IJavaScriptExecutor aScriptExecutor = (IJavaScriptExecutor)aBrowser.BrowserHandle;

            return aScriptExecutor.ExecuteScript(JavaScript);
        }
コード例 #11
0
        public object ExecuteJavaScript(Browser aBrowser, string JavaScript)
        {
            IJavaScriptExecutor aScriptExecutor = (IJavaScriptExecutor)aBrowser.BrowserHandle;

            return aScriptExecutor.ExecuteScript(JavaScript, aWebElement);

        }
コード例 #12
0
        public void Highlight(Browser aBrowser)
        {
            IJavaScriptExecutor aScriptExecutor = (IJavaScriptExecutor)aBrowser.BrowserHandle;

            object aStyle = aScriptExecutor.ExecuteScript("arguments[0].getAttribute('style');", aWebElement);
            aScriptExecutor.ExecuteScript("arguments[0].setAttribute('style', arguments[1]);", aWebElement,
                                          "border: 4px solid red;");

            //for (int i = 0; i < 5; i++)
            //{
            //    //aScriptExecutor.ExecuteScript("arguments[0].setAttribute('style', arguments[1]);", aWebElement,"color: red; border: 4px solid red;");

            //    object aStyle = aScriptExecutor.ExecuteScript("arguments[0].getAttribute('style');", aWebElement);
            //    aScriptExecutor.ExecuteScript("arguments[0].setAttribute('style', arguments[1]);", aWebElement,
            //                                  "border: 4px solid red;");
            //    //Thread.Sleep(50);

            //    //aScriptExecutor.ExecuteScript("arguments[0].setAttribute('style', arguments[1]);",
            //    //    aWebElement, aStyle);
            //}
        }
コード例 #13
0
 public string InnerHtml(Browser aBrowser)
 {
     return (string)ExecuteJavaScript(aBrowser, @"return arguments[0].innerHTML;");
 }
コード例 #14
0
ファイル: WebLink.cs プロジェクト: geeksree/cSharpGeeks
 public WebLink(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.Link)
 { }
コード例 #15
0
ファイル: WebControls.cs プロジェクト: geeksree/cSharpGeeks
 public WebButton(Browser aBrowser, Locator aLocator)
     :base(aBrowser,aLocator.LocatorType,aLocator.ControlLocator,ControlType.Button)
 { }
コード例 #16
0
ファイル: WebControls.cs プロジェクト: geeksree/cSharpGeeks
 public WebEditBox(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType,aLocator.ControlLocator, ControlType.EditBox)
 { }
コード例 #17
0
ファイル: WebDialog.cs プロジェクト: geeksree/cSharpGeeks
 public WebDialog(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.Dialog)
 { }
コード例 #18
0
ファイル: Actions.cs プロジェクト: geeksree/cSharpGeeks
 public Actions(Browser browser, SeleniumWebControls control)
 {
     WebDriver = browser.BrowserHandle;
     WebElement = control.aWebElement;
 }
コード例 #19
0
ファイル: WebWebTable.cs プロジェクト: geeksree/cSharpGeeks
 public WebWebTable(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.WebTable)
 { }
コード例 #20
0
ファイル: WebFrame.cs プロジェクト: geeksree/cSharpGeeks
 public WebFrame(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.Frame)
 { }
コード例 #21
0
ファイル: WebLabel.cs プロジェクト: geeksree/cSharpGeeks
 public WebLabel(Browser aBrowser, Locator aLocator)
     : base(aBrowser, aLocator.LocatorType, aLocator.ControlLocator, ControlType.Label)
 { }