示例#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);
            }
        }
 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();
        }