Question: I am using EventFiringWebDriver and WebDriverEventListener. In listener I am implementing method after `clickOn(WebElement arg0, WebDriver arg1)` method.

```
WebElement myaccountLink =driver.findElement(By.cssSelector("div.footer>div.links>ul>li>a[title='My Account']"));
myaccountLink.click();

```

The listener:

```
public void afterClickOn(WebElement arg0, WebDriver arg1) {
    System.out.println("Clicked : "+arg0.toString());
}

```

The result is:

> 
> Clicked : -> css selector: div.footer>div.links>ul>li>a[title='My Account']]
> 
> 
> 

But I'd like:

> 
> Clicked : myaccountLink
> 
> 
>

Answer: 
You may try to build a custom class like this:

```
public class Selector {
    public String name;
    public By by;

    public Selector(String name, By by){
        this.name= name;
        this.by = by;
    }

    public String getName(){
        return name;
    }

    public By getBy(){
        return by;
    }
}

```

Then, in your code:

```
Selector myAccountLink = ("Link to 'My account'", By.cssSelector("div.footer>div.links>ul>li>a[title='My Account']"));
System.out.println("Clicked: " + myAccountLink.getName());

// Output: "Link to 'My account'"

```
I'm open to correction on this but as far as i know, it's not possible. Variable names aren't communicated in Java, only the values.