Tuesday, August 18, 2015

SET THE BROWSER LANGUAGE USING SELENIUM WEBDRIVER (Localization)







In this post we are going to see how to set browser language using selenium webdriver. To test the Localization Testing.
  1. Localization:(sometimes shortened to "l10n") is the process of adapting a product or service to a particular language, culture, and desired local "look-and-feel."
To achieve this we need to use FirefoxProfile class.


In this program

  1. Create object to FirefoxProfile Class
     FirefoxProfile profile=new FirefoxProfile();


   
      2. Set Language use setPreference method.

      profile.setPreference("intl.accept_languages","de");


   3Create Firefox Driver and Pass the profile Object

      WebDriver driver;

   driver=new FirefoxDriver(profile);
   driver.get("http://www.google.com");





Source Code




import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;


public class Languagetest {

       public static void main(String[] args) {
              // TODO Auto-generated method stub
             
              FirefoxProfile profile=new FirefoxProfile();
              //Setting the browser language to de:germany
              profile.setPreference("intl.accept_languages","de");
              WebDriver driver;
              driver=new FirefoxDriver(profile);
              driver.get("http://www.google.com");

       }

}


Run the Program:


ScreenShot:







Your browser language set to German Language.


Thanks

Have a great day!!

27 comments:

  1. Selenium |Training|Job Support|+91-741-626-7887 Selenium a Web based automation tool that automates anything and everything available on a Web page.   http://laymanlearning.com/selenium-training/ --- Send Enquiry --- hr@laymanlearning.com

    ReplyDelete
  2. I am actually delighted to read this post that carries countless of helpful information, thanks!
    German language localization

    ReplyDelete
  3. This blog is very well good as i am working in selenium sector it is really useful for me. so please update latest kind of information too.

    Web Design Company in Chennai

    ReplyDelete
  4. keep sharing your information regularly for my future reference. This content creates a new hope and inspiration with in me.

    Best Implant Clinic In Chennai | Best Laser Clinic In Chennai | Best Dental Clinic In Vellore

    ReplyDelete
  5. The blog gave me idea to set browser language using selenium My sincere thanks for sharing this post and please continue to share this kind of post
    Selenium Training in Chennai

    ReplyDelete
  6. really you have posted an informative blog. it will be helpful to many peoples who are all working under the technology. so keep on sharing such kind of an interesting blogs.
    selenium training in chennai

    ReplyDelete
  7. Thanks for the perfect answers for Selenium FAQs., This will be very helpful for beginners.


    Seleniuum Training in Bangalore

    ReplyDelete
  8. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge. Selenium Training in Chennai | Software Testing Training in Chennai

    ReplyDelete
  9. Thanks so much for taking the time to submit such a comprehensive, beneficial post. I've been being "swayed" by all the positive talk. A valuable information is also available here.
    Java Training in chennai |Python Training in Chennai|Best Python Training in Chennai

    ReplyDelete
  10. Nice blog, here I had an opportunity to learn something new in my field. I have an expectation about your future post so please keep updates...Thanks..

    Software Testing Training in Bangalore

    Software Testing Training in BTM Layout

    Software Testing Training in Marathahalli




    ReplyDelete
  11. its a very great post and informative, Thank you for sharing.....
    Best IT Training in Bangalore

    ReplyDelete
  12. Best institute for 3d Animation and Multimedia Course training Classes


    Best institute for 3d Animation and Multimedia

    Best institute for 3d Animation Course training Classes in Noida- webtrackker Is providing the 3d Animation and Multimedia training in noida with 100% placement supports. for more call - 8802820025.

    3D Animation Training in Noida

    Company Address:

    Webtrackker Technology

    C- 67, Sector- 63, Noida

    Phone: 01204330760, 8802820025

    Email: info@webtrackker.com

    Website: http://webtrackker.com/Best-institute-3dAnimation-Multimedia-Course-training-Classes-in-Noida.php

    Our courses:

    ReplyDelete
  13. Sap fico training institute in Noida

    Sap fico training institute in Noida - Webtrackker Technology is IT Company which is providing the web designing, development, mobile application, and sap installation, digital marketing service in Noida, India and out of India. Webtrackker is also providing the sap fico training in Noida with working trainers.


    WEBTRACKKER TECHNOLOGY (P) LTD.
    C - 67, sector- 63, Noida, India.
    F -1 Sector 3 (Near Sector 16 metro station) Noida, India.

    +91 - 8802820025
    0120-433-0760
    0120-4204716
    EMAIL: info@webtrackker.com
    Website: www.webtrackker.com

    ReplyDelete
  14. All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
    Authorized iphone service center in Chennai | iphone service center in chennai | Mobile service center in chennai | Authorized iphone service center in Chennai | iphone service center in chennai | Authorized iphone service center in Chennai | iphone battery replacement in chennai

    ReplyDelete
  15. I Got Job in my dream company with decent 12 Lacks Per Annum salary, I have learned this world most demanding course out there in the current IT Market from the big data hadoop training in pune experts who helped me a lot to achieve my dreams comes true. Really worth trying

    ReplyDelete
  16. Thanks for sharing your innovative ideas to our vision. I have read your blog and I gathered some new information through your blog. Your blog is really very informative and unique. Keep posting like this. Awaiting for your further update.If you are looking for any apache spark scala related information, please visit our website Apache spark training institute in Bangalore

    ReplyDelete
  17. Communication is a two way process. If done properly, it gives excellent result. Thus opting for the best Integrated Marketing Communication Course on Talentedge is wise. To know more visit:

    ReplyDelete
  18. Visit Bharat Go Digital Academy to learn the digital marketing skills in India.

    ReplyDelete
  19. Talk To Astrologer expert will show you the right direction in your life, and that is the reason StarsTell.com provides consultation service. So, to avail of the online consultation facility, you must visit https://www.starstell.com/talk-to-astrologer.php

    ReplyDelete