public string Invoke(string xpathExpression, string responseId = null)
        {
            var response = XDocument.Parse(SoapClient.GetResponseContent(responseId));

            if (response.XPathSelectElements(xpathExpression).Any())
            {
                return("true");
            }

            throw new AssertionException("Element exists", "Element does not exist", WebDrivers.Default);
        }
Esempio n. 2
0
        public string Invoke(string xpathExpression, string expectedValue, string responseId = null)
        {
            var response = XDocument.Parse(SoapClient.GetResponseContent(responseId));
            var value    = response.XPathSelectElement(xpathExpression).Descendants().First().Value;

            if (value != expectedValue)
            {
                throw new AssertionException(value, expectedValue, WebDrivers.Default);
            }

            return("true");
        }
        public string Invoke(string requiredContent, string responseId = null)
        {
            var response = SoapClient.GetResponseContent(responseId);

            if (response.ToString().Contains(requiredContent))
            {
                throw new AssertionException(
                          $"Response should not contain {requiredContent}",
                          $"Response contains",
                          WebDrivers.Default);
            }

            return("true");
        }