Integrating Python Webdriver with jenkins and testlink

XMLWordPrintable

    • Type: Improvement
    • Resolution: Not A Defect
    • Priority: Major
    • Component/s: testlink-plugin
    • None

      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 dummy test:

      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'))
      

      Screenshot from jenkins:

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

      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:

      <?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!

            Assignee:
            Bruno P. Kinoshita
            Reporter:
            Bogdan Veres
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: