Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 18, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 18, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 18, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 18, 2025

      I need to see more from Lenovo’s most affordable gaming desktop, because this isn’t good enough

      May 18, 2025

      Gears of War: Reloaded — Release date, price, and everything you need to know

      May 18, 2025

      I’ve been using the Logitech MX Master 3S’ gaming-influenced alternative, and it could be your next mouse

      May 18, 2025

      Your Android devices are getting several upgrades for free – including a big one for Auto

      May 18, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      YTConverter™ lets you download YouTube videos/audio cleanly via terminal — especially great for Termux users.

      May 18, 2025
      Recent

      YTConverter™ lets you download YouTube videos/audio cleanly via terminal — especially great for Termux users.

      May 18, 2025

      NodeSource N|Solid Runtime Release – May 2025: Performance, Stability & the Final Update for v18

      May 17, 2025

      Big Changes at Meteor Software: Our Next Chapter

      May 17, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      I need to see more from Lenovo’s most affordable gaming desktop, because this isn’t good enough

      May 18, 2025
      Recent

      I need to see more from Lenovo’s most affordable gaming desktop, because this isn’t good enough

      May 18, 2025

      Gears of War: Reloaded — Release date, price, and everything you need to know

      May 18, 2025

      I’ve been using the Logitech MX Master 3S’ gaming-influenced alternative, and it could be your next mouse

      May 18, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Selenium Java best practices for handling different languages and locations, and setting dynamic architecture

    Selenium Java best practices for handling different languages and locations, and setting dynamic architecture

    July 9, 2024

    Im currently working on a platform that has multi-language options and also the language is defined by IP. So Im trying to build an architecture for testing both scenarios dynamically… The domain is always the same: Example: www.page.com (If you are logged in from Britain the web application is loaded in English, if you are visiting the page from France the page is loaded in French.)

    I have an idea to make different abstract classes with error messages for example:

    public class ErrorMessagesEN {

    public static final String MANDATORY_FIELD = “This field is mandatory…”;
    public static final String SOME_OTHER_ERROR_MSG = “Some error message on english”

    // etc…..

    }

    public class ErrorMessagesFR {

    public static final String MANDATORY_FIELD = “Error message in French”
    public static final String SOME_OTHER_ERROR_MSG = “Some error message on
    French”

    // etc…..
    }

    In the test method i provide parameter “EN” or “FR” for example:

    homepage.signIn(String location)

    So is there any option to make for example:

    if (location==”EN”) {
    // load the ErrorMessageEN
    // etc……
    }

    The keys for the Strings are the same but the classes are different, so how can I provide different imports of the classes by the location parameter for example? Or are there any better approaches for this situation? Any links or ideas?

    Thanks!

    PS. If you need more info to help me please ask! 🙂

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDoes anyone know any low code or nocode packages (open-source or commercial) for load and longevity testing a mobile app?
    Next Article A Survey of Controllable Learning: Methods, Applications, and Challenges in Information Retrieval

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 18, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-4873 – PHPGurukul News Portal SQL Injection Vulnerability

    May 18, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    CVE-2025-4019 – Apache Novel-Plus Missing Authentication Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Apache Flink – framework and distributed processing engine

    Development

    I can’t pick a favorite — the award-winning Razer Blade 16 or its new big sibling — but you can preorder both now

    News & Updates

    Palo Alto Networks Looks for Growth Amid Changing Cybersecurity Market

    Development

    Highlights

    Why drag and drop is not working in Selenium Webdriver?

    July 10, 2024

    I am trying to drag an element into another element using Selenium WebDriver but it’s not working. I tried all the solutions which I can find on internet but none of the solutions seems to be working for me.

    WebElement sourceelement = driver.findElement(By.cssSelector(“XXX”));
    WebElement destelement = driver.findElement(By.cssSelector(“YYY”));

    Code1:-

    Actions builder = new Actions( _controls.getDriver());
    builder.dragAndDrop(sourceelement, destelement);

    Code2:-

    Actions builder = new Actions(_controls.getDriver());
    Action dragAndDrop =
    builder.clickAndHold(sourceelement).moveToElement(destelement).release(destelement).build();
    Thread.sleep(2000);
    dragAndDrop.perform()

    Code3:-

    Point coordinates1 = sourceelement.getLocation();
    Point coordinates2 = destelement.getLocation();
    Robot robot = new Robot();
    robot.mouseMove(coordinates1.getX(), coordinates1.getY());
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseMove(coordinates2.getX(), coordinates2.getY());
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
    Thread.sleep(2000);

    Code4:-

    final String java_script =
    “var src=arguments[0],tgt=arguments[1];var dataTransfer={dropEffe” +
    “ct:”,effectAllowed:’all’,files:[],items:{},types:[],setData:fun” +
    “ction(format,data){this.items[format]=data;this.types.append(for” +
    “mat);},getData:function(format){return this.items[format];},clea” +
    “rData:function(format){}};var emit=function(event,target){var ev” +
    “t=document.createEvent(‘Event’);evt.initEvent(event,true,false);” +
    “evt.dataTransfer=dataTransfer;target.dispatchEvent(evt);};emit(‘” +
    “dragstart’,src);emit(‘dragenter’,tgt);emit(‘dragover’,tgt);emit(” +
    “‘drop’,tgt);emit(‘dragend’,src);”;

    ((JavascriptExecutor)_controls.getDriver()).executeScript(java_script, sourceelement, destelement);
    Thread.sleep(2000);

    None of the above code is working for me. All the above runs without any error but drag and drop is not happening in the application. Anyone having any other solution ? Thanks.

    Browser :- IE

    resticprofile is a configuration profiles manager and scheduler

    April 15, 2025

    Grml – bootable live system

    January 24, 2025

    How to make table structure file using org.apache.commons.io.FileUtils.writeStringToFile(file)?

    August 8, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.