How to automate PHP-Flash web application using selenium java - java

I need to automate a web application which is in PHP with flash. Is it possible to automate the application using selenium java with FlexUISelenium or FlexMonkium.
Thanks in advance.

If it's pure Flash without Flex then you should put some external like these methods to your Flash application and call them from your test code in order to verify functionality. If it's Flex then FlexUISelenium and FlexMonkium will help you - but again you should compile these libraries into your Flex app - they contains required methods to be called from Selenium.
In the case you are not allowed to modify your Flash application I would recommend to take a look to image-based tools like Sikuli

Related

How to integrate selenium and ZAP

I am planning to automate security testing for a web application.
I have the selenium code which is developed using JAVA language, now I need to integrate with ZAP.
Kindly help me how to integrate these two and generate the reports for the same.
You can configure Selenium to use Zap as a proxy. Take a look here for a full solution using WebDriver.io, which is a tiny JS wrapper around selenium. It should give you a high level overview of how to build and run such a solution in the CI. Let me know if you need more help.

Java webdriver for angular application not protractor?

I will be responsible for test automation for angular application. I know that we have a protractor tool but i prefer webdriver with java(feel better with this than javascript and protractor). May i use java with webdriver or i must do it using protractor because selenium will not handle it?
Of course, you can still use the regular Java selenium bindings to test AngularJS applications. It's just that Protractor is simply more suitable/convenient to use for specifically AngularJS applications because of the several unique things it provides:
it works in sync with Angular - it always knows when Angular is "ready" to be interacted with
it provides Angular specific locators like by.model, by.binding, by.repeater etc
it allows you to easily mock AngularJS modules on the fly
it is developed and supported by Google developers (and of course the github community) - meaning it is in sort of a sync with Angular development cycle
it has a very nice and documented API
and many more
It's also important to understand that Protractor is actually a wrapper around the WebDriverJS - JavaScript selenium bindings. And, as a side note, Protractor can also be used to test non-angular apps (just turn the sync off).
There is also ngWebDriver package that might actually be your solution:
We have taken JavaScript from Angular's Protractor project. While
ngWebDriver perfectly compliments the Java version of WebDriver, it
has to pass JavaScript up to the browser to inteoprate with Angular,
and the Protractor project has done the hard work (including testing)
to make that solid, and ngWebDriver benefits from that work.
Also see:
Use protractor with Java
how to implement protractor JavaScript API in Java to use in existing Selenium Java Frameworks

Hybrid android app code reuse for mobile web

I'm searching a way into world of hybrid mobile applications. I understand that hybrid android app uses some Webview which just shows HTML/javascript based webpage.
My background is maven, java, so for my application backend will be for sure in java, thats clear. But I'm not sure which way to go in case of the front-end and I have couple of questions emerging.
Can I somehow reuse the code between the android packaged hybrid app and the page served by the java backend for regular browsers(of
course without the android system function usage)?
Is it possible to manage it only via maven plugins or will I need to dig into npm, bower, grunt and such stuff(although I now lot of
them are already mavenized)?
Which js? framework to use? There are some already bound with cordova/phonegap(Ionic) and some that are standing aside(I like
Aurelia) which will probably be fine for web application, but for
android reusage it will not be easy to bound them with Cordova's
lifecycle. It is more about which kind not exactly about particular
.js framework selection. I.e. Can I just write some AngularJs
application for web and then extend it with Ionic?
I can imagine some structure like this in maven, note the communication to backend will be via WS
app-java-backend (is able to serve app-single-page-app)
app-single-page-app (this must support mobile and classical browsers)
app-hybrid-mobile (uses somehow the .js code from app-single-page-app)
UPDATE
Basically the question is about how to have common javascript base for hybrid app and same looking mobile page
UPDATE2
I can create mobile web app and then I will somehow bind with cordova. But how to do it properly using maven
You need to use cordova-cli to generate the project. Pay special attention to the create method and the --link-to option. that will allow you to use inside the cordova project the same folder that you use for the mobile site.
You do not need to do anything with maven by yourself as cordova can handle also other platforms than Android.
Hybrid Apps are based on HTML,CSS and Javascript. if you want to use your backend with the hybrid app you need web services/webAPI
so over all you need
Any UI Frame work like bootstrap/Ionic
Javascript Frame work like Jquery/AngularJs
and Web services to access backend
If you want to share code(front end HTML CSS ) between your web app and mobile app, you sure can do that. For example design a button and add some CSS to it. You can always reuse the same button CSS served from server to any front end client you want.
Try with just writing code for your project, later you will get hold of things , where and what component you can reuse. To keep this simple what you have asked is possible.

Chrome Browser and Java Message Passing

I have developed a Chrome extension and it captures some data in a webpage.
My ultimate goal is to pass this final result to my Java Application.
I have following few options in my mind, but I was not able to find any resources for them yet.
Access the localStorage externally.
Run Chrome browser through the Java app, So I guess we have the control of its data.
If no API found, write the result to a file and access it from the
Java App.
Is there any API to achieve any of the first 2 options? Or any other interface other than the file system?
I checked with berkelium and The Chromium Embedded Framework. But they are just chrome wrappers, and we cannot run a chrome instance from it.
Edit
For the 2nd option I tried with Selenium Webdriver, but I think it hasn't any method to access the localStorage.
It sounds like you are looking for Native Messaging, which allows communication between a Chrome Extension and a native application (e.g. a Java Desktop Application).
There are plenty of question here on SO regarding the implementation of Native Messaging and there is, also, the "official" example.
I suggest the above solution, but if your application will heavily interact with the extension (and you feel like reverse engineering) there is the open-source **[NetBeans Connector Chrome Extension][3]**, which uses a different approach (Sockets or WebSockets - I am not sure).
Take a look at **[this answer][4]** for info on how to get at the sources.
Is there a limitation preventing you from exposing a REST API with your java application?

Programmatic web browser Java library

Does anyone know of any Java library for programmatic web browsing?
Prowser doesn't cut it because there's no "push the button" method and Watij is limited to Internet Explorer Windows only.
htmlunit?
http://htmlunit.sourceforge.net/
The above link says:
... HtmlUnit is not a generic unit testing
framework. It is specifically a way to
simulate a browser for testing
purposes...
You may be able to find some of what you want in Selenium and especially when using Selenium Server like in this IBM article

Categories