Пример #1
0
        public void CanLoadPageWithCredentialsRequired()
        {
            //Arrange
            _scrapper.ItemXPath = ".body-content table:first-child > tbody > tr";
            _scrapper.Url       = "http://payroll.localhost/EmployeeController/Index";
            _scrapper.Items     = new List <ScrapeItemSetting>
            {
                new ScrapeItemSetting {
                    Key = "Id", Selector = "td:first-child"
                }
            };

            var webQuery = new WebQuery(_scrapper.Url);

            webQuery.AddCookie(".AspNet.ApplicationCookie", "FnilTTTvqPOprOsZV-BoyctK7Av1WSPTwWRxjpM3uLF2zgvbwhjB1tZjJMXG4QFN6TSVBJS0J1NFr0U1P7D21Yj77pw7D4iyob_n60sGMPUELH_C63FlLxT4VlAn68ejs5rc3U0SMPcLHQrlPW-L12wX_RBqVckS7YLBqE9S6UVHLGTfqbymFxVMaismDJcd3ewTC-BOuo4wjB1Bns9EUbshUXhNUNmSFJtgw8soGHwsSuPPe3t4IBRHXxc2qeIyVNoB4m1rYXuFge6XtodBoMhGiDq_laCB5spoh7XI5UZC4hKDMfF4ms0r0wZSS-EXMmzy-vACIxR8XB8u9MH9If2M0l99B_AwfXZqg7PLdMq_ZoALOsTRyPGrXnvDRcWqIm6gmSVuZC-TEG8kqPcXgp18Gm6sUr-J4LAseLJan6UO2e6_2gsuGg8hZNBoggwE");
            webQuery.AddCookie("__RequestVerificationToken", "f503FWEz0K8zF21K5z5YD5YvS_5uF2QQ142IDC9toQtI--njNpXG0efNZcYamnz-A5zr0Hu9weET7lDWRt5PxW26hIgvBdUXDO-9EN3P59A1");

            //Act
            var result = _scrapper.AdvancedLoadPage();

            //Asserts
            Assert.That(result, Is.Not.Null);
        }