How to print currency symbols using webdriver with testng



  • 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"));
        select.getText();
        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.



  • 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());
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2