From 1ee6517cabdbad3fa6d7bfd95e96cb7aca197b2f Mon Sep 17 00:00:00 2001 From: liuct Date: Mon, 11 Aug 2014 16:59:50 +0800 Subject: [PATCH] fix webdriver manual test cases execution issue --- testkitlite/engines/mh.html | 76 ++++++++++++++++++++++++++++++++++++ testkitlite/engines/test_executer.py | 13 +++--- 2 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 testkitlite/engines/mh.html diff --git a/testkitlite/engines/mh.html b/testkitlite/engines/mh.html new file mode 100644 index 0000000..01632b7 --- /dev/null +++ b/testkitlite/engines/mh.html @@ -0,0 +1,76 @@ + + +Web Manual Test Harness + + + + + +
+ + +
+
+ + + + +
+
+ + + + +
+
+
Test Entry: http://www.baidu.com
+
Refer Test Entry: http://www.sina.com
+
+ +
+
+ + diff --git a/testkitlite/engines/test_executer.py b/testkitlite/engines/test_executer.py index cb04ff9..1807d97 100644 --- a/testkitlite/engines/test_executer.py +++ b/testkitlite/engines/test_executer.py @@ -235,12 +235,16 @@ class TestExecuter: break def __checkPageNotFound(self, page_url=None): - if self.web_driver.current_url.find('data:text/html,chromewebdata') >= 0: - self.TE_LOG.debug("Page not found: %s" % + try: + if self.web_driver.current_url.find('data:text/html,chromewebdata') >= 0: + self.TE_LOG.debug("Page not found: %s" % self.web_driver.current_url) + return False + else: + return True + except Exception, e: + self.TE_LOG.error("Failed to get current url") return False - else: - return True def __runRefTests(self, haha=None, kkkk=None): for i_case in self.tests_json['cases']: @@ -489,7 +493,6 @@ class TestExecuter: break def __runTests(self, haha=None, kkkk=None): - print 'xxx',os.environ['TEST_PLATFORM'] for i_case in self.tests_json['cases']: i_case['result'] = STR_NOTRUN if self.set_exetype == "manual": -- 2.7.4