我在test.properties文件中有一些WebElements,我需要讀取和存儲該文件中的所有json數據。任何人都可以請幫助閱讀從Java中的屬性文件中的所有json數據。如何從其他webelements存在的test.properties中讀取json數據
我試過所有閱讀和存儲數據的方式,但沒有運氣。
這是我在性能webElements文件:
mprHomePageLogo=//span[@class='si mpr-logo-h40px' and text()='MyPerfectResume.com']
mprHomePageLogoNewLP=//*[@class='inner-container']/span[@class='logo']
textLabel1=//*[@id='mt_mac_headline']/h1[text()='The Online Resume Builder So Easy to Use']
headingTextLabelOnNewLP=//*[contains(@class,'h1') and contains(text(),'Your Resume, Made')]/../h1/span[text()='Easy']
textLabel2=//*[text()='My Perfect Resume takes the hassle out of resume writing. Easy prompts help you create the perfect job-worthy resume effortlessly!']
desktoplikeImageOnLP=//object[contains(@class,'hero-desktop')]/following-sibling::a
iconsAndArrows=//*[@id='page-header-ctnr']/ul/li[@id="icon1" and @class="icon-ctnr"]/following-sibling::li[@id="arrow1" and @class="arrow-ctnr"]/following-sibling::li[@id="icon2" and @class="icon-ctnr"]/following-sibling::li[@id="arrow2" and @class="arrow-ctnr"]/following-sibling::li[@id="icon3" and @class="icon-ctnr"]
jsonArray= {"card":[{"Name":"1test1","place":"1placetest1"},{"Name":"2test2","place":"placetest2"},{"Name":"3test3","place":"3placetest3"}]}
textLabel3532=//*[text()='My Perfect Resume takes the hassle out of resume writing. Easy prompts help you create the perfect job-worthy resume effortlessly!']
desktoplikeImageOtestnLP=//object[contains(@class,'hero-desktop')]/following-sibling::a
jsonArray2= {"card":[{"Name":"test1","place":"placetest1"},{"Name":"test2","place":"placetest2"},{"Name":"test3","place":"placetest3"}]}
正如你可以看到有這個屬性文件(jsonArray & jsonArray2)兩大JSON數據,我需要閱讀這一切鍵和值jsonArray。
感謝@mahesh, – Ravi
歡迎@ravi ..如果您的問題被解析爲接受,您可以標記該anwser。與選擇。提前致謝。 –