I want to create an automated Protractor test that creates a heap snapshot after opening the application in Chrome and after performing a series of actions via protractor.
Then to upload in Chrome dev tools in the memory tab both snapshots and compare them. The problem is that the application classes are not available in the snapshot, only test related information.
Is there a way to do this while running Protractor tests? The snapshot libraries I've tried are heapdump, v8-profiler-next and several others but with the same result.
Thanks!
Related
I have download OHIF code and build using yarn install on both root folder and viewer folder inside platform folder in Windows 10.
I can access the OHIF viewer successfully #localhost:3000 and also ipaddress:3000, but am not able to access it from a different machine using ipaddress:3000.
I am able to run various other application on different ports and access it publicly but in case of OHIF it doesn't work.
Am I missing anything?
And one more problem is OHIF creates almost 50MB file from 'yarn run dev' command and everytime I have to load 50MB on page load. Is there any way to compress the OHIF library by building it.
am not able to access it from a different machine using ipaddress:3000
I believe you would need to tweak the WebPack configuration: https://stackoverflow.com/a/35419631/1867984
The webpack-dev-server is not meant to host the application for production use. Ideally, you build the files and host them using a production ready web server. You have a lot of different options here. Check out: https://docs.ohif.org/deployment/recipes/static-assets.html
I have to load 50MB on page load. Is there any way to compress the OHIF library by building it.
If you run the production build with minification and treeshaking, the size drops to 15 MB. You can further lower this by pruning any extensions you don't intend to use.
Also, most of these assets aren't render blocking. Some codesplitting is used to lazy load portions of the application after the critical portions are loaded. This could still be improved.
We have a windows client that our QA team wrote coded UI tests for. I'm trying to get OpenCover to work so we can see how much of the app their tests are really hitting. They wrote their tests using a custom framework on top of the MSTest framework.
Their framework uses ApplicationUnderTest.Launch to start the application as different users to test security settings. I can capture coverage of the test dlls but the application it self.
I've forced the app to build in 32bit, made sure all pdbs are present in the folders and included the pdb directory in the targetdir as well.
Has anyone else seen this issue? I also tried replacing my batch file with a wrapper exe and got coverage for that but not the main application. Everything is running as the user they are starting the application as who is also an admin on the machine.
The command I'm running is:
C:\Users\kkindt.CORP\AppData\Local\Apps\OpenCover\OpenCover.Console.exe -register "-target:C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" -output:C:\CodeCoverage\CollectionResults\CodedUICover.xml "-targetargs:C:\CodeCoverage\Tests\EllisWinAppTest.dll /Platform:x86 /Framework:framework40 /Tests:LaunchEllisTest"
I strongly suspect it is due to how you are launching the application under test
OpenCover is a .NET profiler and for .NET application to be launched with a profiler attached requires some environment variables to be available to the new process. I suspect that ApplicationUnderTest.Launch does not propagate all the current environment variables and so the profiler does not start and therefore does not report coverage.
To get this to work you should look into using the ApplicationUnderTest.Launch overload that uses a ProcessStartInfo and then you need to propagate the following environment variables
Cor_Profiler
Cor_Enable_Profiling
OpenCover_Profiler_Key
OpenCover_Profiler_Namespace
OpenCover_Profiler_Threshold
OpenCover_Profiler_TraceByTest (if available)
The Cor_* are required by the runtime to launch a profiler and the OpenCover_* entries are to allow the profiler and the host to find each other - a list of these environment variables are available on github
i have created unit tests for my web project but i have come across an error whereby the tests are being ignored and Visual Studio 2012 is running my localhost instead. i cannot use localhost to run my tests as there are a lot of java resources and overlays which aren't displayed. Essentially that is the point to UI testing that you test the correct interface.
The code i used in a blank project - runs perfectly and completes the test with no issues but since i need to include this into my web project, i need a way to stop Visual Studio running the localhost and get it to execute the console application test so that my selenium webdriver can run the test properly.
using: Visual Studio 2012
Selenium (webdriver)
chrome driver (latest version)
c#.Net
example code:
IWebDriver _driver;
ChromeOptions options = new ChromeOptions();
options.AddArgument("--start-maximized");
_driver = new ChromeDriver(options);
_driver.Url = "http://theURLimTesting.com/";
var verificationErrors = new StringBuilder();
_driver.Navigate().GoToUrl("http://theURLimTesting.com/");
_driver.FindElement(By.Id("Username")).Clear();
if anyone could help me and provide a solution as to how to run these tests without excluding them from the project and without having to create a proxy - i would be very grateful, as i am very much a novice.
UPDATE: as #mutt 's answer helped steer me towards the right direction with being able to resolve my question i marked the answer as right - i have managed to configure the error and create a work around and tweaking some settings to get this to work and now i can run all tests inside of the web application properly and they all function properly with executing and closing themselves in the background when done.
Separate your unit tests from the web project and it should work. Since you have them together your webapp probably has a default start page so when you "play" it will load that and VS is scoped to that browser running on IIS Express instead of the regular browser.
Personally I would have thought it would still work since Selenium is hitting the driver package that is referencing the browser, but I'm not sure what all VS is doing when it runs the webapp. If you want it with the console then move all your unit tests to the console project and they should still work on the WebApp because they will be hitting the server version and not the locally run project.
Update:
It looks like it is process bound. So Selenium and visual studio are sharing the same process. VS2008 debugging with firefox as default browser - how to make the debugger stop/close on exit?
Update2:
It looks like you should be able to determine if the process is being utilized. Then the question would be can you just kill it in your unit test script so that it will be forced to create a new one... Programmatically determine if code is running under IIS Express
Is there any way to take a heap snapshot from a running Node.js process and then load it into the Google Chrome profiles viewer? It would be very awesome to be able to use the really useful Chrome profiles tab to view Node.js snapshots.
If it is possible to do, can someone provide a step-by-step of how to produce a snapshot in Node.js and then load it into Chrome?
There is an NPM module to do this.
https://github.com/bnoordhuis/node-heapdump
Just require() the module and then you can send kill -USR2 to the node process. It creates a V8 heap dump that you can view in Chrome.
I am using YUI to test my JavaScript app, and want to integrate the test results into my CruiseControl build system. How can I use CruiseControl to run the tests? I initially thought about using the JUnit plugin to drive the tests, but that is a no go.
Does anyone else have this working?
(Please note: Changing either YUI or CruiseControl isn't an option for me.)
We have YUI Tests integrated with Hudson for our CI builds. The process should be pretty identical for CC, since we kick off the testing through a Java task in ANT.
We have a selenium driver (a java impl - we're working on making it public) which talks to a SeleniumRC instance, pointing it to the HTML files in build workspace to run tests.
You could take a stab at writing your own selenium driver:
http://seleniumhq.org/docs/05_selenium_rc.html#learning-the-api
The driver code talks to a SeleniumRC instance, and asks it kick off a browser pointing to the YUI Test based HTML test files from the build.
The HTML files run YUI Test Runner on load, and the driver injects code on page load, to pick up test results from YUI Test Runner when it's done running, and store them as files for Hudson to parse.
Regards,
Satyen
YUI Team
My solution, in the end, is a bit of a hack.
I modified our test runner HTML page to post the test results (the entire XML object that it creates) to a PHP page, then to close itself.
I added a PHP page to the build server (with a PHP processor attached to an Apache HTTPD instance) to accept the posted XML document and save it to disk.
The unit tests are now run by a 'test driver', which fires up a browser with the test runner HTML page, and waits for the browser process to end.
This gets the output of the tests onto the local disk of the build server. I then merge the output file into the CC log by adding the following to the project configuration:
<log>
<merge file="path_to_file" />
</log>
There are a few drawbacks, but are (currently) willing to live with them:
Had to introduce a test runner app to the infrastructure
Had to add an Apache server and PHP processor to the build machine
Because only IE will allow a browser page to close itself without a user prompt, the build server must be a Windows machine.