Selenium Grid 1 emulate to Grid 2?

64 views
Skip to first unread message

sabf

unread,
Jun 16, 2011, 1:46:31 AM6/16/11
to selenium-...@googlegroups.com
Hi,

i read that there is the possibility to emulate selenium rc (http://seleniumhq.org/docs/03_webdriver.html#emulating-selenium-rc), but is there also a
way for selenium grid (hub)???
Thats my code:
DesiredCapabilities capability = DesiredCapabilities.firefox();
        capability.setVersion("4");
//        DesiredCapabilities capability = DesiredCapabilities.internetExplorer();
        String webSite="https://tstweb06c.sunmaker.com";
        WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
        driver.get(webSite);

Thank for your reply

François Reynaud

unread,
Jun 16, 2011, 10:20:53 AM6/16/11
to selenium-...@googlegroups.com
Hello,

Grid2 supports both selenium1 and webdriver tests protocols.
What are you trying to do ?

thanks,
françois

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-developers/-/FNuCFABMfusJ.
To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.

sebarmeli

unread,
Jun 16, 2011, 6:46:49 PM6/16/11
to Selenium Developers
Hi Francois,

regarding this topic, I've got a module in my code that uses selenium
1 and uses a hub on port 4444. Now I'm using port 5555 for the new
code using Selenium 2, if I point even the first module to the Grid 2
hub, will it work without me changing any code?

Thanks a lot.

Cheers,
Sebastiano

On Jun 17, 12:20 am, François Reynaud <francois.reyn...@gmail.com>
wrote:

François Reynaud

unread,
Jun 17, 2011, 2:07:08 AM6/17/11
to selenium-...@googlegroups.com
grid2 can distribute tests using selenium1 and webdriver , but it will listen on the same port.

Changing the port in your tests shouldn't be a problem

Kevin Menard

unread,
Jun 17, 2011, 8:40:33 AM6/17/11
to selenium-...@googlegroups.com
Hi Sebastiano,

If your grid_configuration.yml file is on the classpath, the Grid 2
hub will load your Grid 1 configuration file. Your Grid 1 nodes can
register themselves with the Grid 2 hub and your tests will work
without any code modifications.

So, there's very little reason to keep both hubs around. The new hub
offers quite a bit more functionality and is quite stable now. The
backwards-compatibility means you can migrate your nodes to Selenium 2
at your leisure.

--
Kevin

sabf

unread,
Jun 20, 2011, 7:26:04 AM6/20/11
to selenium-...@googlegroups.com
Hi,

what i need is to emulate my grid1 code e.g.:

@Parameters({"seleniumHost", "seleniumPort", "browser", "webSite"})
    protected void startSession(String seleniumHost, int seleniumPort, String browser, String webSite) throws Exception {
        startSeleniumSession(seleniumHost, seleniumPort, browser, webSite);
        session().setTimeout(TIMEOUT);
        WebSite = webSite;
        Browser = browser;
    }
How will this looks in grid2?

François Reynaud

unread,
Jun 20, 2011, 9:16:13 AM6/20/11
to selenium-...@googlegroups.com
Hi,

please try the exact same code on grid2.
This looks like a wrapper around selenium1 API. Selenium1 is supported on grid2.

thanks,
François

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.

sabf

unread,
Jun 22, 2011, 2:02:50 AM6/22/11
to selenium-...@googlegroups.com
Hi,

thank you François for that information.
It is after that also possible to use the new method from selenium2 like "driver.findElement(By.name("loginForm-username")).sendKeys("FranzHamburg");"???
Can I mix it?

Greetings,
sabf

François Reynaud

unread,
Jun 23, 2011, 5:14:16 AM6/23/11
to selenium-...@googlegroups.com
Hello,

you can mix, but that's not a feature of grid, it's a webdriver feature.


WebDriver driver = new RemoteWebDriver(new URL("http://"+hub+":4444/wd/hub"), cap);
WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver, baseUrl);
// selenium 2 API
driver.get("http://ebay.co.uk");
// selenium 1 API wrapped automatically to look like selenium 1 API
selenium.getTitle();

both command will end up driving a webdriver server, but you can use both API that way.

thanks,
François

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.

Kevin Menard

unread,
Jun 23, 2011, 9:43:52 PM6/23/11
to selenium-...@googlegroups.com
You can have both types of nodes connected to the grid and your client
can request the appropriate type. But you can't do anything you
couldn't do with Selenium outside of grid. It's the same underlying
API.

--
Kevin

> --
> You received this message because you are subscribed to the Google Groups
> "Selenium Developers" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/selenium-developers/-/nUsYK_f5-YMJ.

Subhabrata Pal

unread,
Jun 24, 2011, 5:32:31 AM6/24/11
to Selenium Developers
Hi,

Just following you conversation; like to ask - can we open multiple
ports here in Grid 2 with in same system(like we can do in Grid 1)?
When I tried using webdriver - say I have opened 1st 5556 & then when
I opened 5557; I got a message in 'grid console' - "5556-cannot be
reached.."


Regards
Subhabrata

On Jun 24, 6:43 am, Kevin Menard <nirvd...@gmail.com> wrote:
> You can have both types of nodes connected to thegridand your client
> can request the appropriate type.  But you can't do anything you
> couldn't do withSeleniumoutside ofgrid.  It's the same underlying
> API.
>
> --
> Kevin
>
> On Wed, Jun 22, 2011 at 2:02 AM, sabf <s.a....@gmx.de> wrote:
> > Hi,
>
> > thank you François for that information.
> > It is after that also possible to use the new method from selenium2 like
> > "driver.findElement(By.name("loginForm-username")).sendKeys("FranzHamburg");"???
> > Can I mix it?
>
> > Greetings,
> > sabf
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "SeleniumDevelopers" group.
> > To view this discussion on the web visit
> >https://groups.google.com/d/msg/selenium-developers/-/nUsYK_f5-YMJ.
> > To post to this group, send email toselenium...@googlegroups.com.

Tarun K

unread,
Jun 24, 2011, 1:17:47 PM6/24/11
to selenium-...@googlegroups.com
Please post your question in right forum -

https://groups.google.com/forum/#!forum/selenium-users

Thank
~T
Reply all
Reply to author
Forward
0 new messages