Re: [selenium-users] Why does not any custom desired capability added in getNewSession method of proxy get's passed on

18 views
Skip to first unread message

Krishnan Mahadevan

unread,
Jan 21, 2018, 11:00:37 PM1/21/18
to seleniu...@googlegroups.com

You are querying the wrong place.

 

session.getSlot().getCapabilities() – retries the capabilities of the slot that matched your desired capability at the time of creating the new session.

 

You should be querying session.getRequestedCapabilities() to read the capabilities that were requested by the test.

 

Thanks & Regards

Krishnan Mahadevan

 

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

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <seleniu...@googlegroups.com> on behalf of Prvn <neevar...@gmail.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Monday, January 22, 2018 at 2:01 AM
To: Selenium Users <seleniu...@googlegroups.com>
Subject: [selenium-users] Why does not any custom desired capability added in getNewSession method of proxy get's passed on

 

I have a custom proxy that extends DefaultRemoteProxy. In the getNewSession method I'm adding my own custom capability to the desired capability map. It gets added perfectly fine. 

 

Eventually I'm trying to access this custom capability in afterCommand method in the same class. This is how I'm trying to access

 

afterCommand(TestSession session, HttpServletRequest request, HttpServletResponse response) {

   session.getSlot().getCapabilities().get(“my_custom_cap”);

}

 

But it returns null because the custom capability that I set in getNewSession is not even present when it reaches afterCommand method.

 

Why is this happening?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/287383df-4524-468f-9b95-429fbd498839%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages