diff --git a/test/SeleniumIbrahim/test_kit/DUMMY_SUBMISSION.txt b/test/SeleniumIbrahim/test_kit/DUMMY_SUBMISSION.txt new file mode 100644 index 0000000..d8cfb2c --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/DUMMY_SUBMISSION.txt @@ -0,0 +1,2 @@ +THIS IS A DUMMY SUBMISSION FILE FOR TESTING PURPOSES. +MAKE SURE TO KEEP THIS FILE IN THE SAME DIRECTORY AS THE TESTING SCRIPTS. \ No newline at end of file diff --git a/test/SeleniumIbrahim/test_kit/Error_log.txt b/test/SeleniumIbrahim/test_kit/Error_log.txt new file mode 100644 index 0000000..d151ed7 --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/Error_log.txt @@ -0,0 +1,318 @@ +[ERROR]14/04/2021-00:41:55>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 38, in create_new_account + new_account_form = wait2.until(presence_of_element_located(By.ID, "frm_create_acc")) +NameError: name 'presence_of_element_located' is not defined + +[ERROR]14/04/2021-00:42:58>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 38, in create_new_account + new_account_form = wait2.until(EC.presence_of_element_located(By.ID, "frm_create_acc")) +TypeError: __init__() takes 2 positional arguments but 3 were given + +[ERROR]14/04/2021-00:44:31>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 41, in create_new_account + name_field = new_account_form.find_element(By.XPATH, "//form[@id='frm_create_acc']\ + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 658, in find_element + return self._execute(Command.FIND_CHILD_ELEMENT, + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //form[@id='frm_create_acc'] /input[@name='name' because of the following error: +SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//form[@id='frm_create_acc'] /input[@name='name'' is not a valid XPath expression. + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-00:45:59>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 41, in create_new_account + name_field = new_account_form.find_element(By.XPATH, "//form[@id='frm_create_acc']/input[@name='name'") + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 658, in find_element + return self._execute(Command.FIND_CHILD_ELEMENT, + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //form[@id='frm_create_acc']/input[@name='name' because of the following error: +SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//form[@id='frm_create_acc']/input[@name='name'' is not a valid XPath expression. + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-00:47:04>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 41, in create_new_account + name_field = new_account_form.find_element(By.XPATH, "//form[@id='frm_create_acc']\ + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 658, in find_element + return self._execute(Command.FIND_CHILD_ELEMENT, + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//form[@id='frm_create_acc'] /input[@name='name']"} + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-00:47:44>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 41, in create_new_account + name_field = new_account_form.find_element(By.XPATH, "//form[@id='frm_create_acc']/input[@name='name']") + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 658, in find_element + return self._execute(Command.FIND_CHILD_ELEMENT, + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//form[@id='frm_create_acc']/input[@name='name']"} + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-00:49:28>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 41, in create_new_account + name_field = new_account_form.find_element(By.XPATH, "//form[@id='frm_create_acc']/input[@name='Full Name']") + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 658, in find_element + return self._execute(Command.FIND_CHILD_ELEMENT, + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//form[@id='frm_create_acc']/input[@name='Full Name']"} + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-00:51:31>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 41, in create_new_account + name_field = new_account_form.find_element(By.XPATH, "//input[@name='Full Name']") + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 658, in find_element + return self._execute(Command.FIND_CHILD_ELEMENT, + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@name='Full Name']"} + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-13:56:18>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 139, in account_block_activate + exist_acc_tab = wait2.until(EC.presence_of_element_located((By.XPATH, "/html/body/div[2]/div[1]/div/ul/li[3]/a"))) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until + raise TimeoutException(message, screen, stacktrace) +selenium.common.exceptions.TimeoutException: Message: + + +[ERROR]14/04/2021-13:57:14>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 150, in account_block_activate + block_btn.click() + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click + self._execute(Command.CLICK_ELEMENT) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (582, 469). Other element would receive the click: + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-13:58:01>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 150, in account_block_activate + block_btn.click() + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click + self._execute(Command.CLICK_ELEMENT) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (574, 469). Other element would receive the click: + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-14:02:29>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 149, in account_block_activate + block_btn = wait3.until(EC.presence_of_element_located((By.LINK_TEXT, "Block"))) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until + raise TimeoutException(message, screen, stacktrace) +selenium.common.exceptions.TimeoutException: Message: + + +[ERROR]14/04/2021-14:15:58>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 144, in account_block_activate + exist_acc_tab = wait2.until(EC.presence_of_element_located((By.ID, "acc_table"))) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until + raise TimeoutException(message, screen, stacktrace) +selenium.common.exceptions.TimeoutException: Message: + + +[ERROR]14/04/2021-14:18:19>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 145, in account_block_activate + exist_acc_tab.click() + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click + self._execute(Command.CLICK_ELEMENT) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-14:19:23>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 47, in getSession + driver.get(self.getPageURL()) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get + self.execute(Command.GET, {'url': url}) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status +from disconnected: received Inspector.detached event + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-14:19:28>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 47, in getSession + driver.get(self.getPageURL()) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get + self.execute(Command.GET, {'url': url}) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status +from disconnected: received Inspector.detached event + (Session info: chrome=89.0.4389.114) + + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 70, in login + driver = self.getSession() + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 55, in getSession + self.killSession(driver) + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 145, in killSession + driver.close() + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 688, in close + self.execute(Command.CLOSE) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.WebDriverException: Message: chrome not reachable + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-14:19:28>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 47, in getSession + driver.get(self.getPageURL()) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get + self.execute(Command.GET, {'url': url}) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status +from disconnected: received Inspector.detached event + (Session info: chrome=89.0.4389.114) + + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 70, in login + driver = self.getSession() + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 55, in getSession + self.killSession(driver) + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 145, in killSession + driver.close() + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 688, in close + self.execute(Command.CLOSE) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.WebDriverException: Message: chrome not reachable + (Session info: chrome=89.0.4389.114) + + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 135, in account_block_activate + driver = self.utility.login(self) + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\utility.py", line 85, in login + self.killSession(driver) +UnboundLocalError: local variable 'driver' referenced before assignment + +[ERROR]14/04/2021-14:23:07>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 150, in account_block_activate + block_btn.click() + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click + self._execute(Command.CLICK_ELEMENT) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (574, 469). Other element would receive the click: + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-14:32:06>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 149, in account_block_activate + block_btn = wait2.until(EC.presence_of_element_located((By.XPATH, "//table[@id='acc_table']/button[@id='block_acc_1']"))) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until + raise TimeoutException(message, screen, stacktrace) +selenium.common.exceptions.TimeoutException: Message: + + +[ERROR]14/04/2021-14:34:01>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 150, in account_block_activate + block_btn.find_element(By.LINK_TEXT, "Block").click() + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 658, in find_element + return self._execute(Command.FIND_CHILD_ELEMENT, + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"link text","selector":"Block"} + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-14:35:58>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 151, in account_block_activate + block_btn.click() + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click + self._execute(Command.CLICK_ELEMENT) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute + return self._parent.execute(command, params) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute + self.error_handler.check_response(response) + File "C:\Users\Ibrahim\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response + raise exception_class(message, screen, stacktrace) +selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (574, 469). Other element would receive the click: + (Session info: chrome=89.0.4389.114) + + +[ERROR]14/04/2021-16:41:19>Traceback (most recent call last): + File "D:\Graduation Thesis\LRR workstation\Testing Workstation\test_github\LRR\test_kit\admin.py", line 206, in assign_TA + assign_btn,click() +NameError: name 'click' is not defined + diff --git a/test/SeleniumIbrahim/test_kit/README.md b/test/SeleniumIbrahim/test_kit/README.md new file mode 100644 index 0000000..9547109 --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/README.md @@ -0,0 +1,75 @@ +# Important notes +Before executing this test suite, there are several things need to be setup and taken into considaration. + +# Setup test environment +These test scripts are written using Python, uses selenium webdriver for automation, and pytest for test execution and reporting. Hence, you have to install +Python on your machine, then pip install selenium webdriver and pytest-selenium libraries. + +Here we guide you through the installation of selenium and pytest-selenium only assuming that you already have Python environment on your machine. If not, visit +[the official Python page](https://www.python.org/downloads/) to download and install Python. + +## Selenium webdriver +Since Selenium supports many web browsers and each browser has its own webdriver, first you will need to download +[Google chrome webdriver](https://sites.google.com/a/chromium.org/chromedriver/downloads). +> **_NOTE:_** Make sure to download the suitable webdriver to your version of Google chrome browser + +Then, add the webdriver to your system environment variables so it would be accessible by the scripts without the need to excplicitly attach the webdriver to the test kit directory. +To achieve that: +1- left click on **This PC**, then choose **properties**. +2- choose **Advanced system settings**. +3- choose **Environment variables**. +4- under **System variables** double-click on **path**. +5- choose **New**, copy and paste path to the downloaded webdriver executable. +> **_NOTE:_** To avoid problems with long path strings, it is recommended that you create a folder in your `C:\` drive such as: +> `C:\webdriver\bin` and append the webdriver executable into it. + +To test if everything is working fine, open a command prompt and issue the following command: +>`C:\> chromedriver` + +You should get something like the following: + +>`Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784}) on port 9515` +>`Only local connections are allowed.` +>`Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.` +>`ChromeDriver was started successfully.` + +After that, pip install selenium library using the following command on your command prompt: + +>`C:\> pip install selenium` + +That is all for selenium, next we guide you through installing pytest-selenium. + +## Pytest-selenium +Simply, on a command prompt issue the following command: +>`C:\ pip install pytest-selenium` + +For more details about pytest-selenium visit [this page](https://pytest-selenium.readthedocs.io/en/latest/installing.html). + +# Text files descriptions + +As you have noticed already, there are several `.txt` files in the test kit folder, namely: +* course_code.txt +* DUMMY_SUBMISSION.txt +* Error_log.txt +* student_ids.txt +* Test_Users.txt + +Each file is essential to the automation operation in some sense, for example `course_code.txt` works as a short-term memory to store course codes created by the automation +scripts in some test cases that needed to be used later in a subsequent test cases that requires the same course code to successfully run the test case. And `DUMMY_SUBMISSION.txt` that is used as a dummy file to be submitted during execution of lab report submission test case. +`Error_log.txt` is used for debugging and keeping track of problems encountered during test execution. +`student_ids.txt` is a static memory to store several student IDs pre-inserted into `student_data` table of `lrr` database and used by signup test case automation. +`Test_Users.txt` not used by the scripts, but contains two main system actors, namely, instructor and student accounts credentials that is provided manually inside the test scripts to carry out different operations for different system users. + +# Running the test suite + +> **_NOTE:_** Before running the test suite make sure that you have followed [these instructions](https://github.com/hema-001/LRR#installation-instructions) on how to install and run LRR on your machine. + +On the same local directory of your branch of LRR, and after you have done your contribution to the source code whether it is a bug fix or a feature integration and before committing your changes, you should run this regression test suite to prevent the addition of new bugs to the source code, and to ensure master repo consistency. + +Open a command prompt and issue the following command: +>`C:\ pytest --html test_report_xxxx_yyyy.html` + +The option `--html` tells pytest to generate an HTML test report with test execution results, which is useful and later must be provided before merging new pull requests to master repo. +`test_report_xxxx_yyyy.html` is the name of the HTML file to be generated after the completion of test execution. Where `xxxx` stands for the date string, for example `10032021` translates to March 3rd 2021, and `yyyy` stands for now time of test execution, for example `1955` translates to 19:55. +After running the command and if everything is setup correctly, you should see series of web automations for different main functions of LRR. +Finally, an HTML test report file will be generated just like the example test report in the test kit folder `example_test_report_09032021_1927.html`. diff --git a/test/SeleniumIbrahim/test_kit/Test_Users.txt b/test/SeleniumIbrahim/test_kit/Test_Users.txt new file mode 100644 index 0000000..bcd2a0c --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/Test_Users.txt @@ -0,0 +1,10 @@ +The following two users must be created before executing the test suite since they represent +two generic main actors of LRR, an instructor and a student. + +Instructor User: +Uname = 202032070221 +Pass = aA124536! + +Student User: +Uname = 202032070222 +Pass = aA124536! diff --git a/test/SeleniumIbrahim/test_kit/actor.py b/test/SeleniumIbrahim/test_kit/actor.py new file mode 100644 index 0000000..bbf00a2 --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/actor.py @@ -0,0 +1,16 @@ +class Actor: + def __init__(self, password, student_id): + self.password = password + self.student_id = student_id + + def setPassword(self, password): + self.password = password + + def setStudentID(self, student_id): + self.student_id = student_id + + def getPassword(self): + return self.password + + def getStudentID(self): + return self.student_id \ No newline at end of file diff --git a/test/SeleniumIbrahim/test_kit/admin.py b/test/SeleniumIbrahim/test_kit/admin.py new file mode 100644 index 0000000..4d6ede2 --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/admin.py @@ -0,0 +1,214 @@ +from actor import Actor +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC +import sys, traceback + +class Admin(Actor): + def __init__(self, password, student_id, utility): + super().__init__(password, student_id) + self.utility = utility + + + def create_new_account(self, acc_id, type="TA"): + """This method automates and insturctor creating new account from + "Admin" page in LRR. + + Parameters: + - type: string + instructor: creates a new instructor account. + TA: creates a new teaching assistant account, This is the default. + - acc_id: string + account ID. + + Returns: + - 0 on success. + - 1 on failure to complete case execution. + """ + + try: + #Initiate driver session and login + driver = self.utility.login(self) + + #Locate "Admin" tab. + wait = WebDriverWait(driver, 10) + admin = wait.until(EC.presence_of_element_located((By.XPATH, "/html/body/nav/div/form/a[1]"))) + admin.click() + + #Locate "Create Lecturer/TA account" form + wait2 = WebDriverWait(driver, 10) + new_account_form = wait2.until(EC.presence_of_element_located((By.ID, "frm_create_acc"))) + + #Fill in the form fields + name_field = new_account_form.find_element(By.XPATH, "//input[@name='fullname']") + f_name = self.utility.random_string(4) + l_name = self.utility.random_string(5) + name_field.send_keys(f_name+" "+l_name) + + email_field = new_account_form.find_element(By.XPATH, "//input[@name='email']") + email_field.send_keys(f_name+"."+l_name+"@testing.com") + + id_field = new_account_form.find_element(By.XPATH, "//input[@name='passport']") + id_field.send_keys(acc_id) + + #If "Lecturer" is specified in type parameter, select Lecturer account type, else use default + if type == "Lecturer": + type_radio = new_account_form.find_element(By.XPATH, "//input[@value='Lecturer']") + else: + type_radio = new_account_form.find_element(By.XPATH, "//input[@value='TA']") + + type_radio.click() + + submit_btn = new_account_form.find_element(By.XPATH, "//input[@type='submit'][@value='Create']") + submit_btn.click() + + return 0 + + except: + print("There was a problem executing this test case") + print("Error in \"create_new_account()\" method, see error_log.txt for more details") + err_msg = traceback.format_exc() + self.utility.log_error(err_msg) + print("Treminating session") + self.utility.killSession(driver) + return 1 + + def batch_create_acc(self, lst): + """This method automates an instructor batch creating new student account + under "Admin" tab. + + Paramaeters: + - lst: list + A list of student number strings to be batch created. + + Return: + - 0 on success + - 1 on failure to complete case execution. + """ + + try: + #Initiate and login + driver = self.utility.login(self) + + #Locate the "Admin" tab. + wait = WebDriverWait(driver, 10) + admin = wait.until(EC.presence_of_element_located((By.XPATH, "/html/body/nav/div/form/a[1]"))) + admin.click() + + #Navigate to "Batch create form" + wait2 = WebDriverWait(driver, 10) + batch_tab = wait2.until(EC.presence_of_element_located((By.XPATH, "/html/body/div[2]/div[1]/div/ul/li[2]/a"))) + batch_tab.click() + + #Fill in the form + wait3 = WebDriverWait(driver, 10) + batch_form = wait3.until(EC.presence_of_element_located((By.ID, "frm_batch_acc"))) + + text_area = batch_form.find_element(By.XPATH, "//textarea[@name='users']") + for i in range(len(lst)): + text_area.send_keys(lst[i]+" ") + + submit_btn = batch_form.find_element(By.XPATH, "//input[@type='submit'][@value='Create All']") + submit_btn.click() + + except: + print("There was a problem executing this test case") + print("Error in \"batch_create_acc()\" method, see error_log.txt for more details") + err_msg = traceback.format_exc() + self.utility.log_error(err_msg) + print("Treminating session") + self.utility.killSession(driver) + return 1 + + def account_block_activate(self, op): + """This method automates an instructor blocking/activating an existing account + under "Admin" page. + + Parameters: + op: string + - block: to block first account on existing account table + - activate: to activate first account on existing account table + + Returns: + - 0 on success + - 1 on failure to complete case execution. + """ + try: + #Initiate web driver session and login + driver = self.utility.login(self) + + #Locate the "Admin" tab. + wait = WebDriverWait(driver, 10) + admin = wait.until(EC.presence_of_element_located((By.XPATH, "/html/body/nav/div/form/a[1]"))) + admin.click() + + #Navigate to "Exisitin Accounts" table + wait2 = WebDriverWait(driver, 10) + exist_acc_tab = wait2.until(EC.presence_of_element_located((By.XPATH, "/html/body/div[2]/div[1]/div/ul/li[3]/a"))) + exist_acc_tab.click() + + #Alternate between block and activate + if op == "block": + #Locate first account and block it on existing account table + wait3 = WebDriverWait(driver, 10) + button = driver.find_element_by_id("block_acc_1") + elif op == "activate": + wait3 = WebDriverWait(driver, 10) + button = driver.find_element_by_id("activate_acc_1") + + driver.execute_script("arguments[0].click();", button) + + #Confirm pop-up alert + wait4 = WebDriverWait(driver, 10) + alert = wait4.until(EC.alert_is_present()) + alert.accept() + + return 0 + + except: + print("There was a problem executing this test case") + print("Error in \"account_block_activate()\" method, see error_log.txt for more details") + err_msg = traceback.format_exc() + self.utility.log_error(err_msg) + print("Treminating session") + self.utility.killSession(driver) + return 1 + + def assign_TA(self): + """This method automates an instructor assigning a TA to a course + under "Admin" page. + + Returns: + - 0 on success + - 1 on failure to complete case execution. + """ + try: + #Initiate web driver session and login + driver = self.utility.login(self) + + #Locate the "Admin" tab. + wait = WebDriverWait(driver, 10) + admin = wait.until(EC.presence_of_element_located((By.XPATH, "/html/body/nav/div/form/a[1]"))) + admin.click() + + #Navigate to "Existing Courses" table. + wait2 = WebDriverWait(driver, 10) + courses_table = wait2.until(EC.presence_of_element_located((By.XPATH, "/html/body/div[2]/div[2]/div/ul/li[2]/a"))) + courses_table.click() + + #Assign TA to the first course in "Existing Courses" table + wait3 = WebDriverWait(driver, 10) + drop_menu_form = wait3.until(EC.presence_of_element_located((By.XPATH, "//*[@id='menub']/table/tbody/tr[2]/td[5]/form"))) + assign_btn = drop_menu_form.find_element(By.XPATH, "//input[@type='submit'][@value='assign']") + assign_btn.click() + + return 0 + + except: + print("There was a problem executing this test case") + print("Error in \"assign_TA()\" method, see error_log.txt for more details") + err_msg = traceback.format_exc() + self.utility.log_error(err_msg) + print("Treminating session") + self.utility.killSession(driver) + return 1 \ No newline at end of file diff --git a/test/SeleniumIbrahim/test_kit/assets/style.css b/test/SeleniumIbrahim/test_kit/assets/style.css new file mode 100644 index 0000000..3edac88 --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/assets/style.css @@ -0,0 +1,186 @@ +body { + font-family: Helvetica, Arial, sans-serif; + font-size: 12px; + /* do not increase min-width as some may use split screens */ + min-width: 800px; + color: #999; +} + +h1 { + font-size: 24px; + color: black; +} + +h2 { + font-size: 16px; + color: black; +} + +p { + color: black; +} + +a { + color: #999; +} + +table { + border-collapse: collapse; +} + +/****************************** + * SUMMARY INFORMATION + ******************************/ +#environment td { + padding: 5px; + border: 1px solid #E6E6E6; +} +#environment tr:nth-child(odd) { + background-color: #f6f6f6; +} + +/****************************** + * TEST RESULT COLORS + ******************************/ +span.passed, +.passed .col-result { + color: green; +} + +span.skipped, +span.xfailed, +span.rerun, +.skipped .col-result, +.xfailed .col-result, +.rerun .col-result { + color: orange; +} + +span.error, +span.failed, +span.xpassed, +.error .col-result, +.failed .col-result, +.xpassed .col-result { + color: red; +} + +/****************************** + * RESULTS TABLE + * + * 1. Table Layout + * 2. Extra + * 3. Sorting items + * + ******************************/ +/*------------------ + * 1. Table Layout + *------------------*/ +#results-table { + border: 1px solid #e6e6e6; + color: #999; + font-size: 12px; + width: 100%; +} +#results-table th, +#results-table td { + padding: 5px; + border: 1px solid #E6E6E6; + text-align: left; +} +#results-table th { + font-weight: bold; +} + +/*------------------ + * 2. Extra + *------------------*/ +.log { + background-color: #e6e6e6; + border: 1px solid #e6e6e6; + color: black; + display: block; + font-family: "Courier New", Courier, monospace; + height: 230px; + overflow-y: scroll; + padding: 5px; + white-space: pre-wrap; +} +.log:only-child { + height: inherit; +} + +div.image { + border: 1px solid #e6e6e6; + float: right; + height: 240px; + margin-left: 5px; + overflow: hidden; + width: 320px; +} +div.image img { + width: 320px; +} + +div.video { + border: 1px solid #e6e6e6; + float: right; + height: 240px; + margin-left: 5px; + overflow: hidden; + width: 320px; +} +div.video video { + overflow: hidden; + width: 320px; + height: 240px; +} + +.collapsed { + display: none; +} + +.expander::after { + content: " (show details)"; + color: #BBB; + font-style: italic; + cursor: pointer; +} + +.collapser::after { + content: " (hide details)"; + color: #BBB; + font-style: italic; + cursor: pointer; +} + +/*------------------ + * 3. Sorting items + *------------------*/ +.sortable { + cursor: pointer; +} + +.sort-icon { + font-size: 0px; + float: left; + margin-right: 5px; + margin-top: 5px; + /*triangle*/ + width: 0; + height: 0; + border-left: 8px solid transparent; + border-right: 8px solid transparent; +} +.inactive .sort-icon { + /*finish triangle*/ + border-top: 8px solid #E6E6E6; +} +.asc.active .sort-icon { + /*finish triangle*/ + border-bottom: 8px solid #999; +} +.desc.active .sort-icon { + /*finish triangle*/ + border-top: 8px solid #999; +} diff --git a/test/SeleniumIbrahim/test_kit/course_code.txt b/test/SeleniumIbrahim/test_kit/course_code.txt new file mode 100644 index 0000000..78ca105 --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/course_code.txt @@ -0,0 +1 @@ +TC14042021171102 \ No newline at end of file diff --git a/test/SeleniumIbrahim/test_kit/example_test_report_09032021_1927.html b/test/SeleniumIbrahim/test_kit/example_test_report_09032021_1927.html new file mode 100644 index 0000000..4287712 --- /dev/null +++ b/test/SeleniumIbrahim/test_kit/example_test_report_09032021_1927.html @@ -0,0 +1,387 @@ + + +
+ +Report generated on 09-Mar-2021 at 19:32:47 by pytest-html v3.1.1
+Base URL | +|
Capabilities | +{} |
Driver | +None |
JAVA_HOME | +C:\Program Files\Java\jdk-15.0.1 |
Packages | +{"pluggy": "0.13.1", "py": "1.10.0", "pytest": "6.2.2"} |
Platform | +Windows-10-10.0.19041-SP0 |
Plugins | +{"base-url": "1.4.2", "html": "3.1.1", "metadata": "1.11.0", "selenium": "2.0.1", "variables": "1.9.0"} |
Python | +3.9.1 |
11 tests ran in 294.71 seconds.
+(Un)check the boxes to filter the results.
11 passed, 0 skipped, 0 failed, 0 errors, 0 expected failures, 0 unexpected passes +Result | +Test | +Duration | +Links |
---|---|---|---|
No results found. Try to check the filters | |||
Passed | +test_suite.py::test_case_00 | +16.03 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_01 | +22.51 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_02 | +38.36 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_03 | +24.65 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_04 | +25.31 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_05 | +33.63 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_06 | +24.20 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_07 | +26.00 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_08 | +23.13 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_09 | +26.61 | +|
+ No log output captured. | |||
Passed | +test_suite.py::test_case_10 | +33.16 | +|
+ ------------------------------Captured stdout call------------------------------ There was a problem executing this test case +Error in "create_course_group()" method, see error_log.txt for more details +Treminating session + |