Unable to click on a salesforce tag ::after which is an arrow dropdown

71 views
Skip to first unread message

SUMIT AGGARWAL

unread,
Oct 10, 2017, 7:53:52 AM10/10/17
to Selenium Users

Unable to click on a salesforce tag :: after (.support-servicedesk-navigator .x-btn-mc em.x-btn-split:after) using webdriver


image


Need to click on arrow icon


image


I have tried action and css both but nothing worked:


1. WebElement switchLabel =driver.findElement(By.cssSelector(".x-btn-split::after"));
  ((JavascriptExecutor)driver)
          .executeScript("arguments[0].click();",switchLabel);*/


2. Actions action = new Actions(driver);
action.moveToElement(driver.findElement(By.cssSelector(".x-btn-split::after"))), 20,23).click().build().perform();  
    
3.  WebElement ele = driver.findElement(By.xpath("//*[@id='ext-gen80']"));
  Actions build = new Actions(driver);
  build.moveToElement(ele, 21, 23).click().build().perform();


CSS part of the UI:


image


Afrina Alam

unread,
Mar 13, 2018, 11:23:59 AM3/13/18
to Selenium Users
Any Breakthrough you got it !!

SUMIT AGGARWAL

unread,
Mar 15, 2018, 10:06:23 AM3/15/18
to Selenium Users
Yeah, We had got the solution for this, below is the code snippet we used to click on that tag:


Actions action = new Actions(driver);
action.moveToElement(driver.findElement(By.cssSelector(".x-btn-split")),248,25).doubleClick().build().perform();

248, 25 is the position/px of web element on page. You can relate it on the basis of your application.

Thanks,
Sumit

Nalin Perera

unread,
Jun 11, 2018, 12:14:59 AM6/11/18
to Selenium Users
This worked with WebDriver, but not with the RemoteWebDriver (Selenium 3.12.0).  Ended up using keyboard shortcuts to invoke the Navigation Menu Dropdown.

String navigationMenuDropdownShortcutKeys = Keys.chord(Keys.ESCAPE, "v");

new Actions(driver)
 
.sendKeys(navigationMenuDropdownShortcutKeys)
 
.perform();

Reply all
Reply to author
Forward
0 new messages