Esempio n. 1
0
 public static ISelector GetSelector(ExtractBy extractBy)
 {
     string value = extractBy.Value;
     ISelector selector;
     switch (extractBy.Type)
     {
         case ExtractBy.ExtracType.Css:
             selector = new CssSelector(value);
             break;
         case ExtractBy.ExtracType.Regex:
             selector = new RegexSelector(value);
             break;
         case ExtractBy.ExtracType.XPath:
             selector = GetXpathSelector(value);
             break;
         case ExtractBy.ExtracType.JsonPath:
             selector = new JsonPathSelector(value);
             break;
         case ExtractBy.ExtracType.Enviroment:
             selector = new EnviromentSelector(value);
             break;
         default:
             selector = GetXpathSelector(value);
             break;
     }
     return selector;
 }
Esempio n. 2
0
 public void TestRegexWithLeftBracketQuoted()
 {
     string regex = "\\(.+";
     string source = "(hello world";
     RegexSelector regexSelector = new RegexSelector(regex);
     string select = regexSelector.Select(source);
     Assert.AreEqual(select, source);
 }
Esempio n. 3
0
        public ISelectable Regex(string regex, int group)
        {
            RegexSelector regexSelector = Selectors.Regex(regex, group);

            return(Select(regexSelector));
        }
Esempio n. 4
0
        public ISelectable Regex(string regex)
        {
            RegexSelector regexSelector = Selectors.Regex(regex);

            return(Select(regexSelector));
        }
Esempio n. 5
0
		public ISelectable Regex(string regex, int group)
		{
			RegexSelector regexSelector = Selectors.Regex(regex, group);
			return SelectList(regexSelector, GetSourceTexts());
		}