Possibilities on integrating existing cucumber framework with appium - java

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

Related

LeanFT and selenium webdriver screenshot - switching between

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

Selenium WebDriver like tool for desktop application

I am struck up in my below task, hope this idea will be very useful for many.
In my company they use several Health Monitoring tool and we do the Health Checks manually.
We have a separate health check plan and process, where we go to Web Applications like Site Scope or open certain jars like Spectrum CA (runs as a JNLP file) and check for the server status/health data manually.
As we have more than 50 monitoring tools like that I suggested to automate the Health Checkups.
Initially I was suggested to do the automation using Python but I am a JAVA Web developer so I moved to Selenium/Jsoup and use Web-scraper concept to fetch the information and do the health checkups. I am able to do considerable progress using Selenium to automating the manual Health Checks using the Web Application.
Problem: As I mentioned we also need to do certain health checkups using jar, desktop apps or jnpl file (applet), I am not sure on how to proceed in automating these. We are not supposed to use any paid tools or unreliable freeware which record and replay the manual desktop operations.
I do not have any idea on those, so can you please suggest me a tool or testing automation tool for these Desktop applications where I should be able to LogIn into it, Enter some text in the TextBox, Search, filter, navigate and get a value and finally verify whether the health is green ?
Note: Few of the application are legacy application so they don't use any api calls.
There are 2 free tools which can cater to your needs which can be used alongside Selenium w/ java:
1) AutoIT - good for window based applications
2) Sikuli - an image based automation Tool
I do not have any idea on those, so can you please suggest me a tool or testing automation tool for these Desktop applications where I should be able to LogIn into it, Enter some text in the TextBox, Search, filter, navigate and get a value and finally verify whether the health is green ?
For the above question, Winium can be used for desktop app automation. It is similar to Selenium. You can write code in java to automate the process. below is the git link for Winium.
https://github.com/2gis/Winium.Desktop
I was looking at FlaUI, you can have a look at this as well. This works with c# though
https://github.com/Roemer/FlaUI

Using Selenium Webdriver Selectors in Appium ios

A project I'm on is developing a web app at the same time as an ios app (for the same thing) and I'm hoping to be able to use existing Selenium tests, but we're having trouble with selectors. Is there a selector type or attribute name that can be used for both Selenium Webdriver and Appium ios, so that I can just set a variable to either browser or app and they run and work on both. Nobody on this project has used Appium before, so we are lacking a lot in knowledge.
I tried using IDs and found that ios doesn't work with them, changed to names and found that names have been removed from appium. If possible we'd prefer to use a selector that will be the same in the browser as it is in the app.
Thanks
You can create one object repository file which contains the locators for both WebApp and iOS app. Then you have to follow the below process
Create WebDriver and AppiumDriver instances
Use the relevant drivers for locating the elements in WebApp as well as iOS app. We can use both the drivers within a test case.
Please note that, the way WebDriver and AppiumDriver identifies the elements will be different. For example, in WebDriver if an element is identified by using ID then similarly in AppiumDriver an element can be identified by using the findElementByAccessibilityId.
Even though AppiumDriver uses the same logic which WebDriver uses, the method names will differ. Please find the link for all the methods used by AppiumDriver
Hope this helps.
How about creating multiple object repositories and loading the relevant object repository based on the underlying platform?
1. So you need to store locators of both the platforms in separate repositories
2. Create a Interface / wrapper which would load relevant repository based on the platform on which tests are going to run.
Didn't quite get the question but for Appium You have separated annotations for bot iOS and Android platform similar as for web via:
#FindBy(id="buttonOK")
private WebElement buttonPopUp;
Here is example for Android and iOS
#iOSFindBy(id = "lets_do_it")
#AndroidFindBy(id = "message_popup_dismiss_button")
#WithTimeout(unit = TimeUnit.SECONDS, time = 1)
private MobileElement buttonPopUp;
So in same pageObject you have covered both platforms.
Mobile platform can work together, but recommendation is not to mix web and mobile, but mobile platforms can play together just fine, and is recommended so can share same code functionality.

How to run Selenium tests with single click or single command?

I'm writing Selenium tests using Java + Maven + Selenium WebDriver. Our customer wants these tests in such a way that they can run tests easily without much technical stuff needed.
I've all my tests under src\test\java folder. Is there any way where I can give jar file or so to the customer and they can run tests by simply clicking on it or by hitting some command on the command line.
Please point me to documentation or video using which I can achieve this.
I've been using Visual Studio to write my Selenium tests in C#. I am able to build my project to a console application in Visual Studio that contains the required files like the Chrome webdriver. It can be run from this single application file with one click. The console then prints out if the test is a success or if their are any exceptions. You should also be able to integrate a headless browser like selenium has on their site. This would allow the test to be run with one click and no browser will pop up while the tests are running.This is all the experience I have and it has worked well for me. Hope that this information can help a little.

steps to automate a flex application using flex monkey and selenium

Am trying to automate a sample Flex application using Flex Monkium and selenium.
The steps and sample application (MonkeyContacts) are given in gorilla logic site http://www.gorillalogic.com/testing-tools/flexmonkium/flexmonkium-docs/using-flexmonkium .
After following the steps in the above application i am able to record the tests using Selenium IDE and able to run those tests using Eclipse and TestNG.
But when am trying to do the same steps in other applications ( http://learn.adobe.com/wiki/display/Flex/Download+Projects ) , not able to record the tests. There is no interaction between Flex Monkey and Selenium. I have added the automation-monkey.swc and added the Additional compiler arguments also.
How to make the application to interact with selenium..?
Thanks in Advance.
Gorilla logic has beautify stated all related steps for flex monkey automation, I'll say you give it a look again. Flex monkey documentation
Apart from this always make sure
Flex monkium console icon turns green (if not its NOT compiled properly, check compiler arguments.
Use firefox version 10 or less. Selenium is not compatible with later versions.

Categories