Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Selenide for C#

3,123 views

Published on

Selenium, jni4net, Selenide and C# to make possible which was impossible

Published in: Engineering
  • Be the first to comment

Selenide for C#

  1. 1. Selenide bindings for C# How to call Java from C# Oleg V. R&D Manager @ SBTech
  2. 2. 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
  3. 3. The Problem • Selenide – good timesaver for business (make tests faster!) • Works on Java only  3
  4. 4. [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
  5. 5. [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
  6. 6. Demo Time • Stop your horrible speaking! • Here is Selenide-based code in 6
  7. 7. The secret is… JNI • Who knows this beast? I’ve looked to an answer and… found  7
  8. 8. OK, JNI seriously • Simple picture is: 8
  9. 9. JNI more seriously • NOT only C and C++, any native method 9
  10. 10. Lifehack – jni4net – Thanks to Pavel Savara 10
  11. 11. 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
  12. 12. 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
  13. 13. 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
  14. 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

×