def profile(self):
    """
    Runs the test specified by the test file given to the constructor, and returns a list of HAR files (one for each
    navigation)
    """

    # list of list of har files: [[hars from run 1], [hars from run 2], ...]
    iteration_hars = []

    for x in range(0, self._iterations):
      hars = []
      self.clear_http_cache()
      self.clear_cookies()

      # Navigate to about:blank, to reset memory, etc.
      self._page_event_handler = PageEventHandler()
      self.start_page_event_monitoring(self._page_event_handler.process_event)
      self.navigate_to('about:blank')
      wait_until(lambda: self._page_event_handler.page_loaded)
      self.stop_page_event_monitoring()

      for navigation in self._test['navigations']:
        assert len(navigation) > 0, 'Each navigation must have at least one action'

        # do all the actions except the last one, because the last action causes the actual page navigation
        for i in range(0, len(navigation) - 1):
          self.process_action(navigation[i])

        self._network_event_handler = NetworkEventHandler()
        try:
          wait_for_page_load_event = navigation[-1]['wait-for-page-load']
        except __HOLE__:
          wait_for_page_load_event = True
        try:
          self._page_load_notifier = PageLoadNotifier(wait_for_page_load_event, navigation[-1]['network-timeout'])
        except KeyError:
          self._page_load_notifier = PageLoadNotifier(wait_for_page_load_event)

        self._timeline_event_handler = TimelineEventHandler()
        self.start_network_monitoring(self._network_event_handler.process_event)
        self.start_timeline_monitoring(self._timeline_event_handler.process_event)
        self.start_page_event_monitoring(self._page_load_notifier.process_page_event)
        self._communicator.add_domain_callback('Network', 'page_load_notifier', self._page_load_notifier.process_network_event)
        self._communicator.add_domain_callback('Timeline', 'page_load_notifier', self._page_load_notifier.process_timeline_event)
        self.start_css_selector_profiling()
        self.process_action(navigation[-1])

        wait_until(lambda: self._page_load_notifier.page_loaded())
        self.stop_page_event_monitoring()
        self.stop_timeline_monitoring()
        self.stop_network_monitoring()
        self._css_profiler_handler = CSSProfileParser(self.stop_css_selector_profiling())

        hars.append(self.make_har(navigation[-1]['page-name']))

      iteration_hars.append(hars)

    return iteration_hars
dataset/ETHPy150Open linkedin/mobster/src/linkedin/mobster/har/flowprofiler.py/FlowProfiler.profile