Updated to use AttributeSelector properties rather than manual parsing based on feedback from SLaks
Made handling more robust testing selector name and attribute name, and handling value without quotes