Back to Blog
Appium memory monitor5/20/2023 ![]() Right-click somewhere in the list and select “New > String”Ĥ. For the name of the preference type _directoryĥ. For its value type the path to where you want to store the cache ( path to the RAM Drive)Ħ. Next locate the preference, it must be set to true, if it is not, double-click on it to change its value Accept the warning message that appears, you will be taken to a list of preferences.ģ. Type about:config into the location bar and press enter.Ģ. Steps to Move Firefox Cache to RAM Driveġ. The first test that I performed was with Firefox, which cache files were moved to the RAM Drive. However, there is initial setup for every browser in order to move its files to the RAM Drive. The same code base is used for these series of tests. Selenium Tests Execution Time- 14.197 seconds Benchmark Selenium Tests Execution Time- Browser’s Files Stored on RAM Drive Also, you need to specify the location of the ChromeDriver.exe in the constructor. To use the ChromeDriver, the TestInitialize should be changed a little bit. Selenium Tests Execution Time- 56.112 seconds Chrome Driver Using Hard Driveĭefault Chrome user specific files location- C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default The default folder for Windows is %APPDATA%\Mozilla\Firefox\Profiles\ By the way by using the hard drive, I meant that the Firefox is storing all necessary files on the hard disk like cache files and user profiles. The initial version of the code is using FirefoxDriver. Finally, the results are stored in a file. The specified test is executed a predefined number of times (10). After that, a stopwatch starts measuring the selenium tests execution time. First the garbage collector is called to clean up. ![]() ![]() There the page’s document state is waited to be fully loaded though the WebDriver’s IJavaScriptExecuter.Īnother fascinating piece of code that is used is the Profile method. In order WebDriver to wait for a full page load, the code uses the WaitUntilLoaded method. The test itself is straightforward- it only navigates to several URLs. WriteLine( "Total: iterations) ",ĪvgElapsedMillisecondsPerRun, avgElapsedTicksPerRun, iterations) StreamWriter writer = new StreamWriter( resultsPath) Combine( desktopPath, "BenchmarkTestResults ", string. Private void Profile( string testResultsFileName, int iterations, Action actionToProfile) ExecuteScript( "return document.readyState "). WebDriverWait wait = new WebDriverWait( driver, TimeSpan. The following code is going to be used to measure the selenium tests speed against different browser configurations. The baseline for this research will be the selenium tests execution time against browsers that store their files on the Hard Drive. Benchmark Selenium Tests Execution Time- Browser’s Files Stored on Hard DriveĪll quality performance tests should contain a baseline against the rest of the results are going to be compared. Keep in mind that the program will take a real RAM of your machine so be sure that you have enough before proceeding with the experiments. Create a virtual RAM Drive (at least 1 GB) Download and install an RAM Drive SoftwareĢ. Find below all facts that break down the myth that you could make your browser fly if you put its files on an RAM drive. The tests were conducted against Hard Drive, SSD Drive, and RAM Drive. For my benchmarks, I used all the major browsers- Chrome, Firefox, Internet Explorer and the new Edge. However, after a full day of hard research work, I found out that I was going to lie to you if I put a headline like this. When I was starting to test my idea, I was planning to put some majestic headline like “Speed up Your WebDriver Tests 120% Through RAM”. I have been always curious if I could speed up my UI tests if the browser’s files (cache, profiles) are stored in RAM.
0 Comments
Read More
Leave a Reply. |