[GRID] custom CapabilityMatcher

840 views
Skip to first unread message

webtester

unread,
May 6, 2012, 2:40:21 PM5/6/12
to webdriver
Hello,

I need some help in creating my own capability matcher. I like to
start the NODES with an extra parameter, this is the parameter:
"ipaddress" : "ip from machine"

Starting the node with an extra parameter is not the problem (just
editing the JSON file). The problem is to create a custom capability
matcher.


public class customCapabilityMatcher implements CapabilityMatcher {

public boolean matches(Map<String, Object> arg0, Map<String,
Object> arg1) {
return false;
}
}

Above is the skeleton. How should I create the matcher?


In my test I like to do this:

DesiredCapabilities capability = new DesiredCapabilities();
capability.setCapability("ipaddress", "192.168.1.2");

And match against the node with the same (given) IP.


I hope someone can help me on this,
Roy

Krishnan Mahadevan

unread,
May 8, 2012, 9:14:50 AM5/8/12
to webd...@googlegroups.com
Roy,
This thread should answer your question or atleast help you get started




Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"




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


webtester

unread,
May 8, 2012, 12:49:45 PM5/8/12
to webdriver
Yes, I saw that one.

But I'm interested in the Java code ? I need some help, because I
donno how it should look like ?

Anybody?



On 8 mei, 15:14, Krishnan Mahadevan <krishnan.mahadevan1...@gmail.com>
wrote:
> Roy,
> This thread should answer your question or atleast help you get started
>
> http://groups.google.com/group/selenium-users/browse_thread/thread/48...
>
> Thanks & Regards
> Krishnan Mahadevan
>
> "All the desirable things in life are either illegal, expensive, fattening
> or in love with someone else!"
>

David

unread,
May 9, 2012, 4:40:49 PM5/9/12
to webdriver
Perhaps you can try contacting the user (vitorm) who started the
thread mentioned by Krishnan. Maybe the user has implemented something
and has tips or sample code to share.

David

unread,
May 9, 2012, 5:21:17 PM5/9/12
to webdriver
this is a bit related and might help as well?

http://groups.google.com/group/selenium-users/browse_thread/thread/3d1b0405c6e93653

On May 8, 9:49 am, webtester <rdekleijnaspi...@gmail.com> wrote:

webtester

unread,
May 11, 2012, 4:56:10 PM5/11/12
to webdriver
it didn't help actually...

I hope someone can provide an example.



On 9 mei, 23:21, David <manga...@gmail.com> wrote:
> this is a bit related and might help as well?
>
> http://groups.google.com/group/selenium-users/browse_thread/thread/3d...

David

unread,
May 11, 2012, 9:13:45 PM5/11/12
to webdriver
While we wait for an example (I'm interested as well). What do you
need help with exactly? How to match by IP address of available nodes
in the grid?

If that's a case, maybe code snippet example for how to extract IP
address from current node a driver is using might help...but dunno...

https://gist.github.com/1766772

http://groups.google.com/group/webdriver/browse_thread/thread/415b17c853a5ccbc

the question then is how to query hub for available nodes and then for
each node, request IP and see if it matches given IP. If match, return
that node.

webtester

unread,
May 13, 2012, 10:58:34 AM5/13/12
to webdriver
It was just an example...

I like to start the node with an extra capability.

So I need to query the HUB to check if there is a Node with that
specific key / value. If match, return
that node.

Hopefully someone is able to provide the example.


On 12 mei, 03:13, David <manga...@gmail.com> wrote:
> While we wait for an example (I'm interested as well). What do you
> need help with exactly? How to match by IP address of available nodes
> in the grid?
>
> If that's a case, maybe code snippet example for how to extract IP
> address from current node a driver is using might help...but dunno...
>
> https://gist.github.com/1766772
>
> http://groups.google.com/group/webdriver/browse_thread/thread/415b17c...

webtester

unread,
Jun 9, 2012, 6:46:20 AM6/9/12
to webdriver
Anyone?
> > > > > > > I need some help in creating my own capabilitymatcher. I like to

David

unread,
Jun 10, 2012, 2:48:16 PM6/10/12
to webdriver
webtester, maybe you should try posting this in other forums as well,
since you haven't gotten your ideal response here so far.

E.g. Selenium users (or developers) Google Group, SQAForums.com
Selenium forum, LinkedIn groups for Selenium / WebDriver, Facebook /
Google+ Selenium / WebDriver (group) pages
Reply all
Reply to author
Forward
0 new messages