Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Mar 19, 2022
1 parent 5c4247c commit fda60f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lombiq.Tests.UI/Docs/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

- A difference in the results of a normal and headless execution is almost always because of different window sizes since headless mode uses small browser windows by default (if this is the case, you should see the issue right away from the failure dump's screenshot). To overcome this, always set the browser window's size explicitly with `SetBrowserSize()` (which is a good practice anyway, because otherwise in normal mode it won't be reliable either). Note that if you switch windows/tabs during the test you may need to set the browser size again.
- To further figure out why headless execution is different try the following:
- Save screenshots (with e.g. `context.Driver.GetScreenshot().SaveAsFile()`) in between steps in the test to see what actually happens. Similarly, you can save the HTML source of the page on each step (with e.g. `File.WriteAllText("Source.html", context.Scope.Driver.PageSource)`).
- Just as during normal execution attach the debugger to see the failing step in action. At that point, you can access the app by its URL (it's in `context.Driver.Url`) from a normal browser and look around to see what the problem may be. Alternatively, for Chrome you can configure a remote debugging port via `BrowserConfiguration.BrowserOptionsConfigurator` with e.g. `((ChromeOptions)options).AddArgument("--remote-debugging-port=9222");`. Then if you open http://localhost:9222/ you'll be able to instruct the headless browser instance. During test execution you'll also be able to watch the test running. See the [Headless Chromium docs](https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md) for details.
- Save screenshots (with e.g. `context.Driver.GetScreenshot().SaveAsFile()`) in between steps in the test to see what actually happens (screenshots are taken automatically after each page load). Similarly, you can save the HTML source of the page on each step (with e.g. `File.WriteAllText("Source.html", context.Scope.Driver.PageSource)`).
- Just as during normal execution, attach the debugger to see the failing step in action. At that point, you can access the app by its URL (it's in `context.Driver.Url`) from a normal browser and look around to see what the problem may be. Alternatively, for Chrome you can configure a remote debugging port via `BrowserConfiguration.BrowserOptionsConfigurator` with e.g. `((ChromeOptions)options).AddArgument("--remote-debugging-port=9222");`. Then if you open http://localhost:9222/ you'll be able to instruct the headless browser instance. During test execution you'll also be able to watch the test running. See the [Headless Chromium docs](https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md) for details.


## SQL Server
Expand Down

0 comments on commit fda60f0

Please sign in to comment.