LeanFT and selenium webdriver screenshot - switching between - java

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

Related

Possibilities on integrating existing cucumber framework with appium

I have an existing automated suite for web browser based application on cucumber framework using selenium and java. We are now planning to run the same test scripts for the mobile app of same application.
1. Is it possible to migrate or extend the existing web-based scripts to appium with limited code changes?
2. If option 1 is not possible, then will we have to right the entire scripts again using appium parameters or is it possible to use selenium parameters for identifying the elements of click, textbox etc.?
3. Any guidance or material on this enhancement/integration would be of much help.
1. Is it possible to migrate or extend the existing web-based scripts to appium with limited code changes?
The Framework structure could be retained .However i suggest you to create separate suite and test cases to handle appium.
Appium takes several parameter to start a session with a particular device and the session value is passed to the scripts , its like the driver being passed to Selenium scripts.
2. If option 1 is not possible, then will we have to right the entire scripts again using appium parameters or is it possible to use selenium parameters for identifying the elements of click, textbox etc.?
Appium is an extended version of selenium , so the command like Click element will work , However , i am not sure if the locator value will be same for Web element and App element.
You can try to locate your APP locator using Appium Desktop Appium Desktop for locating Elements and verify its values with locators from Web elements .
Any guidance or material on this enhancement/integration would be of much help.
Here is a tutorial if you want to learn Appium
Appium

How to run webdriver and JMeter code in Eclipse using Java

Below is my requirement :
(1)I need to do UI performance testing .
(2)At the end of the test I want jmx file to be generated,I do have the batch file that will convert it to jtl and then to html report.
Answers not known :
(1)I did browse through a lot of links that explained how to execute webdriver code using JUnit in JMeter. However I don't want to do that[run webdriver code in JMeter] and want my code to be a standalone code using HTMLUnit(headless browser) performing authentication and then the remaining click actions[Click on multiple links] ....Behind the scenes jmeter should record performance of every page and at end of test ,dump the results.Also it should be irrespective of testng /junit .Does anyone know if this is possible and can redirect me to the appropriate link.Thanks!
JMeter has nothing in common with the UI performance testing, as per JMeter main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
Both JUnit and TestNG automatically record function execution duration, you can build your test in such a way that measurable actions would be annotated with #Test annotation so the time will be automatically recorded.
In addition you can consider using Navigation Timing API from your WebDriver tests in order to get more information regarding page loading events.
If you still want to run JMeter tests from Java code - check out Five Ways To Launch a JMeter Test without Using the JMeter GUI article, it covers both running existing .jmx file and creating a new JMeter test purely using JMeter API from Java, however it is not applicable for your use case. The recommended way is to:
Create the main load using JMeter
Measure client-side performance using Selenium

Run seleniumtest using webdriver java for all browsers, without opening any browser

I have a general question about selenium:
Is there a way to run selenium webdriverv2 using java, in different browsers(chrome\firefox\safari...) without opening any browser?
I read about selenium grid, unfortunate in grid it open the browsers/machines.
If you dont want to open a browser, then Selenium isnt for you. If you want headless testing my suggestion would be to look into CasperJS.
I don't use Selenium for 6 month, but when I used it, it was necessary to open the browser and I think still being like that today.

can I run selenium 2 on real browser without webdriver?

Can I run Selenium 2 test cases (using Java) on a real browser (ex. Firefox) without using webdriver?
I would like to test the behavior on a real browser.
Thank you
Selenium 2 uses a "real" browser to execute your tests. The Webdriver is only to control the browsers (e.g. open a page, click on a button). However you also can test it in "remote mode" where no "real" browser is used.

How to run a test case without opening the browser window?

I have created a set of test cases using Firefox Driver in Eclipse IDE.
But now I need these test cases to run without opening the browser window. How can I achieve that?
Presently I am using Firefox Driver Web Driver that runs in Firefox Browser.
Can some one help me with an example?
If you do not need to think about compatibility of different web browser, you could try Celerity. It could be run automated test script without any browser window.
http://celerity.rubyforge.org/
It is based on JRuby, and is very easy to learn and use.

Categories