java - How to use values of build.properties in another property file using selenium webdriver -


i using eclipse selenium webdriver. have assigned url variable 'webdriver.url' in build.properties file. have created property file called 'expectedresults.properties'. want use value of variable webdriver.url of build.properties in expectedresults.properties file. possible use. if possible can please tell how be?

thanks in advance.

not clear whats objective is. 2 cases possible here -

1.assuming have url in 'webdriver.url' variable. can write second property file ('expectedresults.properties')

properties prop = new properties(); outputstream output = null; try {     output = new fileoutputstream("expectedresults.properties");     prop.setproperty("expected.url", webdriver.url);     prop.store(output, null);  } catch (ioexception io) {     io.printstacktrace(); } 

2 can read both property files & compare urls -

properties prop = new properties();  inputstream input = null; try {  input = new fileinputstream("filename.properties");  prop.load(input);  system.out.println(prop.getproperty("webdriver.url"));       }   catch (ioexception ex) {  ex.printstacktrace(); }  

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -