SeeTest_See test 解决方法

来源:互联网 发布:腾讯内部员工网络 编辑:程序博客网 时间:2024/05/29 10:11
I have a question regarding See Test - Desktop Automation. I've created a test, then exported the script as Python code, and copied it to Aptana Studio into the Project I've created. I seem to be getting 2 errors. Do you have any idea? Thanks in advance
Here is the code. I'm marking the error lines with * and ** :
import unittest
** from ExperitestClient import Client
class Test1(unittest.TestCase):
def setUp(self):
self.host = "localhost"
self.port = 8888
self.client = Client()
self.client.init(self.host, self.port)
self.client.setProjectBaseDirectory("C:Usersanaimanworkspaceproject3")
self.client.setReporter("xml", "reports")
def testTest1(self):
self.client.setApplicationTitle("Aurora TOUCH")
if(self.client.waitForElement("default", "Dashboard", 0, 10000)):
# If statement
* self.client.click("default", "Dashboard", 0, 1)
self.client.click("default", "Worklist", 0, 1)
if(self.client.waitForElement("default", "Enter Worklist", 0, 10000)):
# If statement
self.client.click("default", "Enter Worklist", 0, 1)
if(self.client.waitForElement("default", "Import", 0, 10000)):
# If statement
self.client.click("default", "Import", 0, 1)
if(self.client.isElementFound("default", "Back")):
# If statement
self.client.click("default", "Back", 0, 1)
self.client.verifyElementFound("default", "Sample Number")
self.client.click("default", "Sample Number", 0, 1)
self.client.sendText("0005")
self.client.sendText("{ENTER}")
self.client.verifyElementFound("Assay", "Campylobacter")
if(self.client.isElementFound("Assay", "CMV")):
# If statement
self.client.verifyElementFound("Assay", "Salmonella")
self.client.verifyElementFound("Assay", "EBV-IC")
self.client.click("Assay", "Campylobacter", 0, 1)
def tearDown(self):
self.client.generateReport()
if __name__ == '__main__':
unittest.main()
* Description Resource Path Location Type
Encountered "self" at line 22, column 9. Was expecting: "" ... Test.py /Aurora/src line 21 Problem
** Description Resource Path Location Type

Unresolved import: Client Test.py /Aurora/src line 6 PyDev Problem

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Python Integration - Aptana Studio

Hi,
First let start with the Client import, your SeeTest installation directory contains clients clients/python directory, in this directory you will find ExperitestClient.py file.
Please add it to your project or copy it to the tests folder.
The secend issue is in the if statements. If you don't add content to the if just remove the 'if' statement.
Regards,
Support Team