How to get the value of a object when tagid and name are not available | Selenium Forum
2
2013deepdeep Posted on 05/02/2019

<div id="abcDataState" data-value="{"listingId":"","packageId":"","packageName":"","vin":"","year":"","firstName":"","lastName":"","billingAddress":"","billingCity":"","billingState":"","zip":"","phone":"","price":"","mileage":"","sellerComments":"","email":"","expireDate":"","bodyStyle":{"code":"","name":""},"door":{"code":"","name":""},"drive":{"code":"","name":""},"engine":{"code":"","name":""},"exteriorColor":{"code":"","name":""},"fuel":{"code":"","name":""},"interiorColor":{"code":"","name":""},"make":{"code":"","name":""},"model":{"code":"","name":""},"transmission":{"code":"","name":""},"trim":{"code":"","name":""},"vehicleFeatures":[]}"></div>

 

In the above example need the data-value JSON and parse that to get different attributes like firstName and lastName.

Also using Selenium Java test. 


A
Ashish Thakur Replied on 06/02/2019

You can refer this link for JSON data extraction

https://stackoverflow.com/questions/20058240/extracting-data-from-json-array