RemoteWebElement to SelenideElement

625 views
Skip to first unread message

ccr...@rotundasolutions.com

unread,
Feb 2, 2018, 4:58:53 PM2/2/18
to selenide
Good day to all.

I've authored a class that extends com.codeborne.selenide.Condition.  Within the implementation of the overridden methods...

    public boolean apply(WebElement element);

...and...

    public String actualValue(WebElement element);

...I wish to act upon the input argument WebElement as a SelenideElement (I have all sorts of support classes/methods that act upon SelenideElements using its lovely fluent interface). Is there any way to do this or am I stuck rewriting the same functionality again but using the less-elegant Selenium API?  Can I convert/look up a SelenideElement from a WebElement?

Thanks

Andrei Solntsev

unread,
Feb 2, 2018, 5:49:49 PM2/2/18
to ccr...@rotundasolutions.com, selenide
Hi!
It's very easy to convert WebElement to SelenideElement: just use method $.

WebElement we = ...;
SelenideElement se = $(we);

Andrei Solntsev

--
You received this message because you are subscribed to the Google Groups "selenide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenide+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ccr...@rotundasolutions.com

unread,
Feb 2, 2018, 5:59:24 PM2/2/18
to selenide
I'm not sure how I missed that.  The straightforward solution that I've come to expect from Selenide.  Thanks!

Andrei Solntsev

To unsubscribe from this group and stop receiving emails from it, send an email to selenide+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages