# FAQ

### Do I need to use a `save(Screen/Element/FullPageScreen)` methods when I want to run `check(Screen/Element/FullPageScreen)`?[​](#do-i-need-to-use-a-savescreenelementfullpagescreen-methods-when-i-want-to-run-checkscreenelementfullpagescreen "Direct link to do-i-need-to-use-a-savescreenelementfullpagescreen-methods-when-i-want-to-run-checkscreenelementfullpagescreen")

No, you don't need to do this. The `check(Screen/Element/FullPageScreen)` will do this automatically for you.

### My visual tests fail with a difference, how can I update my baseline?[​](#my-visual-tests-fail-with-a-difference-how-can-i-update-my-baseline "Direct link to My visual tests fail with a difference, how can I update my baseline?")

You can update the baseline images through the command line by adding the argument `--update-visual-baseline`. This will

* automatically copy the actual take screenshot and put it in the baseline folder
* if there are differences it will let the test pass because the baseline has been updated

**Usage:**

```
npm run test.local.desktop  --update-visual-baseline
```

When running logs info/debug mode you will see the following logs added

```
[0-0] ..............
[0-0] #####################################################################################
[0-0]  INFO:
[0-0]  Updated the actual image to
[0-0]  /Users/wswebcreation/Git/wdio/visual-testing/localBaseline/chromel/demo-chrome-1366x768.png
[0-0] #####################################################################################
[0-0] ..........
```

### Width and height cannot be negative[​](#width-and-height-cannot-be-negative "Direct link to Width and height cannot be negative")

It could be that the error `Width and height cannot be negative` is thrown. 9 out of 10 times this is related to creating an image of an element that is not in the view. Please be sure you always make sure the element in is in the view before you try to make an image of the element.

### Installation of Canvas on Windows failed with Node-Gyp logs[​](#installation-of-canvas-on-windows-failed-with-node-gyp-logs "Direct link to Installation of Canvas on Windows failed with Node-Gyp logs")

If you encounter issues with Canvas installation on Windows due to Node-Gyp errors, please note that this applies only to Version 4 and lower. To avoid these issues, consider updating to Version 5 or higher, which does not have these dependencies. Version 5 to 9 used [Jimp](https://github.com/jimp-dev/jimp) for image processing; Version 10 and up use [fast-png](https://github.com/image-js/fast-png) and [Pixelmatch](https://github.com/mapbox/pixelmatch) with no native dependencies.

If you still need to resolve the issues with Version 4, please check:

* the Node Canvas section in the [Getting Started](/docs/visual-testing.md#system-requirements) guide
* [this post](https://spin.atomicobject.com/2019/03/27/node-gyp-windows/) for Fixing Node-Gyp Issues on Windows. (Thanks to [IgorSasovets](https://github.com/IgorSasovets))

### I upgraded to v10, why are my visual tests failing?[​](#i-upgraded-to-v10-why-are-my-visual-tests-failing "Direct link to I upgraded to v10, why are my visual tests failing?")

The comparison engine changed from ResembleJS to [Pixelmatch](https://github.com/mapbox/pixelmatch) in v10. Pixelmatch uses a perceptual (YIQ) color model instead of raw RGB, so mismatch percentages differ from v9. Your tests haven't broken; the baselines just need to be regenerated once. Run your tests with `--update-visual-baseline` to accept the new values, or delete your baseline folder and let `autoSaveBaseline` recreate it.
