I used the code below from your website and also provided my APIKEY
from my account. The url is launched and the browser size is also set. When the first checkWindow()
function executes, I get a 401 Unauthorized exception.
using System;
using System.Drawing;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using Applitools;
namespace MyTests
{
public class TestApplitoolsWebsite
{
public static void Main(string[] args)
{
IWebDriver driver = new FirefoxDriver();
// This is your api key, make sure you use it in all your tests.
var eyes = new Eyes();
eyes.ApiKey = "YOUR_API_KEY";
try
{
// Start visual testing with browser viewport set to 1024x768.
// Make sure to use the returned driver from this point on.
driver = eyes.Open(driver, "Applitools", "Test Web Page", new Size(1024, 768));
driver.Navigate().GoToUrl("http://www.applitools.com");
// Visual validation point #1
eyes.CheckWindow("Main Page");
driver.FindElement(By.CssSelector(".features>a")).Click();
// Visual validation point #2
eyes.CheckWindow("Features Page");
// End visual testing. Validate visual correctness.
eyes.Close();
}
finally
{
eyes.AbortIfNotClosed();
driver.Quit();
}
}
}
}
The main purpose of Applitools API is that it will take screen shot and it will compare with baseline screen shot from my local. But during this checkWindow()
function i get the exception.