dependency injection - When using the IObjectFactory in TestNG, do all my test classes need to be created up front? -
i'm running selenium 2 tests through testng , i'm trying use guice modules automatically inject configured browser (driver) tests. i'm using iobjectfactory method described in testng book, , implemented testnguice, i've run issue.
it seems test classes being created, , browser instance initialized, tests suite starts. wouldn't such problem if classes had lightweight objects, in case means i've got half dozen browsers being fired , sitting around until test run.
is possible tell testng create test class right before test run?
for reference here's testng.xml used start tests. i'm running inside eclipse.
<suite name="suite1" verbose="1" object-factory="com.corp.testing.objectfactory.localfirefox">
localfirefox equally unremarkable
package com.corp.testing.objectfactory; import org.openqa.selenium.webdriver; import org.openqa.selenium.firefox.firefoxdriver; public class localfirefox extends guiceobjectfactory { @override protected void configure() { bind(webdriver.class).to(firefoxdriver.class); } }
Comments
Post a Comment