BitrixAQA.Selenium.Framework.BitrixFramework.Host C# (CSharp) Method

Host() public static method

Метод возвращает хост из текущего урла. С http:// или без По умолчанию true - с http://
public static Host ( bool withhttp = true ) : string
withhttp bool true - c http(s)://, false - без
return string
        public static string Host(bool withhttp = true)
        {
            string pattern = "([a-z]+://[^/]+)/.*";

            if (!withhttp)
                pattern = "[a-z]+://([^/]+)/.*";

            string replacement = "$1";
            Regex rgx = new Regex(pattern);
            string result = rgx.Replace(WebDriver.Url, replacement);

            return result;
        }