Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Dropdown currencies are listed as($,€,₤). Based on the selected currency, prices will display in other page like ($10,€10,₤10). Using the below code, I got the selected value from the dropdown.

    WebElement select=driver.findElement(By.className("selected"));
    System.out.println("Currency Selected:" +select.getText());

When I print the value its coming as ? instead of $. How to print the currency value. And check whether the $ currency is displaying in other page.

share|improve this question
Are you sure your terminal (or whatever you are using for output) is capable of printing currency symbols correctly? – user246 Jul 8 '14 at 19:41
Thanks. It worked after changing the console encoding to UTF-8 – STE Jul 9 '14 at 14:51
Don't forget to accept an answer if you found it helpful. =) – corsiKa Nov 10 '14 at 19:55

Instead of simple System.out.println (last line in your example)

try out the following:

PrintStream out = new PrintStream(System.out, true, "UTF-8");
out.println("Currency Selected:" +select.getText());
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.