1

We are using selenium for web based applications and LeanFT for desktop & Citrix apps (eg: PowerBuilder, Terminal emulator) using Java

Using LeanFT or selenium exclusively causes no issues (we use LeanFT reporter and selenium TakesScreenshot) but the problem is, in one flow with screenshot capture, when we are switching context between LeanFT and Selenium.

What we have tried so far: Tried switching to LeanFT screen capture if selenium getDriver returns null but this doesn’t, it fails if we start webDriver first

In our framework screenshot are taken part of onTestPass, onTestFail so end users doesn’t have to explicitly call getScreenshot.

Any idea what we could leverage to notify method to capture screen based on LeanFT or selenium? The goal is to create a single report, by using both the results from selenium and the ones from LeanFT

Note: We don’t want to use LeanFT for everything (due to reusability of existing scripts) and we should use LeanFT for non web related systems

Adelin
  • 7,809
  • 5
  • 37
  • 65
HiroMT
  • 11
  • 2
  • It is not easy to answer based on the details provided. It's not a common setup what you're describing. I know a little selenium and plenty of LeanFT, so I need to know **(1)** how are screenshots handled in selenium (what is the method and what type it returns) **(2)** what is the exact goal? have a single report? **(3)** Can you switch to LeanFT on failure? (not when null) and **(4)** can't you use the reportEvent with image provided by selenium? – Adelin Mar 15 '19 at 07:55
  • To close voters: note that OP is not requesting off-site resources, but rather how to use the two frameworks, [tag:leanft] and [tag:selenium] together. That is valid, although the question could be clearer, which is why I asked for points above. – Adelin Mar 15 '19 at 08:06
  • (1) Selenium screenshots are done using “takescreenshot” interface by casting webdriver output is image file which gets copied to desired location from where we build report (we use ITestlistener TestNg interface) within which screenshots are called.(2)Yes,it’s for single report(3)As you mentioned we use combination of frameworks,leanft uses reportersdk.init which handles leanft screen capture but in our ITestlistener we need to differentiate when to use leanft reporter vs take screenshot (4) Hopefully,point 3 explains! – HiroMT Mar 15 '19 at 08:23
  • So you use testNG as a framework? Can you post a minimal setup, teardown and test methods? so we can see the logic - try to minimize as much as possible by making use of both selenium and leanft and I will provide a detailed answer. but before I can do that I need to see some of the current logic – Adelin Mar 15 '19 at 11:29
  • Without getting too detailed - setup and teardown are part of the framework that works like onTestSuccess,onTestFailure it will call a reporthelper which has getScreenshot for building the report.After every step screenshot will be taken depending on the result(pass/fail). Be it leanFT or selenium after each step it will call those methods for screenshots and in these methods we need to identify when to use LeanFT reporter image vs Selenium image. – HiroMT Mar 15 '19 at 14:25
  • @Adelin We managed to solve this in a more crude way.It works the way we wanted it to work. Basically,we are comparing the leanFT image (which takes screenshot for all steps) and see if a new image has come if not go to webdriver and take screenshot using webdriver – HiroMT Mar 15 '19 at 16:05

0 Answers0