I am using coded UI platform for automation. If test case fails system automatic take screen shot but once it pass system is not able to capture screenshot of the test case. I am using C# selenium commands in the script.
Environment
- Visual studio premium 2012.
I tried following thing.
Enable a log trace in QTAgent32.exe.config ( ).
LoggerOverrideState = HtmlLoggerState.AllActionSnapshot; but getting error in LoggerOverrideState.
[TestMethod] public void demo2() { TestContext.WriteLine("Go to URL\n"); driver.Navigate().GoToUrl("http://www.test.com/"); driver.Manage().Window.Maximize(); // Enter username TestContext.WriteLine("TestContext Writeline: test context \n"); js.ExecuteScript("arguments[0].setAttribute('value','username')", driver.FindElement(By.XPath("//*[@id='txtUsername']"))); //Enter password js.ExecuteScript("arguments[0].setAttribute('value','password')", driver.FindElement(By.XPath("//*[@id='txtPassword']"))); // Click on the login Button js.ExecuteScript("arguments[0].click();", driver.FindElement(By.XPath("//*[@id='btLoginNow']")));