Giter Site home page Giter Site logo

automatedvisualtesting's People

Contributors

jamesehearn avatar vivrichards600 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automatedvisualtesting's Issues

Out of Memory Exception

Out of Memory Exception at System.Drawing.Bitmap.Clone(Rectangle rect, PixelFormat format)

When using the Differences(string baseImage, string element, IWebDriver driver, ComparisonOptions options = null) method.

Does not happen with ALL tests that use this method, only some. When it fails, it fails consistently. Does it have to do with the element to compare being larger than a page? I'm trying to compare a div element that takes up most of the page when it fails. I've included the StackTrace below (with the non-essential bits X'd out).

Happens with multiple browsers/drivers.

Let me know what other info you need that could help out.

Result StackTrace:
at System.Drawing.Bitmap.Clone(Rectangle rect, PixelFormat format)
at AutomatedVisualTesting.Utilities.SeleniumDriver.GetScreenshotOfElement(IWebDriver driver, String elementSelector)
at AutomatedVisualTesting.Utilities.Compare.Differences(String baseImage, String element, IWebDriver driver, ComparisonOptions options)
at VisualRegressionTesting.XXX.XXX.XXX() in C:\Users\XXX
Result Message: System.OutOfMemoryException : Out of memory.

Blur focus before comparing

A problem that I run into is that sometimes the blinking cursor is displayed when the image is created form the web page to be tested, so false positives are sometimes displayed. Worse is that these false positives are intermittent, depending on the exact time the image is created.

What's needed is some kind of way to remove the blinking cursor form the page so it's in an identical state each time.

What I've been doing that has worked so far is (since I'm using this with Selenium) to have Selenium execute document.activeElement.blur(). That removes the focus form the page entirely, right? My JavaScript is a bit rusty/lacking.

Would be even better to have this as a ComparisonOption, that runs the blur JS command before the image is saved, I think.

Anybody else have this issue?

I imagine there are circumstances when you'd want the focus on the page to compare as well, but not for my current project.

Will work on this myself, and let you know if anything comes of it. Thanks for letting me take part!

Change to Settings for .NET Core support?

Is your feature request related to a problem? Please describe.
We are developing our automated tests in .NET Core, and I am encountering errors when I run tests as it does not use app.config to find the TestDataDirectory.

Describe the solution you'd like
We would like to be able to be able to assign the directory location another way, a string, or perhaps through appsettings.json.

Describe alternatives you've considered
I have attempted to find another way to override the app.config settings, but alas my coding knowledge may be limited.

Thanks for the consideration!

Issues with TestContext being initialized outside the assembly

As TestContext is initialised in the assembly it runs once before any testing this means that all tests ran within the same testing session even if they are in different test classes all use the same TestContext if the test fails it will show as passed if the previous test passed.

It appears the only way to get around this is to manually run one test at a time.

It may be worthwhile initalising TestClass within the UITestBindingBase TestInitialize method rather than the seperate InitializeTestContext TestClass.

Hope that makes sense
Regards

Brett

OutOfMemory exception if element is bigger than page

var croppedImage = new Rectangle(pixelRatio * element.Location.X, pixelRatio * element.Location.Y, pixelRatio * element.Size.Width, pixelRatio * element.Size.Height); screenshot = screenshot.Clone(croppedImage, screenshot.PixelFormat);

This line will throw a critical exception if the element overflows page, because it is attempting to crop more (element size) than the size of the bitmap (page size). See: https://stackoverflow.com/questions/199468/c-sharp-image-clone-out-of-memory-exception
It might be beneficial to restrict the max size of the crop to bitmap size to avoid this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.