vivrichards600 / automatedvisualtesting Goto Github PK
View Code? Open in Web Editor NEWAutomating visual testing using Selenium WebDriver and C#.
License: Other
Automating visual testing using Selenium WebDriver and C#.
License: Other
With the current version of the ChromeDriver package, the tests fail because of this issue: webdriverio/webdriverio#2631
Updating the package to the latest (2.38.0) solves the issue for me ๐
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.
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!
The readme advises the following
// Create base image of web page by providing the WebDriver
SaveScreenShotByUrl(driver);
however this doesn't appear to be implemented as yet?
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!
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.