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

Selenide for C#

  • Upload
    oleg-v

  • View
    2.376

  • Download
    4

Embed Size (px)

Citation preview

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

Oleg V.R&D Manager @ SBTech

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

The Problem

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

• Works on Java only 3

[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

[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

Demo Time

• Stop your horrible speaking!

• Here is Selenide-based code in

6

The secret is… JNI

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

7

OK, JNI seriously

• Simple picture is:

8

JNI more seriously

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

9

Lifehack – jni4net – Thanks to Pavel Savara

10

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

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

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

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