Hi Satyadev,

I just added the following three methods in BaseTelluriumJavaTestCase
for your convenience,

    public static void openUrlWithBrowserParameters(String url, String
serverHost, int serverPort, String baseUrl, String browser, String
browserOptions)

    public static void openUrlWithBrowserParameters(String url, String
serverHost, int serverPort, String browser, String browserOptions)

    public static void openUrlWithBrowserParameters(String url, String
serverHost, int serverPort, String browser)

You can use them in your TestNG test case to pass in the browser
parameters. For example, I tested the following
TestNG test case,

public class GoogleStartPageTestNGTestCase extends
TelluriumTestNGTestCase {
    protected static NewGoogleStartPage ngsp;

    @BeforeClass
    public static void initUi() {
        ngsp = new NewGoogleStartPage();
        ngsp.defineUi();
    }

    @DataProvider(name = "browser-provider")
    public Object[][] browserParameters() {
        return new Object[][]{new Object[] {"localhost", 4444,
"*chrome"},
                new Object[] {"localhost", 4444, "*firefox"}};
    }

    @Test(dataProvider = "browser-provider")
    @Parameters({"serverHost", "serverPort", "browser"})
    public void testGoogleSearch(String serverHost, int serverPort,
String browser){
        openUrlWithBrowserParameters("http://www.google.com";,
serverHost, serverPort, browser);
        ngsp.doGoogleSearch("tellurium selenium Groovy Test");
        disconnectSeleniumServer();
   }

   @Test(dataProvider = "browser-provider")
   @Parameters({"serverHost", "serverPort", "browser"})
   public void testGoogleSearchFeelingLucky(String serverHost, int
serverPort, String browser){
       openUrlWithBrowserParameters("http://www.google.com";,
serverHost, serverPort, browser);
       ngsp.doImFeelingLucky("tellurium selenium DSL Testing");
       disconnectSeleniumServer();
   }
}

The test works fine. Please you should use the latest core 0.7.0
snapshot from our Maven repo if
you want to use the new methods.

All,

openUrlWithBrowserParameters() is similar to openUrl(), which will
create a new browser session.
If you like to reuse the same browser session, please use connectUrl
().

Let me know if we can improve this further.

Thanks,

Jian


On Aug 25, 1:23 pm, Jian Fang <[email protected]> wrote:
> Sorry, I didn't read your previous posts. Seems you want to use
> TelluriumTestNGTestCase
> in the following way so that you don't need to do all the setup and tear
> down work, right?
>
> public class WebTestInvolvingMultiEnvironments extends
> TelluriumTestNGTestCase
> {
>       �...@test(groups = {"default" },description = "firstEnvironment --> 
> Using
> the Firefox Web Browser on Window ")
>       �...@parameters({"seleniumHost", "seleniumPort", "firstEnvironment",
> "webSite"})
>        public void test1(String seleniumHost, String seleniumPort, String
> firstEnvironment, String webSite) {
>                Function1();
>        }
>
>       �...@test(groups = {"default"},description = "secondEnvironment --> 
> Using
> the Internet Explorer Web Browser on other Window ")
>       �...@parameters({"seleniumHost", "seleniumPort", "secondEnvironment",
> "webSite"})
>        public void test2(String seleniumHost, String seleniumPort, String
> secondEnvironment, String webSite){
>                Function1();
>        }
>
> If that is the case, the current TelluriumTestNGTestCase does not support
> that yet. But we can add such support soon. We simply didn't have enough use
> cases when we implemented the TelluriumTestNGTestCase. Your request is a
> good one to improve TelluriumTestNGTestCase.
>
> We will try to add the support and let you know when we are done. For the
> time being, please still use the BaseTelluriumJavaTestCase.
>
> Thanks,
>
> Jian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to