Wednesday, November 23, 2016

First matching record using XPATH query

In order to select first matching record found using XPATH query I used

(//div[@class='container']//h1[@class='page-header'])[1]   instead of //div[@class='container']//h1[@class='page-header'][1]

Thursday, November 10, 2016

Web Request using PowerShell and Parse JSON response as PowerShell object

To send web request and read JSON response using PowerShell I used following commands

$response = Invoke-WebRequest -Uri "" -Method Get -Headers @{"apikey"="toekn"}
$responseAsPSObject = $response.Content | ConvertFrom-Json
$myValue = $responseAsPSObject.Value."mykey"
Write-Host "$myValue"