Automation of NON GUI application using selenium - selenium

I have a web application running on tomcat.My application has no GUI.It processes files on some locations and persists values into the database and produce some output files on some locations.
I need to Automate testing of this application using selenium.This includes file creations, file movements between folders..etc.
My question is
1.Is it possible to automate this non-GUI application using selenium?How?
2.Is it possible to include these file creations, movements and DB values checking using selenium web driver

If you look at the Home Page of Selenium it is clearly mentioned that :
Selenium is the most widely-used open source solution in building Test Automation for Web Applications. The suite of tools provided by Selenium results in a rich set of testing functions specifically catering to the needs of testing of web applications of all types. These operations are flexible and allows many options for locating UI elements and comparing expected test results against actual application behavior.
As your Automation Testing requirement is :
File Creation
File Movements between folders
It seems Selenium may not be the appropiate tool.
A framework built through Perl or Python may better cater to your requirement.

Selenium is created to automate test on UI. You can use on Page Object Model or directly on findelement(or findelements) but you have to give a locator attribute which it can be according to selenium documentation:
id
name
xpath
link_text
partial_link_text
tag_name
class_name
css_selector
So if you have these locators yes, but if you don't, Selenium is not suiting for this task. Maybe you looking for an API tester, Unit tester or what are you trying to accomplish?

Related

Ui Flows - Selenium IDE (recorder tool) - How do I store the returned value of an embedded javascript function in a webpage I am scraping?

Basically I want to be able to store a URL from a link I found on the webpage. The link itself is dynamically generated by a java script function embedded within the webpage. My question could also be satisfactorily answered by a command that grabs the current webpage URL, but I have not found any way to do that in this particular tool.
Before you ask, I cannot use a different tool, it must be this one or a Microsoft Flows / Microsoft Power Apps function/tool. This unfortunately rules out code-based python and code-based selenium as possible solutions for me.
I'm guessing you are using the latest Selenium IDE. You can get the current window URL using the JS execution capabilities of the IDE.
"command": "executeScript",
"target": "return window.location.href"

Options for recording the tasks done in a browser for UI Automation Test

Is there a tool that can record user interactions with DOM elements for usage in creating automated tests (I'm using Codeception and Laravel Dusk but any tool with roots in Selenium is fine). I'm looking for something to record a sequence and get back a list that might include:
Browser navigate to /contact
Focus input "#name"
Enter text "Joe" in input #name
Focus textarea textarea[name=message]
Enter text "Hello world" in textarea textarea[name=message]
Click element input[type=submit]
Browser navigate to /contact?thanks
I see GhostInspector but that is tied directly into a cloud based company and I don't want that, I'd like some degree of control over what the plugin does and be able to record pages not on the public web.
I can see building a tool that recorded every action is non-trivial - mousemove events, focus, text selection, keyboard events, scroll events, etc. Ideally I can say "listen to every focus, click, and keyup event on an input or textarea or button or select or option" and also watch for url changes.
Does such a tool exist? Doesn't matter what browser stack it runs on really, just need the ability for a user, maybe a novice user, to go to a website, hit record, do some actions, and get back a list of what occurred.
The instantaneous downvotes that contend my question is "not about programming" prompt me to improve my question. I don't presume the nature of the tool - it might be programming methods? Ways to use the browser to listen for all events and log them in some manner? Might be a Chrome extension? Might be a framework? Might be a library? I'm looking for the experience of programmers to help me with the programming task I'm trying to accomplish.
Have you tried using the Chrome extension Laravel TestTools?
https://chrome.google.com/webstore/detail/laravel-testtools/ddieaepnbjhgcbddafciempnibnfnakl
Katalon Recorder (Selenium IDE for FF55+)
https://addons.mozilla.org/en-US/firefox/addon/katalon-automation-record/
The straight answer to your question is: Yes there are a number of tools available that are on top of Selenium. I will briefly discuss the top ones that also support browser extensions
1. New Selenium ID(Open Source)- Selenium is possibly the most popular open-source test automation framework for Web applications. The new Selenium IDE is designed to record your interactions with websites to help you generate and maintain site automation, tests, and remove the need to manually step through repetitive takes.
Features:
Recording and playing back tests on Firefox and Chrome.
Organizing tests into suites for easy management.
Saving and loading scripts, for later playback.
Selenium has become a core framework for other open-source test automation tools such as Katalon Studio, Watir, Protractor, and Robot Framework.
FireFox Extension
Chrome Extension
2. Kantu(Open-source)- It is a record & replay tool for automated testing, web automation, automating file uploads and autofill form filling. The visual UI testing commands of Kantu help web designers and developers to verify and validate the layout of websites (and canvas elements).
Features:
Kantu provides with built-in flow control commands like if/else/endif, while/endWhile or GotoIf
FireFox Extension
Chrome Extension
3. Katalon Automation Recorder- Katalon have Katalon Studio which is a completely free desktop application. Recently they launched new Selenium IDE that helps you record actions, capture web elements on web applications, play automated test cases, and do reporting quickly and easily.This Extension was the champion project of Katalon Studio Hackathons contest.
Features:
Record, play, debug with speed control, pause/resume, breakpoints capabilities.
Enjoy fastest execution speed compared to other extensions with Selenium 3 core engine.
Import test data from CSV files for data-driven testing.
Report easily with logs, screenshots capturing, with historical data and analytics from Katalon Analytics.
FireFox Extension
Chrome Extension
Few references for further comparison:
https://medium.com/#briananderson2209/best-automation-testing-tools-for-2018-top-10-reviews-8a4a19f664d2 (comments section will also helpful)
https://a9t9.com/blog/selenium-ide-2018/
https://www.g2crowd.com/categories/test-automation
https://www.qasymphony.com/blog/100-plus-best-software-testing-tools/

Automated Testing on website with no elements / Xpath

Are you aware of any test automation tool that can handle a website that has no elements / xpaths / id's (basically no DOM). If I check DOM Explorer (IE browser) there are only 'script' paths.
Devs told me that those screens are some sort of .NET internal system app (check screenshot)
I would not prefer to use some mouse recording tools or text recognition, but rather go for some script to manage those. Any ideas?
My guess is that in your case the Flash files (which are closed files) are rendered in a container on a webpage.
website that has no elements / xpaths / id's (basically no DOM)
For ex Flash player on Mozilla and Chrome and on ActiveX control in IE. Selenium relies heavily on JS communications (via JSON Wire protocol) and DOM in order to work as expected.
If I had to do it - I would try with Sikuli integration, so I could keep my initial approach and current setup (assuming you already had invested in such).
You didn't say what language you're using, so here and here are JAVA based implementations. I have used successfully C# based sikuli4net in the past to test ActionScript bingo games.

Launching selemium scripts from browser for screen capture

I am looking for creating a functional training package for a web based product (more like a screen capture).
However, the requirement is not just to have screen capture, but to have a test mode for the training where we can prompt the user to click on the screen and check if they have done proper flow.
for e.g. A banker will first go through the screen capture to see "how to open an account" in the core banking application . Later user will be presented with a test where user has to click through all the controls and flow.
I have seen selenium being used for authoring good UI automation test cases, so I wanted to explore the possibility of using selenium for creating these training modules
These training modules needs to be launched from intranet application. Is it possible to launch selenium authored UI automation test cases from the browser? I want to stay away from writing any extensions or plugins.
I haven't used selenium and I might be completely off tangent here, so any other suggestion to achieve this using open source tools are welcome.
Without writing any scripts, you may consider downloading Selenium IDE. It has a recording and replay function that may meet your need.
For a fast tutorial, please follow this link.
https://www.youtube.com/watch?v=gsHyDIyA3dg
Hope it helps.

Software Automation tool

At my company, we have to fill out a daily timecard, and I want to automate it.
I want to use some sort of tool that will allow me to write something like this:
Launch Firefox
go to www.example.com/timecard
Wait for page load complete
In UserName box: put username
In Password box: put password
Press enter
Wait for page load complete
if login failed
email me#example.com that unable to automatically do timecard, please check password
return;
Get today's date
if today is Saturday or Sunday
close firefox
return;
find the timecard column that matches today's date
find the row with the right charge number
put in 8.0 hours
click "Save" link
close firefox
return;
It would be really nice if the software solution will also execute itself daily at a given time.
Since you are asking about UI automation you might want to check out AutoHotKey.
It's a macro language and you can compile the code into executable binaries (.exe).
However, sending web request could be done better without a browser by sending the necessary HTTP requests. Such an approach is more light-weight, more flexible and probably easier to maintain as well.
Check out the Chickenfoot extension for Firefox. I believe it may help you a long the way.
Chickenfoot is a Firefox extension that puts a programming environment in the browser's sidebar so you can write scripts to manipulate web pages and automate web browsing.
It also provides a basic record feature, and you can then fine-tune the interactiosn with the web page(s).
If all you need to automatize is related to browsers, then you may try out Selenium Remote Control which provides libraries in different languages.
For browser automation, there are a couple more experimental libraries in javascript (you should search for web app testing tools as these are imo your best bet for now)
./alex
For decision making, you might have to write some code.
iMacros for firefox has the ability to record/playback.
I have not used it myself but I have heard good things about Selenium. This is a Web UI testing tool that can be scripted in a number of different languages.
I would try to accomplish this with twill.
If by "some sort of tool" do you mean something like a programming language or environment that will allow you to automate what FireFox does? If so, I recommend learning how to write a FireFox extension. Extensions are written in Javascript. See https://developer.mozilla.org/en/Extensions
--
bmb
You could use selenium or watin on a simple .net console program. Then configure a task on window to call it at a given time of day.
If you are using Linux you could easily do this with a bash script of some kind. Have a look at the CURL library.http://curl.haxx.se/. You could then schedule the script to run with cron.
This is why I love Linux, the above is simple to do. I windows I suppose you could use the windows shell. I think the curl library runs on windows.
Selenium (www.openqa.org) tools will work for you. Install the Selenium IDE and record the macro. The "code" is simple JavaScript/HTML.
Selenium RC provides a very strong solution for automated testing from a variety of languages and tools.