2 Improved formatting
source | link

One more way:

  • Create a .properties.properties file
  • Declare your all the language strings [could(could be separate .prop.prop for different locale]locale)
  • Whenever you want to assert for string use it from there. For example, refer below snippet:

    Whenever you want to assert for string use it from there. For example, refer below snippet:

    Assert.assertEquals((your_web_element.getText()),languageProps.getProperty("your_string_from_prop"));
    

    or:

    Assert.assertEquals((your_web_element.getText()), "your_string_for_locale");
    

>

Assert.assertEquals((your_web_element.getText()),languageProps.getProperty("your_string_from_prop"));

OR

Assert.assertEquals((your_web_element.getText()), "your_string_for_locale");

One more way:

  • Create a .properties file
  • Declare your all the language strings [could be separate .prop for different locale]
  • Whenever you want to assert for string use it from there. For example, refer below snippet:

>

Assert.assertEquals((your_web_element.getText()),languageProps.getProperty("your_string_from_prop"));

OR

Assert.assertEquals((your_web_element.getText()), "your_string_for_locale");

One more way:

  • Create a .properties file
  • Declare your all the language strings (could be separate .prop for different locale)
  • Whenever you want to assert for string use it from there. For example, refer below snippet:

    Assert.assertEquals((your_web_element.getText()),languageProps.getProperty("your_string_from_prop"));
    

    or:

    Assert.assertEquals((your_web_element.getText()), "your_string_for_locale");
    
1
source | link

One more way:

  • Create a .properties file
  • Declare your all the language strings [could be separate .prop for different locale]
  • Whenever you want to assert for string use it from there. For example, refer below snippet:

>

Assert.assertEquals((your_web_element.getText()),languageProps.getProperty("your_string_from_prop"));

OR

Assert.assertEquals((your_web_element.getText()), "your_string_for_locale");