
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.Upgrade Firefox version to Firefox v65.0.2 levels.Upgrade GeckoDriver to GeckoDriver v0.24.0 level.Upgrade Selenium to current levels Version 3.141.59.You can implement either/all of the generic/specific steps as follows: Firefox uses RAM to make its processes faster since application data is transferred much faster in RAM.

However as per this discussion some of the users feels that the more memory is used the better because it means you don't have RAM wasted. There were previous instances when Firefox consumed about 80% of the RAM. You can find a detailed discussion in How to sleep webdriver in python for milliseconds Also, the suspension time may be longer than requested by an arbitrary amount because of the scheduling of other activity in the system. The actual suspension time may be less than that requested because any caught signal will terminate the sleep() following execution of that signal’s catching routine. The argument may be a floating point number to indicate a more precise sleep time.

Time.sleep(secs) suspends the execution of the current thread for the given number of seconds. However while using Selenium and WebDriver to execute tests through your Automation Framework, using time.sleep() without any specific condition defeats the purpose of automation and should be avoided at any cost.

Inducing time.sleep() virtually puts a blanket over the underlying issue. So, the first and foremost task would be to break up the infinite loop pertaining to your usecase into smaller Tests. Mozilla goes back and forth between user profiles and notifications page on Instagram and does tasks based on what it finds is too broad as a single usecase. To start with Selenium have very little control over the amount of RAM used by Firefox.
