当前位置: 首页>>代码示例>>C#>>正文


C# Actions.ContextClick方法代码示例

本文整理汇总了C#中OpenQA.Selenium.Interactions.Actions.ContextClick方法的典型用法代码示例。如果您正苦于以下问题:C# Actions.ContextClick方法的具体用法?C# Actions.ContextClick怎么用?C# Actions.ContextClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenQA.Selenium.Interactions.Actions的用法示例。


在下文中一共展示了Actions.ContextClick方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeName

 public void ChangeName()
 {
     var task9 = new Task9(this.Driver);
     task9.NavigateToPage(GetHost() + "task_9");
     Driver.WaitForElement(By.CssSelector("#j1_1 i.jstree-ocl"), 2).Click();
     Driver.WaitForElement(By.CssSelector("#j1_2 i.jstree-ocl"), 2).Click();
     var j11anchor = Driver.WaitForElement(By.CssSelector("j1_1_anchor"), 2);
     Actions action = new Actions(Driver);
     action.ContextClick(j11anchor).Perform();
     Driver.WaitForElement(By.CssSelector(".vakata-context.jstree-contextmenu.jstree-default-contextmenu"), 2).Click();
     Driver.WaitForElement(By.CssSelector("j1_1_anchor"), 2).SendKeys("Abc");
 }
开发者ID:tbien,项目名称:aadays,代码行数:12,代码来源:Zadanie9.cs

示例2: ShouldAllowContextClick

        public void ShouldAllowContextClick()
        {
            driver.Url = javascriptPage;

            IWebElement toContextClick = driver.FindElement(By.Id("doubleClickField"));

            Actions actionProvider = new Actions(driver);
            IAction contextClick = actionProvider.ContextClick(toContextClick).Build();

            contextClick.Perform();
            Assert.AreEqual("ContextClicked", toContextClick.GetAttribute("value"));
        }
开发者ID:hugs,项目名称:Selenium2,代码行数:12,代码来源:BasicMouseInterfaceTest.cs

示例3: TestContextClick

        public void TestContextClick()
        {
            NavigationHelper.NavigateToUrl("http://demos.telerik.com/kendo-ui/dragdrop/events");
            Actions act = new Actions(ObjectRepository.Driver);
            IWebElement ele = ObjectRepository.Driver.FindElement(By.Id("draggable"));

            act.ContextClick(ele)
                .Build()
                .Perform();

            Thread.Sleep(5000);
        }
开发者ID:Saltorel,项目名称:BDD-CSharp,代码行数:12,代码来源:TestMouseAction.cs

示例4: SelectFromContextMenu

		public void SelectFromContextMenu(string pageName, string option)
		{
			Trace.WriteLine(BasePage.TraceLevelPage + "Select from Context menu:");
			Actions builder = new Actions(_driver);
			builder.ContextClick(
				WaitForElement(By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//span[text() = '" + pageName + " ']"))).
				MoveToElement(WaitForElement(By.XPath(option))).Build().Perform();

			FindElement(By.XPath(option)).Info();

			Trace.WriteLine(BasePage.TraceLevelPage + "Click on option: " + option);
			Click(By.XPath(option));
		}
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:13,代码来源:AdminPageManagementPage.cs

示例5: RightClickExample

 public void RightClickExample()
 {
     Driver.Navigate().GoToUrl("http://the-internet.herokuapp.com/context_menu");
     IWebElement MenuArea = Driver.FindElement(By.Id("hot-spot"));
     Actions Builder = new Actions(Driver);
     Builder.ContextClick(MenuArea)
         .SendKeys(Keys.ArrowDown)
         .SendKeys(Keys.ArrowDown)
         .SendKeys(Keys.ArrowDown)
         .SendKeys(Keys.ArrowDown)
         .SendKeys(Keys.ArrowDown)
         .SendKeys(Keys.Enter)
         .Perform();
     IAlert Alert = Driver.SwitchTo().Alert();
     Assert.That(Alert.Text.Equals("You selected a context menu"));
 }
开发者ID:GruLab,项目名称:elemental-selenium-tips,代码行数:16,代码来源:RightClick.cs

示例6: GetCellContainsValueRefreshed

        public string GetCellContainsValueRefreshed(string lookupColumn, string lookupValue, string returnColumn, 
            string refreshValue, int refreshTime, IWebDriver driver)
        {
            int lookupColumnIndex = this.GetColumnIndex(lookupColumn);
            int returnColumnIndex = this.GetColumnIndex(returnColumn);

            IReadOnlyCollection<IWebElement> rows = this.element.FindElements(By.CssSelector("tbody tr"));
            foreach (IWebElement row in rows)
            {
                if (row.Text != "")
                {
                    for (int i = 1; i <= refreshTime; i++)
                    {

                        IReadOnlyCollection<IWebElement> cells = row.FindElements(By.TagName("td"));
                        if (cells.ElementAt(lookupColumnIndex).Text.Contains(lookupValue))
                        {
                            if (cells.ElementAt(returnColumnIndex).Text.Contains(refreshValue))
                            {
                                return cells.ElementAt(returnColumnIndex).Text;
                            }

                            else
                            {
                                Thread.Sleep(3000);
                                Actions action = new Actions(driver);
                                action.ContextClick(row).Perform();
                                IWebElement elementOpen = driver.FindElement(By.LinkText("Refresh List"));
                                elementOpen.Click();
                                rows = this.element.FindElements(By.CssSelector("tbody tr"));
                            }
                        }
                    }
                }
            }

            throw new Exception(String.Format("Unable to find table row {0} with value {1}", lookupColumn, lookupValue));
        }
开发者ID:pjagga,项目名称:SeleniumMSTestVS2013,代码行数:38,代码来源:Table.cs

示例7: DeleteQuery

        public static void DeleteQuery(string xQuery,string xDeleteQuery)
        {
            WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(10));
            wait.IgnoreExceptionTypes(typeof(InvalidOperationException));
            Actions clicker = new Actions(Driver);
            try
            {
                wait.Until(d =>
                {
                    QueryLinkElement = d.FindElement(By.XPath(xQuery));

                    if (QueryLinkElement == null ||
                        QueryLinkElement.Displayed == false ||
                        QueryLinkElement.Enabled == false) return false;
                    return true;
                });
            }
            catch (Exception)
            {
                throw new NoSuchElementException();
            }

            wait.Until(d =>
            {
                clicker.ContextClick(QueryLinkElement).Perform();

                DeleteQueryLinkElement = d.FindElement(By.XPath(xDeleteQuery));

                if (DeleteQueryLinkElement == null ||
                    DeleteQueryLinkElement.Displayed == false ||
                    DeleteQueryLinkElement.Enabled == false) return false;
                DeleteQueryLinkElement.Click();
                return true;
            });

            wait.Until(d =>
            {
                YesReallyDeleteElement = d.FindElement(By.XPath(getXButton("Yes")));

                if (YesReallyDeleteElement == null ||
                    YesReallyDeleteElement.Displayed == false) return false;
                YesReallyDeleteElement.Click();
                return true;
            });
        }
开发者ID:Blackbaud-LucasWestervelt,项目名称:uat-kit,代码行数:45,代码来源:QueryPanel.cs

示例8: SelectFromContextMenu

		public void SelectFromContextMenu(string pageName, string option)
		{
			Trace.WriteLine(BasePage.TraceLevelPage + "Select from Context menu:");

			WaitForElement(By.XPath(PageList + "//span[text() = '" + pageName + " ']")).Info();

			Actions builder = new Actions(_driver);
			builder.ContextClick(
				FindElement(By.XPath(PageList + "//span[text() = '" + pageName + " ']"))).
				MoveToElement(WaitForElement(By.XPath(option))).Build().Perform();

			Thread.Sleep(1000);

			Trace.WriteLine(BasePage.TraceLevelPage + "Click on option: " + option);
			Click(By.XPath(option));
		}
开发者ID:uXchange,项目名称:Dnn.Platform,代码行数:16,代码来源:AdminPageManagementPage.cs

示例9: FileViewSelectFromContextMenu

		public void FileViewSelectFromContextMenu(string fileName, string option)
		{
			Trace.WriteLine(TraceLevelComposite + "Select from Context menu:");

			WaitForElement(By.XPath(FileView + "//tr/td/div[@title = '" + fileName + "']")).Info();

			Actions builder = new Actions(_driver);
			builder.ContextClick(
				FindElement(By.XPath(FileView + "//tr/td/div[@title = '" + fileName + "']"))).
				MoveToElement(WaitForElement(By.XPath(option)).WaitTillEnabled()).Build().Perform();

			Thread.Sleep(1000);

			Trace.WriteLine(TraceLevelPage + "Click on option: " + option);
			WaitAndClick(By.XPath(option));
		}
开发者ID:kp-xcess,项目名称:Dnn.Platform,代码行数:16,代码来源:FileManagementPage.cs


注:本文中的OpenQA.Selenium.Interactions.Actions.ContextClick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。