M
M
Michael2018-02-27 21:09:18
Python
Michael, 2018-02-27 21:09:18

RAM is melting before our eyes, I don’t understand what’s the matter?

After launching the application (and through PyCharm or cmd), after literally 10 minutes, the RAM is completely clogged, the virtual and then the physical memory starts to fill up, I can’t understand where the breakdown is and what’s actually the matter ..

from selenium import webdriver
import unittest

class UntitledTestCase(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Firefox('D:\profile')
        self.driver.implicitly_wait(3)

    def test_untitled_test_case(self):
        driver = self.driver
        driver.get("http://site.ru") 
        while True:

            nums = int(1)
            while nums != 16: 
                driver.find_element_by_xpath(u"{}{}{}{}".format("(//img[@alt='Комментарии'])","[",str(nums),"]")).click()
                nums += 1
                try:
                    driver.find_element_by_xpath(u"//img[@alt='Спасибо']").click()
                    driver.back()
                except:
                    driver.back()
            driver.find_element_by_link_text(u"След.").click()



if __name__ == "__main__":
    unittest.main()

5a95cacd8e6e7739569173.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey S., 2018-02-27
@moonz

while True:

What result did you want?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question