/** * Get PA Url * @author jzhang6 * @return url */ public String getPAUrl(){ String PAUrl = ""; try { String filePath = System.getProperty ("user.dir").toString()+"/src/test/resources/config/environment.xml"; logger.info("The path of environment.xml is : "+filePath); File file = new File(filePath); SAXReader saxReader = new SAXReader(); Document document = saxReader.read(file); String currentEnv = Util.getEnvStr(); Element el =XmlUtil.getSingleElement(document, "/root/environment[@type='" + currentEnv + "']/PAUrl"); PAUrl = XmlUtil.getElementValue(el, "No default PA URL"); logger.info("PA Url : "+PAUrl); } catch (DocumentException e) { e.printStackTrace(); } return PAUrl; }