Integrating Python Webdriver with jenkins and testlink

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Integrating Python Webdriver with jenkins and testlink

Postby vbsorin » Mon Sep 09, 2013 7:28 am

Hello guys I have some problems using the TestLink plugin for Jenkins. It seems that the execution status is not changing when I trigger the job from Jenkins. I'm using https://github.com/orenault/TestLink-API-Python-client to connect to TestLink API. The results of tests are updated in TestLink using the python client but in jenkins for each build the execution status remains "Not Run". I'm using https://github.com/danielfm/unittest-xml-reporting to generate the xml files. Here is a sample test:

Code: Select all
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
import unittest, time, re
import xmlrunner

class Sample(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        self.driver.implicitly_wait(30)
        self.base_url = "https://www.google.com/"
        self.verificationErrors = []
        self.accept_next_alert = True

    def test_sample(self):
        driver = self.driver
        driver.find_element_by_id("gbqfq").send_keys("test")
        driver.find_element_by_id("gbqfb").click()

    def tearDown(self):
        self.driver.quit()
        self.assertEqual([], self.verificationErrors)

if __name__ == "__main__":
    unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))


Here is a screenshot from Jenkins:

Image

Do I miss something? Tests are started from Jenkins using a batch file:

Code: Select all
call "C:\VirtualEnv\Scripts\activate.bat"
python "C:\Jenkins\workspace\Web_Auto\test_name.py"
call "C:\VirtualEnv\Scripts\deactivate.bat"


Test result seeking strategy is jUnit class name. Here is a sample of the xml results file:

Code: Select all
<?xml version="1.0" ?>
<testsuite errors="0" failures="0" name="aaa-20130903091534" tests="1" time="21.453">
   <testcase classname="ClassName" name="testClassName" time="21.453"/>
   <system-out>
<![CDATA[
]]>   </system-out>
   <system-err>
<![CDATA[]]>   </system-err>
</testsuite>


I'm struggling with this issue for two weeks, does anyone have a solution? Thank you!
vbsorin
TestLink user
 
Posts: 1
Joined: Sat Sep 07, 2013 5:14 pm

Re: Integrating Python Webdriver with jenkins and testlink

Postby fman » Mon Sep 09, 2013 8:52 am

TestLink dev team has no knowledge regarding TestLink Jenkis plugin. You have to post on their site / issue tracker.
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am


Return to XML-RPC API



Who is online

Users browsing this forum: No registered users and 4 guests

cron