Example #1
0
    def test_02_empty_core_percentage(self):
        driver1 = self.driver1
        memory = "60"
        core = ""
        path = "/mnt/rapt/tensorflow-UI"
        myurl = Myurl(self.driver1)
        myurl.access_url()
        #self.driver1.get("http://54.201.43.175:3010/users/login")
        sleep(3)

        cookies = pickle.load(open("cookies.pkl", "rb"))
        # print("get cookie vlaues ", cookies)
        sleep(1)
        for cookie_dict in cookies:
            driver1.add_cookie(cookie_dict)
            # print("this is for loop")
        #self.driver1.get("http://54.201.43.175:3010/accessUI/5c7e501310ec7c705d33423c")
        myurl.acces_user()

        raptui = RaptUi(driver1)
        raptui.T_Flow()
        print("Selected Tensorflow")
        sleep(1)
        # tensorflow.inception()
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        # inception = self.driver1.find_elements_by_xpath("(//*[@class='card border border-primary'])[0]")
        inception.click()
        sleep(1)
        print("Selected Inception")
        raptui.Localfolder()
        sleep(1)

        raptui.set_localpath(path)
        sleep(1)
        print("Your given path ", path)
        raptui.Gpu()
        sleep(1)
        raptui.Manual()
        sleep(1)
        print("Your selected Manual")
        # raptui.set_Memorypercentage("80")
        memoryper = self.driver1.find_element(By.ID, 'gpupercent0')
        memoryper.send_keys(memory)
        sleep(1)
        print("Memory percetage :", memory, "%")
        coreper = self.driver1.find_element(By.ID, 'gpuvalue0')
        coreper.send_keys(core)
        sleep(1)
        print("Core percetage :", core, "%")
        raptui.Setupbtn()
        sleep(2)
        # -------- Alert start ----------------
        # Switch the control to the Alert window
        obj = driver1.switch_to.alert
        sleep(2)
        # Retrieve the message on the Alert window
        msg = obj.text
        print("Alert shows following message: " + msg)
        sleep(2)
        # use the accept() method to accept the alert
        obj.accept()
        sleep(5)
        # ------------ Alert end -------------
        try:

            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))
Example #2
0
    def test_13_empty_train_directory(self):
        driver1 = self.driver1
        memory = "40"
        core = "90"
        myurl = Myurl(self.driver1)
        myurl.access_url()
        #self.driver1.get("http://54.201.43.175:3010/users/login")
        sleep(2)

        cookies = pickle.load(open("cookies.pkl", "rb"))
        # print("get cookie vlaues ", cookies)
        sleep(1)
        for cookie_dict in cookies:
            driver1.add_cookie(cookie_dict)
            # print("this is for loop")
        #self.driver1.get("http://54.201.43.175:3010/accessUI/5c7e501310ec7c705d33423c")
        myurl.acces_user()

        raptui = RaptUi(driver1)
        raptui.T_Flow()
        print("Selected Tensorflow")
        sleep(1)
        # tensorflow.inception()
        inception = self.driver1.find_element_by_xpath(
            "//*[@class='card-body text-center font-weight-normal btnNext']")
        # inception = self.driver1.find_elements_by_xpath("(//*[@class='card border border-primary'])[0]")
        inception.click()
        sleep(1)

        raptui.Localfolder()
        path = "/mnt/rapt/tensorflow-UI"
        sleep(1)
        raptui.set_localpath(path)
        sleep(1)
        print("Your given path ", path)
        raptui.Gpu()
        sleep(1)
        raptui.Manual()
        sleep(1)
        print("Selected Manual")

        memoryper = self.driver1.find_element(By.ID, 'gpupercent0')

        memoryper.send_keys(memory)
        sleep(1)
        print("Memory percentage :", memory)
        coreper = self.driver1.find_element(By.ID, 'gpuvalue0')
        coreper.send_keys(core)
        sleep(1)
        print("Core percentage :", core)
        raptui.Setupbtn()
        sleep(23)
        traindir = self.driver1.find_element(By.ID, 'traindirectory')
        trdirectory = Select(traindir)
        trdirectory.select_by_visible_text("Mnist_classification")
        sleep(2)
        trinfile = self.driver1.find_element(By.ID, 'file_name')
        trfile = Select(trinfile)
        trfile.select_by_visible_text("mnist_gpu.py")
        sleep(2)
        traindir = self.driver1.find_element(By.ID, 'traindirectory')
        trdirectory = Select(traindir)
        trdirectory.select_by_visible_text("Select File")
        sleep(2)
        nextbtn = self.driver1.find_element_by_xpath(
            "//*[@class='btnTrain btn btn-secondary float-lg-right ml-2']")
        nextbtn.click()
        # -------- Alert start ----------------
        # Switch the control to the Alert window
        obj = driver1.switch_to.alert
        sleep(2)
        # Retrieve the message on the Alert window
        msg = obj.text
        print("Alert shows following message: " + msg)
        sleep(2)
        # use the accept() method to accept the alert
        obj.accept()
        sleep(3)
        # ------------ Alert end -------------
        #raptui.Train()
        sleep(1)
        #raptui.TrainButton()
        sleep(5)

        try:

            pass
        except Exception as e:
            print("Exception Occurred :" + str(e))