コード例 #1
0
 /// <summary>Performs a context-click (right click) on an element.</summary>
 /// <param name="webelement"> The element to context-click. If None, clicks on current mouse position.</param>
 /// <returns></returns>
 public Actions contextClick(WebElement webelement = null)
 {
     if (webelement == null)
     {
         _actions.ContextClick();
     }
     else
     {
         _actions.ContextClick(webelement._webElement);
     }
     return(this);
 }
コード例 #2
0
        public void rightClick(IWebElement elementToRightClick)
        {
            var action = new OpenQA.Selenium.Interactions.Actions(this.driver);

            action.ContextClick(elementToRightClick);
            action.Perform();
        }
コード例 #3
0
        /// <summary>
        /// Execute the action
        /// </summary>
        /// <param name="actor"></param>
        /// <param name="ability"></param>
        protected override void ExecuteWhen(IActor actor, WebBrowser ability)
        {
            var seleniumActions = new OpenQA.Selenium.Interactions.Actions(ability.Driver);
            var element         = _target.ResolveFor(ability.Driver);

            seleniumActions.ContextClick(element)
            .Build()
            .Perform();
        }
コード例 #4
0
        protected static void RightClick(PageElement pageElement, TimeSpan?maxWaitTime = null)
        {
            pageElement.GoToFrame();
            var actions =
                new OpenQA.Selenium.Interactions.Actions(SeleniumDriver.Driver);

            actions.ContextClick(SeleniumUtility.WebDriverWait(ExpectedConditions.ElementIsVisible(pageElement.Locator),
                                                               maxWaitTime ?? Default5Seconds)).Build().Perform();
        }
コード例 #5
0
        public bool rightclick(By by, string locatorName)
        {
            bool flag = false;

            try
            {
                WebElement elementToRightClick = driver.FindElement(by);
                Actions    clicker             = new Actions(driver);
                clicker.ContextClick(elementToRightClick).Perform();
                flag = true;
                return(flag);
                // driver.findElement(by1).sendKeys(Keys.DOWN);
            }
            catch (Exception)
            {
                return(flag);
            }
        }
コード例 #6
0
 public void RightClick()
 {
     OpenQA.Selenium.Interactions.Actions action = new OpenQA.Selenium.Interactions.Actions(Driver);
     action.ContextClick(WebElement).Build().Perform();
 }
コード例 #7
0
        public static void RegisterRightClick(IWebDriver browser, IWebElement element)
        {
            var action = new OpenQA.Selenium.Interactions.Actions(browser);

            action.ContextClick(element).Perform();
        }