No video
Converting Java Properties File into HashMap in Selenium WebDriver
In this video we will learn how to implement the hashmap in selenium webdriver for properties file in framework.
HashMap in selenium WebDriver,
Converting java properties file into HashMap,
How to use properties file in selenium,
How to use HashMap in properties file,
How to read properties file using hashmap in java,
Map in selenium for properties file,
Reading properties file using HashMap,
Reading properties file in selenium using map
Linkdein: / aditya-kumar-roy-b3673368
Facebook: / specializeautomation
Пікірлер: 6
Hello can you share your code source please
Hi, can you share source code if it is in github?
@SpecializeAutomation
6 жыл бұрын
import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; public class AppConfiguration { public static Map getConfig() { Properties prop = new Properties(); Map map = new HashMap(); try { prop.load(AppConfiguration.class.getResourceAsStream("/com/aditya/config/Application.properties")); } catch(IOException fxe) { System.out.println("Couldn't load propeties correctly :"+fxe.getMessage()); } for(Entry entry : prop.entrySet()) { map.put((String)entry.getKey(),(String)entry.getValue()); } return map; } public static String getConfig(String key) { Properties prop = new Properties(); Map map = new HashMap(); try { prop.load(AppConfiguration.class.getResourceAsStream("/com/aditya/config/Application.properties")); } catch(IOException fxe) { System.out.println("Couldn't load propeties correctly :"+fxe.getMessage()); } for(Entry entry : prop.entrySet()) { map.put((String)entry.getKey(),(String)entry.getValue()); if(map.containsKey(key)==true) { return map.get(key); } } return null; }
@SpecializeAutomation
6 жыл бұрын
Find codes I've posted in comment section
@thoughtcoders9252
4 жыл бұрын
Hi Den - Please check step by step tutorial to load properties file in HashMap thoughtcoders.com/training-library/java-properties-file-by-using-hashmap/