Error HRESULT E_FAIL has been returned from a call to a COM component in Get attribute activity

This got resolved by changing the scope of item variable in Find children activity from for each loop to whole sequence and changing Type argument property of For each activity to UiElement.