Selenium Grid 2 - Nodes

瀏覽次數:713 次
跳到第一則未讀訊息

vitorm

未讀,
2012年4月10日 下午1:00:572012/4/10
收件者:Selenium Users
Hi all!

Is there any documentation around on how to delegate what each node
will do/run? I've read somewhere that there is ways to do this, but
unfortunately I haven't found anything better than "look at the cood
and think of something" stuff so far.

So far I've started a hub and a couple of nodes (one default and one
IE only), but I don't know how to "intercept requests" (don't know if
this sounds right) to each of them, or if this is even possible/
plausible.

Thanks in advance!

François Reynaud

未讀,
2012年4月10日 下午1:41:592012/4/10
收件者:seleniu...@googlegroups.com
http://code.google.com/p/selenium/wiki/Grid2

What do you mean by "intercept request". Are you trying to use grid to modify the requests sent by the tests ?

François


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


vitorm

未讀,
2012年4月10日 下午4:45:512012/4/10
收件者:Selenium Users
Hm no. I want to know if there's a way to modify the hub behavior when
delegating a node to run a test, kinda like "extending" it. For
example, let's say I have 2 nodes, one that supports 5 FF instances
and the other one IE instance. How the hub will know the node it will
delegate the execution of the test? I want to understand how that
happens and if I can modify that behavior if needed.

It's more like a "understanding the grid structure" question rather
than a "how to do this or that" one, so sorry if this sounds too dumb/
confusing, I'm still trying to get the big picture.

Kevin O.

未讀,
2012年4月10日 晚上9:02:152012/4/10
收件者:Selenium Users
>How the hub will know the node it will
>delegate the execution of the test?
It basically finds the first node that matches the requested
capabilities. Platform is a special case, but other than that it
matches browser name, version, and applicationName?? by string
comparison and no others.
If the node selection build in is not sufficient you can override it.
The easiest way to do that is to compile a class that implements
org.openqa.grid.internal.utils.CapabilityMatcher and make sure your
code is in the classpath before you start Selenium server with this
argument:
-capabilityMatcher:
(hub) a class implementing the CapabilityMatcher interface.
Defaults to
org.openqa.grid.internal.utils.DefaultCapabilityMatcher. Specify
the logic the hub will follow to define if a request can be
assigned to a node.Change this class if you want to have the
matching process use regular expression instead of exact match
for the version of the browser for instance.Al the nodes of a
grid instance wil use the same matcher, defined by the registry.

François Reynaud

未讀,
2012年4月11日 清晨5:51:272012/4/11
收件者:seleniu...@googlegroups.com
You can extends everything in grid via plugins. For that you need to read the code though, no real doc here.
A plugin will replace the default proxy that is used to forward the tests to the nodes.
You hook into grid internals by having your new proxy implementing those interfaces :

https://github.com/krosenvold/Selenium2/tree/master/java/server/src/org/openqa/grid/internal/listeners
A tutorial, outdated here : https://github.com/freynaud/grid-plugin-tutorial

The logic for forwarding a new test is :
- take all the node, sort them by number of test running
- iterate throught them, the first one that is capable of running the new test will run it.
( capable of running is configurable by specifying your own capabilityMatcher )

vitorm

未讀,
2012年4月11日 上午8:26:072012/4/11
收件者:Selenium Users
Wow, that's exactly the kind of answer I was looking for :) I'll work
on those.

Thanks guys!

On 11 abr, 06:51, François Reynaud <francois.reyn...@gmail.com> wrote:
> You can extends everything in grid via plugins. For that you need to read
> the code though, no real doc here.
> A plugin will replace the default proxy that is used to forward the tests
> to the nodes.
> You hook into grid internals by having your new proxy implementing those
> interfaces :
>
> https://github.com/krosenvold/Selenium2/tree/master/java/server/src/o...
回覆所有人
回覆作者
轉寄
0 則新訊息