I am working on a page-object class using Selenium and Eclipse (though this question applies to Eclipse in general).
I am defining some strings, sometimes based on other strings. As in the example below which is a simple example:
private static final String X1 = "//div[contains(@id,'s1')]";
private static final String X2 = X1 + "//table[contains(@id,'tony')]";
private static final String X3 = X2 + "//a";
etc.
In eclipse you can hover over a string (like X3) and it will show you the value (like the following:
String xxxx.xxxx.com.Page.X3 = "//div[contains(@id,'s1')]//table[contains(@id,'tony')]//a")
but that's not what actually happens since it is unused, you get this message: The value of the field ViewProviderDemographicsPage.X3 is not used
So I always have to put something like String dummy = X3; so I can avoid that message. I tried putting @SuppressWarnings(unused) at the top of the file (I may have the syntax wrong here but it was correct in the file). But that appears just to suppress the warning only for the line directly under it. Is there any way to have it show the value when you hover even if it is unused?
What else would be optimal is if when you hover it just showed the value without the =" and " around it, and the name of the variable. I can never select just the xpath so when I copy and paste into firefox inspect I have to paste and then remove the =" and "