Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5968309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:04:19+00:00 2026-05-22T20:04:19+00:00

I have to test few sites which sales the same things, but they have

  • 0

I have to test few sites which sales the same things, but they have an another template.

So I want to run each MainTestClass with giving some input parameter, let’s say :

java -jar SeleniumServerStandalone-2.0b2.jar -port 5555 (template_id=5)

Is it possible?

class MainTestCases(unittest.TestCase):
    def setUp(self):

        #self.template_id=template_id I want something like that
        self.verificationErrors = []

        self.selenium = selenium("localhost", 5555, "*chrome", "http://www.google.com/")
        time.sleep(5)
        self.selenium.start()


    def test_test1(self):
        if self.template_id==1:
        ...
        elif self.template_id==2:
        ...
    def test_test2(self):
        if self.template_id==1:
        ...
        elif self.template_id==2:
        ...
    def tearDown(self):
        self.selenium.stop()
        self.assertEqual([], self.verificationErrors)

if __name__ == "__main__":
    unittest.main()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:04:20+00:00Added an answer on May 22, 2026 at 8:04 pm

    Now, I use this solution:

    1. Create suite test which runs testcases:

    import unittest
    from Flights.FlightsTestCases import FlightsTestCases
    import sys
    from Flights.FlightTemplate import FlightTemplate

    def suite():

        testSuite= unittest.TestSuite()
        testSuite.addTest(FlightsTestCases('test_test1'))
    
    
        FlightsTestCases.www_address='http://testpage.pl/'
        FlightsTestCases.flight_template=FlightTemplate.Test
    
        #FlightsTestCases.www_address='http://productionpage.pl/'
        #FlightsTestCases.flight_template=FlightTemplate.Production
    
        return testSuite
    
    
    if __name__ == "__main__":
        result = unittest.TextTestRunner(verbosity=2).run(suite())
        sys.exit(not result.wasSuccessful())
    

    change set_up to something like:

    class FlightsTestCases(unittest.TestCase):
    www_address = None
    flight_template = None
    xml_report_generator = None

    def setUp(self):
        self.verificationErrors = []
        if self.www_address == None:
            self.selenium = selenium("localhost", 5555, "*chrome", "http://testpage.pl/")
        else:
            self.selenium = selenium("localhost", 5555, "*chrome", self.www_address)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A few test scenarios have been recorded using CodedUI test template for my web
I have a few test databases in some Unix SUSE 8 servers and initially
I have a few unit tests that require very large strings for the test
I am creating a traceability matrix for PRD. I have test case _id which
I have this test slider http://jsfiddle.net/dUyLY/2/ In Chrome it works nice, but in firefox
As you all know few sites offer feature which let you specify what type
I have my site live in which i echoed few strings for testing, so
I have a design which loads nicely in IE6, but as soon as I
I have an integration test, in java, of a facade that does a few
I have Test controller and Test agent installed on a virtual machine VM1. Test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.