diff --git a/web/pgadmin/feature_tests/pg_datatype_validation_test.py b/web/pgadmin/feature_tests/pg_datatype_validation_test.py
index 65d7bfbc5..a1c01df3d 100644
--- a/web/pgadmin/feature_tests/pg_datatype_validation_test.py
+++ b/web/pgadmin/feature_tests/pg_datatype_validation_test.py
@@ -115,18 +115,19 @@ class PGDataypeFeatureTest(BaseFeatureTest):
             NavMenuLocators.maximize_pref_dialogue_css)
         maximize_button.click()
 
+        specified_preference_tree_node_name = 'Query Tool'
         sql_editor = self.page.find_by_xpath(
             NavMenuLocators.specified_preference_tree_node.
-            format('Query Tool'))
+            format(specified_preference_tree_node_name))
         if self.page.find_by_xpath(
             NavMenuLocators.specified_pref_node_exp_status.
-                format('Query Tool')).\
+                format(specified_preference_tree_node_name)).\
                 get_attribute('aria-expanded') == 'false':
             ActionChains(self.driver).double_click(sql_editor).perform()
 
         option_node = self.page.find_by_xpath(
             NavMenuLocators.specified_sub_node_of_pref_tree_node.format(
-                'Query Tool', 'Editor'))
+                specified_preference_tree_node_name, 'Editor'))
         option_node.click()
 
         self.page.set_switch_box_status(
diff --git a/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py b/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py
index 5f4461205..9efdd9285 100644
--- a/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py
+++ b/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py
@@ -122,8 +122,9 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
             lambda driver: driver.find_element_by_css_selector(
                 ".loading-logs"), 10)
 
-        if status != "Successfully completed.":
-            self.assertEquals(status, "Successfully completed.")
+        expected_backup_success_msg = "Successfully completed."
+        if status != expected_backup_success_msg:
+            self.assertEquals(status, expected_backup_success_msg)
 
         backup_file = None
         # Check for XSS in Backup details
@@ -192,8 +193,8 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
             lambda driver: driver.find_element_by_css_selector(
                 ".loading-logs"), 10)
 
-        if status != "Successfully completed.":
-            self.assertEquals(status, "Successfully completed.")
+        if status != expected_backup_success_msg:
+            self.assertEquals(status, expected_backup_success_msg)
 
         # Check for XSS in Restore details
         if self.is_xss_check:
diff --git a/web/pgadmin/feature_tests/query_tool_auto_complete_tests.py b/web/pgadmin/feature_tests/query_tool_auto_complete_tests.py
index cb9d3cdb0..e45f16055 100644
--- a/web/pgadmin/feature_tests/query_tool_auto_complete_tests.py
+++ b/web/pgadmin/feature_tests/query_tool_auto_complete_tests.py
@@ -64,6 +64,7 @@ class QueryToolAutoCompleteFeatureTest(BaseFeatureTest):
 
     def runTest(self):
         # Test case for keywords
+        select_keyword = "SELECT * FROM public."
         print("\nAuto complete ALTER keyword... ", file=sys.stderr, end="")
         self._auto_complete("A", "ALTER")
         print("OK.", file=sys.stderr)
@@ -116,29 +117,29 @@ class QueryToolAutoCompleteFeatureTest(BaseFeatureTest):
 
         print("Auto complete first table in public schema ... ",
               file=sys.stderr, end="")
-        self._auto_complete("SELECT * FROM public.", self.first_table_name)
+        self._auto_complete(select_keyword, self.first_table_name)
         print("OK.", file=sys.stderr)
         self.page.clear_query_tool()
 
         print("Auto complete second table in public schema ... ",
               file=sys.stderr, end="")
-        self._auto_complete("SELECT * FROM public.", self.second_table_name)
+        self._auto_complete(select_keyword, self.second_table_name)
         print("OK.", file=sys.stderr)
         self.page.clear_query_tool()
 
         print("Auto complete JOIN second table with after schema name ... ",
               file=sys.stderr, end="")
-        query = "SELECT * FROM public." + self.first_table_name + \
-                " JOIN public."
+        query = select_keyword + self.first_table_name + \
+            " JOIN public."
         self._auto_complete(query, self.second_table_name)
         print("OK.", file=sys.stderr)
         self.page.clear_query_tool()
 
         print("Auto complete JOIN ON some columns ... ",
               file=sys.stderr, end="")
-        query = "SELECT * FROM public." + self.first_table_name + \
-                " JOIN public." + self.second_table_name + " ON " + \
-                self.second_table_name + "."
+        query = select_keyword + self.first_table_name + \
+            " JOIN public." + self.second_table_name + " ON " + \
+            self.second_table_name + "."
         expected_string = "some_column = " + self.first_table_name + \
                           ".some_column"
         self._auto_complete(query, expected_string)
@@ -147,8 +148,8 @@ class QueryToolAutoCompleteFeatureTest(BaseFeatureTest):
 
         print("Auto complete JOIN ON some columns using table alias ... ",
               file=sys.stderr, end="")
-        query = "SELECT * FROM public." + self.first_table_name + \
-                " t1 JOIN public." + self.second_table_name + " t2 ON t2."
+        query = select_keyword + self.first_table_name + \
+            " t1 JOIN public." + self.second_table_name + " t2 ON t2."
         self._auto_complete(query, "some_column = t1.some_column")
         print("OK.", file=sys.stderr)
         self.page.clear_query_tool()
diff --git a/web/pgadmin/feature_tests/query_tool_journey_test.py b/web/pgadmin/feature_tests/query_tool_journey_test.py
index f439917eb..98e365e1c 100644
--- a/web/pgadmin/feature_tests/query_tool_journey_test.py
+++ b/web/pgadmin/feature_tests/query_tool_journey_test.py
@@ -32,6 +32,10 @@ class QueryToolJourneyTest(BaseFeatureTest):
     test_editable_table_name = ""
     invalid_table_name = ""
 
+    select_query = "SELECT * FROM %s"
+    query_history_tab_name = "Query History"
+    query_editor_tab_name = "Query Editor"
+
     def before(self):
         self.test_table_name = "test_table" + str(random.randint(1000, 3000))
         self.invalid_table_name = \
@@ -148,12 +152,12 @@ class QueryToolJourneyTest(BaseFeatureTest):
         editor_input = self.page.find_by_css_selector(
             QueryToolLocators.query_editor_panel)
         self.page.click_element(editor_input)
-        self.page.execute_query("SELECT * FROM %s" % self.invalid_table_name)
+        self.page.execute_query(self.select_query % self.invalid_table_name)
 
-        self.page.click_tab("Query History")
+        self.page.click_tab(self.query_history_tab_name)
         selected_history_entry = self.page.find_by_css_selector(
             QueryToolLocators.query_history_selected)
-        self.assertIn("SELECT * FROM %s" % self.invalid_table_name,
+        self.assertIn(self.select_query % self.invalid_table_name,
                       selected_history_entry.text)
 
         failed_history_detail_pane = self.page.find_by_css_selector(
@@ -187,10 +191,10 @@ class QueryToolJourneyTest(BaseFeatureTest):
         invalid_history_entry = self.page.find_by_css_selector(
             QueryToolLocators.invalid_query_history_entry_css)
 
-        self.assertIn("SELECT * FROM %s" % self.invalid_table_name,
+        self.assertIn(self.select_query % self.invalid_table_name,
                       invalid_history_entry.text)
 
-        self.page.click_tab("Query Editor")
+        self.page.click_tab(self.query_editor_tab_name)
         self.page.clear_query_tool()
         self.page.click_element(editor_input)
 
@@ -202,7 +206,7 @@ class QueryToolJourneyTest(BaseFeatureTest):
                 QueryToolLocators.btn_execute_query_css).click()
             self.page.wait_for_query_tool_loading_indicator_to_disappear()
 
-        self.page.click_tab("Query History")
+        self.page.click_tab(self.query_history_tab_name)
 
         query_list = self.page.wait_for_elements(
             lambda driver: driver.find_elements_by_css_selector(
@@ -216,10 +220,10 @@ class QueryToolJourneyTest(BaseFeatureTest):
         self._test_toggle_generated_queries()
 
     def _test_history_query_sources(self):
-        self.page.click_tab("Query Editor")
+        self.page.click_tab(self.query_editor_tab_name)
         self._execute_sources_test_queries()
 
-        self.page.click_tab("Query History")
+        self.page.click_tab(self.query_history_tab_name)
 
         history_entries_icons = [
             QueryToolLocators.commit_icon,
@@ -235,9 +239,9 @@ class QueryToolJourneyTest(BaseFeatureTest):
             "UPDATE public.%s SET normal_column = '10'::numeric "
             "WHERE pk_column = '1';" % self.test_editable_table_name,
             "BEGIN;",
-            "SELECT * FROM %s" % self.test_editable_table_name,
-            "SELECT * FROM %s" % self.test_editable_table_name,
-            "SELECT * FROM %s" % self.test_editable_table_name
+            self.select_query % self.test_editable_table_name,
+            self.select_query % self.test_editable_table_name,
+            self.select_query % self.test_editable_table_name
         ]
 
         self._check_history_queries_and_icons(history_entries_queries,
@@ -256,7 +260,7 @@ class QueryToolJourneyTest(BaseFeatureTest):
     def _test_updatable_resultset(self):
         if self.driver_version < 2.8:
             return
-        self.page.click_tab("Query Editor")
+        self.page.click_tab(self.query_editor_tab_name)
 
         # Select all data
         # (contains the primary key -> all columns should be editable)
@@ -286,7 +290,7 @@ class QueryToolJourneyTest(BaseFeatureTest):
     def _test_is_editable_columns_icons(self):
         if self.driver_version < 2.8:
             return
-        self.page.click_tab("Query Editor")
+        self.page.click_tab(self.query_editor_tab_name)
 
         self.page.clear_query_tool()
         query = "SELECT pk_column FROM %s" % self.test_editable_table_name
@@ -310,15 +314,15 @@ class QueryToolJourneyTest(BaseFeatureTest):
         self.page.clear_query_tool()
 
         self._explain_query(
-            "SELECT * FROM %s;"
+            self.select_query
             % self.test_editable_table_name
         )
         self._explain_analyze_query(
-            "SELECT * FROM %s;"
+            self.select_query
             % self.test_editable_table_name
         )
         self.page.execute_query(
-            "SELECT * FROM %s;"
+            self.select_query
             % self.test_editable_table_name
         )
 
@@ -376,12 +380,12 @@ class QueryToolJourneyTest(BaseFeatureTest):
         """
             Updates a numeric cell in the first row of the resultset
         """
-        self.page.check_if_element_exist_by_xpath(
-            "//div[contains(@style, 'top:0px')]//div[contains(@class, "
-            "'l{0} r{1}')]".format(cell_index, cell_index))
-        cell_el = self.page.find_by_xpath(
-            "//div[contains(@style, 'top:0px')]//div[contains(@class, "
-            "'l{0} r{1}')]".format(cell_index, cell_index))
+        cell_xpath = "//div[contains(@style, 'top:0px')]//" \
+                     "div[contains(@class,'l{0} r{1}')]". \
+            format(cell_index, cell_index)
+
+        self.page.check_if_element_exist_by_xpath(cell_xpath)
+        cell_el = self.page.find_by_xpath(cell_xpath)
         ActionChains(self.driver).double_click(cell_el).perform()
         ActionChains(self.driver).send_keys(value). \
             send_keys(Keys.ENTER).perform()
@@ -389,7 +393,7 @@ class QueryToolJourneyTest(BaseFeatureTest):
             QueryToolLocators.btn_save_data).click()
 
     def _insert_data_into_test_editable_table(self):
-        self.page.click_tab("Query Editor")
+        self.page.click_tab(self.query_editor_tab_name)
         self.page.clear_query_tool()
         self.page.execute_query(
             "INSERT INTO %s VALUES (1, 1), (2, 2);"
diff --git a/web/pgadmin/feature_tests/query_tool_tests.py b/web/pgadmin/feature_tests/query_tool_tests.py
index 9328d4b50..4b3b1537e 100644
--- a/web/pgadmin/feature_tests/query_tool_tests.py
+++ b/web/pgadmin/feature_tests/query_tool_tests.py
@@ -30,6 +30,8 @@ class QueryToolFeatureTest(BaseFeatureTest):
     scenarios = [
         ("Query tool feature test", dict())
     ]
+    data_output_tab_name = 'Data Output'
+    table_creation_fail_error = '"CREATE TABLE message does not displayed"'
 
     def before(self):
         self.page.wait_for_spinner_to_disappear()
@@ -46,6 +48,7 @@ class QueryToolFeatureTest(BaseFeatureTest):
         # on demand result set on scrolling.
         print("\nOn demand query result... ",
               file=sys.stderr, end="")
+        skip_warning = "Skipped."
         self._on_demand_result()
         self.page.clear_query_tool()
 
@@ -57,7 +60,7 @@ class QueryToolFeatureTest(BaseFeatureTest):
             print("OK.", file=sys.stderr)
             self.page.clear_query_tool()
         else:
-            print("Skipped.", file=sys.stderr)
+            print(skip_warning, file=sys.stderr)
 
         # explain analyze query with buffers and timing
         print("Explain analyze query with buffers and timing... ",
@@ -67,7 +70,7 @@ class QueryToolFeatureTest(BaseFeatureTest):
             print("OK.", file=sys.stderr)
             self.page.clear_query_tool()
         else:
-            print("Skipped.", file=sys.stderr)
+            print(skip_warning, file=sys.stderr)
 
         # auto commit disabled.
         print("Auto commit disabled... ", file=sys.stderr, end="")
@@ -106,7 +109,7 @@ class QueryToolFeatureTest(BaseFeatureTest):
             print("OK.", file=sys.stderr)
             self.page.clear_query_tool()
         else:
-            print("Skipped.", file=sys.stderr)
+            print(skip_warning, file=sys.stderr)
 
     def after(self):
         self.page.remove_server(self.server)
@@ -276,7 +279,7 @@ SELECT generate_series(1, 1000) as id order by id desc"""
 
         self.page.wait_for_query_tool_loading_indicator_to_disappear()
 
-        self.page.click_tab('Data Output')
+        self.page.click_tab(self.data_output_tab_name)
 
         canvas = self.wait.until(EC.presence_of_element_located(
             (By.CSS_SELECTOR, QueryToolLocators.query_output_canvas_css))
@@ -310,7 +313,7 @@ SELECT generate_series(1, 1000) as id order by id desc"""
 
         self.page.wait_for_query_tool_loading_indicator_to_disappear()
 
-        self.page.click_tab('Data Output')
+        self.page.click_tab(self.data_output_tab_name)
 
         self.wait.until(EC.presence_of_element_located(
             (By.XPATH, QueryToolLocators.output_cell_xpath.format(1, 1)))
@@ -351,7 +354,7 @@ CREATE TABLE public.{}();""".format(table_name)
 
         self.assertTrue(self.page.check_if_element_exist_by_xpath(
             QueryToolLocators.sql_editor_message.format('CREATE TABLE')),
-            "CREATE TABLE message does not displayed")
+            self.table_creation_fail_error)
 
         # do the ROLLBACK and check if the table is present or not
         self.page.clear_query_tool()
@@ -375,7 +378,7 @@ SELECT relname FROM pg_class
     WHERE relkind IN ('r','s','t') and relnamespace = 2200::oid;"""
 
         self.page.execute_query(query)
-        self.page.click_tab('Data Output')
+        self.page.click_tab(self.data_output_tab_name)
         canvas = self.wait.until(EC.presence_of_element_located(
             (By.CSS_SELECTOR, QueryToolLocators.query_output_canvas_css)))
 
@@ -432,7 +435,7 @@ CREATE TABLE public.{}();""".format(table_name)
         self.page.click_tab('Messages')
         self.assertTrue(self.page.check_if_element_exist_by_xpath(
             QueryToolLocators.sql_editor_message.format('CREATE TABLE')),
-            "CREATE TABLE message does not displayed")
+            self.table_creation_fail_error)
 
         self.page.clear_query_tool()
         query = """-- 1. (Done) END any open transaction if any.
@@ -459,7 +462,7 @@ SELECT relname FROM pg_class
     WHERE relkind IN ('r','s','t') and relnamespace = 2200::oid;"""
 
         self.page.execute_query(query)
-        self.page.click_tab('Data Output')
+        self.page.click_tab(self.data_output_tab_name)
         self.page.wait_for_query_tool_loading_indicator_to_disappear()
 
         canvas = self.wait.until(EC.presence_of_element_located(
@@ -510,7 +513,7 @@ CREATE TABLE public.{}();""".format(table_name)
         self.page.click_tab('Messages')
         self.assertTrue(self.page.check_if_element_exist_by_xpath(
             QueryToolLocators.sql_editor_message.format('CREATE TABLE')),
-            "CREATE TABLE message does not displayed")
+            self.table_creation_fail_error)
         self.page.clear_query_tool()
 
         query = """-- 1. (Done) END any open transaction.
@@ -554,7 +557,7 @@ SELECT relname FROM pg_class
     WHERE relkind IN ('r','s','t') and relnamespace = 2200::oid;"""
         self.page.execute_query(query)
         self.page.wait_for_query_tool_loading_indicator_to_disappear()
-        self.page.click_tab('Data Output')
+        self.page.click_tab(self.data_output_tab_name)
         canvas = self.wait.until(EC.presence_of_element_located(
             (By.CSS_SELECTOR, QueryToolLocators.query_output_canvas_css)))
 
@@ -710,7 +713,7 @@ SELECT 1, pg_sleep(300)"""
             QueryToolLocators.btn_explain_analyze).click()
 
         self.page.wait_for_query_tool_loading_indicator_to_disappear()
-        self.page.click_tab('Data Output')
+        self.page.click_tab(self.data_output_tab_name)
 
         canvas = self.wait.until(EC.presence_of_element_located(
             (By.CSS_SELECTOR, QueryToolLocators.query_output_canvas_css))
diff --git a/web/pgadmin/feature_tests/view_data_dml_queries.py b/web/pgadmin/feature_tests/view_data_dml_queries.py
index 4b7d88e4f..663289fe2 100644
--- a/web/pgadmin/feature_tests/view_data_dml_queries.py
+++ b/web/pgadmin/feature_tests/view_data_dml_queries.py
@@ -346,6 +346,7 @@ CREATE TABLE public.nonintpkey
 
         xpath = "//*[contains(@class, 'ui-widget-content') and " \
                 "contains(@style, 'top:" + str(row_height) + "px')]"
+        scroll_on_arg_for_js = "arguments[0].scrollIntoView(false)"
 
         self.page.wait_for_query_tool_loading_indicator_to_disappear()
 
@@ -362,7 +363,7 @@ CREATE TABLE public.nonintpkey
                     element = \
                         result_row.find_element_by_class_name("r" + str(idx))
                     self.page.driver.execute_script(
-                        "arguments[0].scrollIntoView(false)", element)
+                        scroll_on_arg_for_js, element)
                     break
                 except Exception:
                     print("stale reference exception at id:", idx)
@@ -380,4 +381,4 @@ CREATE TABLE public.nonintpkey
             time.sleep(0.4)
             element = result_row.find_element_by_class_name("r" + str(idx))
             self.page.driver.execute_script(
-                "arguments[0].scrollIntoView(false)", element)
+                scroll_on_arg_for_js, element)
diff --git a/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py b/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py
index 439bbd147..a9bb99c54 100644
--- a/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py
+++ b/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py
@@ -38,6 +38,8 @@ class CheckForXssFeatureTest(BaseFeatureTest):
         ("Test XSS check for panels and query tool", dict())
     ]
     test_type_name = '"<script>alert(1)</script>"'
+    check_xss_chars = '&lt;h1&gt;X'
+    check_xss_chars_set2 = '&lt;script&gt;alert(1)&lt;/script&gt;'
 
     def before(self):
         self.test_table_name = "<h1>X" + str(random.randint(1000, 3000))
@@ -126,7 +128,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
 
         self._check_escaped_characters(
             source_code,
-            "&lt;h1&gt;X",
+            self.check_xss_chars,
             "Browser tree"
         )
 
@@ -144,7 +146,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
 
         self._check_escaped_characters(
             source_code,
-            "&lt;h1&gt;X",
+            self.check_xss_chars,
             "SQL tab (Code Mirror)"
         )
 
@@ -229,7 +231,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
 
         self._check_escaped_characters(
             source_code,
-            '&lt;script&gt;alert(1)&lt;/script&gt;',
+            self.check_xss_chars_set2,
             "Query tool (History Entry)"
         )
 
@@ -246,7 +248,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
 
         self._check_escaped_characters(
             source_code,
-            '&lt;script&gt;alert(1)&lt;/script&gt;',
+            self.check_xss_chars_set2,
             "Query tool (History Details-Message)"
         )
 
@@ -264,7 +266,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
 
         self._check_escaped_characters(
             source_code,
-            '&lt;script&gt;alert(1)&lt;/script&gt;',
+            self.check_xss_chars_set2,
             "Query tool (History Details-Error)"
         )
 
@@ -286,7 +288,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
 
         self._check_escaped_characters(
             source_code,
-            '&lt;script&gt;alert(1)&lt;/script&gt;',
+            self.check_xss_chars_set2,
             "View Data (SlickGrid)"
         )
 
@@ -329,7 +331,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
 
         self._check_escaped_characters(
             source_code,
-            "&lt;h1&gt;X",
+            self.check_xss_chars,
             "Explain tab (Graphical explain plan)"
         )
 
