Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testlink API with Sikuli- Not working #20

Open
aady6497 opened this issue Feb 11, 2016 · 4 comments
Open

Testlink API with Sikuli- Not working #20

aady6497 opened this issue Feb 11, 2016 · 4 comments

Comments

@aady6497
Copy link

Hi all,
I am trying to integrate sikuli python scripts with testlink API. I am able to import the required testlink module into sikuli-IDE but, unable to connect & perform any actions.
The same steps are working fine with python standalone.

Could anyone suggest me, what I am doing wrong.

@samsalas
Copy link

I have a small experience in such thing but I never tried what you're trying to do.
I suggest you try to do the following :

  • Execute the steps with python standalone
  • call sikuli script with subproces. Example :

sikuli = Popen(["C:\SikuliX\runIDE.cmd", "-r", "installIC.sikuli"], shell=True, stdout=PIPE)
sikuli.wait()'
errorfound = False'
for msg in sikuli.stdout.readlines():'
print msg'
if "[error]" in msg:
errorfound = True`

This is the method I use to perform 'nosetest' format. I Use this format to be able to export in Junit XML. Because I know sikuli doesnt support nosetest for now.

@aady6497
Copy link
Author

Thanks Sam, for the quick response. I will check this approach :)

@lilinyueyue
Copy link

I am trying to install latest testlink on ubunto16 hosted on vm, then try to run python scripts to update test results in test link , also try to invoke test run in testlink. the key strategy I am going to use is to call the test method in testlink APIs via xmlrpc. not sure this is possible. any suggestions warnings here, it it is possible what is the version of testlink, xmlrpc, or even python testlink driver? thanks

@samsalas
Copy link

samsalas commented Mar 2, 2018

Hi,

This is my way to access the Testlink API with a Python class (Python 2.7)

import xmlrpclib

class TestlinkAPIClient:        
    # substitute your server URL Here
    SERVER_URL = "http://testlinkserver/lib/api/xmlrpc/v1/xmlrpc.php"
    DEVKEY = "jbeijbeidnboiuenfoiunoufn"

    def __init__(self, devKey):
        self.server = xmlrpclib.ServerProxy(self.SERVER_URL)

    def getInfo(self):
        return self.server.tl.about()

    def getProjects(self):
        data = {}
        data["devKey"] = self.DEVKEY
        return self.server.tl.getProjects(data)

    def getTestPlans(self, projectid):
        data = {}
        data["devKey"] = self.DEVKEY
        data["testprojectid"] = int(projectid)
        return self.server.tl.getProjectTestPlans(data)

    def getBuildsForTestPlan(self, testplanid):
        data = {}
        data["devKey"] = self.DEVKEY
        data["testplanid"] = int(testplanid)
        return self.server.tl.getBuildsForTestPlan(data)

client = TestlinkAPIClient("45e0f3340075d1e6f826aa42a0daa514")
print client.getInfo()
projects = client.getProjects()
print "Projects in Testlink: %d" % len(projects)

I suggest you read the testlink api code. You have the list of functions in the last lines in the file "TestlinkSources\lib\api\xmlrpc\v1\xmlrpc.class.php"

Repository owner deleted a comment from netzulo Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants