Beispiel #1
0
def getAllPermissionLogs(driver, headerUrl):
    '''
    Obtain all permission logs
    
    Arguments:
        driver(obj): firefox webdriver instance in python

    Returns:
        None
    '''
    driver.get(headerUrl + "Admin/View-Logs/Permission-Logs")
    time.sleep(2)
    driver.find_element_by_id("BodyContent_ButtonSearch").click()
    time.sleep(3)
    maxNumber = viewAccountPages(driver)
    number = 2
    directory = str(os.getcwd())
    while (number < maxNumber + 1):
        try:
            token = str(number) + "]/a"
            Xpath = paginationXpath + token
            savePermissionLogs(driver, directory)
            driver.find_element_by_xpath(Xpath).click()
            number += 1
        except:
            if (number == maxNumber):
                break
            number += 1
            driver.get(headerUrl + "Admin/View-Logs/Permission-Logs")
            time.sleep(2)
            driver.find_element_by_id("BodyContent_ButtonSearch").click()
            time.sleep(3)
            Xpath = paginationXpath + token
            driver.find_element_by_xpath(Xpath).click()
    savePermissionLogs(driver, directory)
Beispiel #2
0
def getAllResearcherInformation(driver, headerUrl):

    '''
    Obtains all the researcher information

    Arguments:
        driver(obj): firefox webdriver instance in python
    
    Returns:
        None
    '''
    driver.get(headerUrl + "Admin/Manage-Accounts/View")
    time.sleep(3)
    maxNumber = viewAccountPages(driver)
    number = 2
    directory = str(os.getcwd())
    while (number < maxNumber + 1):
        try:
            token = str(number) + "]/a"
            Xpath = paginationXpath + token
            getResearcherInformationOnePage(driver, directory)
            driver.find_element_by_xpath(Xpath).click()
            number += 1
        except:
            if (number == maxNumber):
                 break
            number += 1
            driver.get(headerUrl + "Admin/Manage-Accounts/View")
            Xpath = paginationXpath + token
            driver.find_element_by_xpath(Xpath).click()
    getResearcherInformationOnePage(driver, directory)
Beispiel #3
0
def getAllNric(driver, headerUrl):
    '''
    Obtains all the NRIC that is available in the database

    Arguments:
        driver(obj): firefox webdriver instance in python

    Returns:
        None
    '''
    driver.find_element_by_id('BodyContent_buttonLoginAdmin').click()
    driver.get(headerUrl + "Admin/Manage-Accounts/View")
    maxNumber = viewAccountPages(driver)
    number = 2
    directory = str(os.getcwd())
    file = createFile(directory)
    while (number < maxNumber + 1):
        try:
            token = str(number) + "]/a"
            Xpath = paginationXpath + token
            getAllNricInPage(driver, file, directory)
            driver.find_element_by_xpath(Xpath).click()
            number += 1
        except:
            if (number == maxNumber):
                break
            number += 1
            driver.get(headerUrl + "Admin/Manage-Accounts/View")
            Xpath = paginationXpath + token
            driver.find_element_by_xpath(Xpath).click()
    getAllNricInPage(driver, file, directory)
    file.close()
Beispiel #4
0
def getAllAccountLogs(driver, headerUrl):
    '''
    Save the all the account logs from all the webpages
    
    Arguments:
        driver(obj): firefox webdriver instance in python
    
    Returns:
        None
    '''
    driver.get(headerUrl + "Admin/View-Logs/Record-Logs")
    time.sleep(2)
    driver.find_element_by_id("BodyContent_ButtonSearch").click()
    time.sleep(3)
    maxNumber = viewAccountPages(driver)
    number = 2
    directory = str(os.getcwd())
    while (number < maxNumber + 1):
        try:
            token = str(number) + "]/a"
            Xpath = paginationXpath + token
            saveAccountLogs(driver, directory)
            driver.find_element_by_xpath(Xpath).click()
            number += 1
        except:
            number += 1
            driver.get(headerUrl + "Admin/View-Logs/Record-Logs")
            time.sleep(2)
            driver.find_element_by_id("BodyContent_ButtonSearch").click()
            time.sleep(3)
            if (number > maxNumber):
                break
            token = str(number) + "]/a"
            Xpath = paginationXpath + token
            driver.find_element_by_xpath(Xpath).click()
    saveAccountLogs(driver, directory)