Top Banner
Selenide bindings for C# How to call Java from C# Oleg V. R&D Manager @ SBTech
14

Selenide for C#

Jan 24, 2018

Download

Engineering

Oleg V.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Selenide for C#

Selenide bindings for C#How to call Java from C#

Oleg V.R&D Manager @ SBTech

Page 2: Selenide for C#

About me || Why am I here

1. I’m developer, originally…

2. OK, I will tell you secret

3. Share knowledge re Selenide for C# which well known for Java

4. What is the Selenide? Tell me more!

2

Page 3: Selenide for C#

The Problem

• Selenide – good timesaver for business (make tests faster!)

• Works on Java only 3

Page 4: Selenide for C#

[Bad] Solution – Straightforward – Port to C#

• Port Selenide to C# - it’s a way to nowhere (/dev/null)• Cons:

• Impossible to give full feature set now

• C# lib always lags behind

• Fix the same issues again

• Increase Universe entropy…

• Pros:• Improve your C# skills

4

Page 5: Selenide for C#

[Good] Solution – LEAN – Use JNI

• Bindings C# to Java (though JNI) – it’s our way• Pros:

• Amazingly fast to get C# Selenide

• All features included out of the box

• Apply bug fixes automatically

• Release continuously with Java lib

• It’s a lean way ;)

• Cons:• Less performance

• C#/Java compatibilities issues

5

Page 6: Selenide for C#

Demo Time

• Stop your horrible speaking!

• Here is Selenide-based code in

6

Page 7: Selenide for C#

The secret is… JNI

• Who knows this beast? I’ve looked to an answer and… found

7

Page 8: Selenide for C#

OK, JNI seriously

• Simple picture is:

8

Page 9: Selenide for C#

JNI more seriously

• NOT only C and C++, any native method

9

Page 10: Selenide for C#

Lifehack – jni4net – Thanks to Pavel Savara

10

Page 11: Selenide for C#

Implementation Details

• GOOD news• It works like POC

• Has a documentation.• Yep, it’s not a joke. I’ve documented it…

• It’s messy how-to, but it is.

• BAD news• Issues in jni4net toolset (ellipsis, Selenium proxies)

• No automation (required to release Java and C# libs together)

11

Page 12: Selenide for C#

Experience

• GOOD news• Ready for small startups or pet projects

• Already build – one click to run.

• BAD news• Need to finalize for heavy/production usage

• Performance not measured (my bad), but it will be less because of JNI

12

Page 13: Selenide for C#

Awaiting for YOUR contribution

• Improve solution: https://github.com/neooleg/selenide-for-c-sharp

• Bring ideas how to solve conceptual issues (e.g. Selenium wo/ lib4net)

14

Page 14: Selenide for C#

Oleg V. – About & Contacts

• Positions• Chief Technology Officer

• R&D Manager

• Philosophy• Lean rocks!

• Business should drive development – this is startup

• Contacts• GitHub: https://github.com/neooleg

• Telegram: @neooleg

• Twitter: @oleg4t

15