python selenium语法_python selenium脚本语法

好吧,我用selenium测试了一些自动化,我开始工作了。我为python导出了一个脚本。当我试图运行它生成的python脚本时,它给了我一条“SyntaxError:invalid syntax”错误消息。下面是有问题的python脚本:from selenium import selenium

import unittest, time, re

class WakeupCall(unittest.TestCase):

def setUp(self):

self.verificationErrors = []

self.selenium = selenium("localhost", 4444, "*chrome", "http://the.web.site")

self.selenium.start()

def test_wakeup_call(self):

sel = self.selenium

sel.open("/index.php#deposit")

sel.wait_for_page_to_load("30000")

sel.click("link=History")

sel.wait_for_page_to_load("30000")

try: self.failUnless(sel.is_text_present("key phrase number 1."))

except AssertionError, e: self.verificationErrors.append(str(e))

最后一行是生成“SyntaxError:invalid syntax”错误消息的内容。逗号下面有一个“^”。脚本的其余部分如下:

^{pr2}$

你可能感兴趣的:(python,selenium语法)