I need to automate some actions (testing ajax login on demand) in a browser.
I manage to obtain the desired behavior using selenium and chromedriver on my pc, but I need to make it work either in a UWP app or in an Android app (*and must run without a pc once deployed)...
Notes:
UWP App
It's a web service that runs on Windows 10 IOT Core on a Raspberry 3b+ (ARM7)
Selenium seems to be incompatible to UWP apps... Maybe because of they are sandboxed and can't start new processes?
The app won't be published on windows store
I can add all needed capabilities
Android
It's an app that remotly commands the UWP app
Selenium integration compiled but execution blocks on "webDriver.get(url)"; I did'nt find a way to make it work yet.
I'm flexible concerning software/os/browser/libraries/etc to use.
The UWP & Android Apps are kinda complexe (they have many file...)
I don't know how to install a browser on the IOT Core (did'nt find an msix or appxbundle I could use)
Some ideas I had:
- Deploying the ARM7 chromedriver with a portable ARM7 chromium with the app
- Using dockers
- Using raspbian & mono
The ideal solution would be simple and working on android (if possible)...
Any of you have an idea of how I could do that?
I finally found a solution. I reproduced the desired behavior in Android using a WebView and javascript using the evaluateJavascript method.
It's a little tricky but perfect for my need.
Related
Beginner programmer here- I want to convert a small program I made into an app- the original program uses selenium to load a website, ask for a username+ password, and auto logs you in and clicks a bunch of boxes and dropdowns, then exits.
I want to turn this all into an android app- I have a couple questions:
do I have to rewrite all my code in android studio
can I still use selenium or do I have to set up appium/ selendroid and if so, which one?
basically, the app should open up a UI screen, and ask for a username and password. From there it will open up a browser and click a bunch of stuff and that is it.
lots of love!
I am giving some important high level observations
App Type Cases
If your AUT is an android/ios native app then yes you have to use Appium or native frameworks like Espresso,XCUTest etc
2.If your AUT is a webapp with just a different user-agent like mobile,tablet etc then same tests can be used with little modification e.g.
2.1 You can use mobile emulation with Selenium - Chrome browser with mobile dimension
2.2 You can also use Appium with Emulator or real device - Chrome browser in Mobile device.
If your AUT is a hybrid app i.e. partly native and partly chrome session then
you have to use Appium
If Existing Tests Cases already present
If your browser application tests are already written in Selenium then you can use a tools which supports selenium methods like Appium for writing your android or ios app tests, this will help you in knowing scenarios to cover.
If your app is webapp then existing test cases will work with little modifications
If your app is hybrid then few existing cases will work which are under webview.
If Existing Tests Cases are not present
You are free to choose language of your choice as per knowledge and tool which best suites to your application.
Original Question - I want to turn this all into an android app- I have a couple questions:
do I have to rewrite all my code in android studio
Yes if native app, Partially yes if hybrid and No if webapp
can I still use selenium or do I have to set up appium/ selendroid and if so, which one?
for webapp you can use selenium but for hybrid or native app Appium is must. Read documentation and see which is easy for you to pick up.
Note - Selendroid is deprecated because it was used with very old Android version device e.g. Android IceCream 4.2 or below version or API level < 17
Is it possible to get a MeteorJS app onto a watch OS?
I'm asking related to either Apples or the Android version. After googling around, I think the android version can support a browser, but the apple watch doesn't (at least not if you don't jailbreak it).
It seems meteor works with browser functionality inside a native app wrapper. Is such a thing available for these watch OS's?
There are some efforts to enable iOS/OSX applications to easily connect to and communicate with Meteor servers. WatchOS runs an environment that is relatively similar to iOS and so I expect that some if not all of the libraries/extensions will work in WatchOS projects. The most popular effort that I've seen is called ObjectiveDDP: https://github.com/boundsj/ObjectiveDDP
ObjectiveDDP allows you to do the following:
Connect to and authenticate with a Meteor server.
Listen for update events on collections.
Call Meteor Methods.
Send CRUD commands to Meteor for a collection/document.
As for android, the answer is no right now (https://developer.android.com/training/wearables/apps/index.html):
Wearable apps can access much of the standard Android APIs, but don't
support the following APIs:
android.webkit
...
Hence, you cannot have a webview on an adroid-wear watch, which is what phonegap/cordova use to run meteor apps on android. Until that changes, I don't think it will be possible to "just run" meteor apps on an android-wear watch without writing your own native android app. As Patrick said, such a native app could still communicate with the meteor server using DDP, but it's not as straightforward as writing a meteor app that runs on regular android.
As an alternative to having to create an “external” in c/c++/objc to a new Livecode application, I have developed instead a Python network socket app that communicates with it via sockets. The reason for this is that I needed to use some functions provided by some of my “custom” Python libraries. These functions are not doable in Livecode natively at this time. The communication between the Livecode and the Python apps works just as I desire.
I have only tested this technique in a desktop app on OSX for now. When saving the standalone, I’ve bundled my compiled Python app in the “Standalone LC Application Settings” and the whole thing installs and works without problems.
Now, can the same task possibly be accomplished for IOS and/or Android apps?
Can I bundle a compiled Python script with a Livecode IOS/Android mobile app in order to run in these devices? I’m aware of course, that Python is not installed by default in either IOS or Android. What is the best way to accomplish this then? I’m pretty new to Livecode. I’ve tested my Python script on Pythonista on both an iPhone and an iPad just to make sure it will run and it works flawlessly there. So, how do I package my Livecode app with my python script so they could be both installed and ran in the mobile devices?
How do you call your Python scripts? The Shell command is not available on mobile so I guess you would need to create an external that would call your compiled script. But then sockets isn't available either on mobile yet (will soon be afaik). But out of curiosity what is your python script doing that can't be done in LiveCode?
I'm currently looking for a solution to test Android Apps automatically, native Android apps as well as hybrid Cordova/Phonegap apps.
The UI Automator from Google looks pretty fine, but can not deal with WebViews, which makes it unusable for me.
Then I found the promising automation framework Appium based on Selenium, which should also be able to deal with hybrid apps, but I couldn't get it to work with WebViews, it seems to not be implemented fully yet, as also several posts prove.
After trying Appium I found a hint for Selendroid, that also should work for hybrid apps, but it seems pretty much buggy and keeps crashing my whole computer all the time.
So, does anyone here know a working solution for testing Android Apps with WebViews? I'm working on Windows 7. Thanks a lot in advance for any help.
In first case we need to know what kind of tests you like to drive. I think you like to run functional tests on the UI? Thats what i can think about after reading your question.
So lets split this by the given environment:
native iOS
unit tests -> do it in xCode. http://www.apple.com
functionality tests -> http://appium.io/
native Android
unit tests -> JUnit, http://developer.android.com/tools/testing/testing_android.html
functionality tests -> http://selendroid.io/
native Web like phonegap/cordova Apps
unit tests -> jsUnit, http://jsunit.berlios.de/
QA Testing and Checkstyle -> jsHint/jsLint, http://www.jshint.com/ & http://www.jslint.com/
functionality tests -> http://docs.seleniumhq.org/ & https://npmjs.org/package/ripple-
functionality tests (E2E) -> https://angular.github.io/protractor/#/ or https://github.com/jasmine/jasmine
Here is a article about JavaScript QA / QS
native X - The out of the Box solution for all Platforms
Here we are. There is none atm. But .. footage is that one here:
Gappium based on appium uses json for writing your tests. As i get the thread right, it was testet with Web/iOS for this moment. Android/Win seems not be integrated for this moment:
https://github.com/appium/io.appium.gappium.sampleapp
Note for phonegap & apache cordova functional tests:
Its possible to use ripple and selenium for testing hybrid apps. Keep in mind that some native function/plugins (hehe native functions on hybrid apps ... =) cant be tested or need to be mocked on a unknown way. Thats the footage for this moment.
Maybe usefull for you Continous Integration Server:
https://github.com/linslin/PHPUnit-selenium-HTMLGallery
Generally, testing hybrid apps is quite a challenge with API-based approaches. It can be done, but typically you need to integrate the UI technologies (e.g. WebView, Native, OpenGL, ...) with several APIs or some kind of wrapper (like Selendroid).
Here at TestObject (I'm one of the co-founders) we've created an Image-based UI testing approach specifically for cases like hybrid apps, interaction between apps, and so forth. This black-box approach is solely based on capturing the screen - we don't care what happens underneath.
Feel free to give it a try (http://testobject.com/) with your hybrid Cordova/Phonegap app and let me know how it worked out in comparison to UI Automator, Selendroid, Appium. Let us know if you stumble over any issues.
I faced this challenge with our own Cordova app ( sourceforge.net/p/ustadmobil/codehtml5cordova/ci/master/tree/ ) ; and I needed a way to integrate this with Jenkins CI. We have Cordova specific code (e.g. filesystem access) so just using PhantomJS and Grunt is not an option.
Essentially what I did was to launch the app with the test page as index.html in the emulator, run an http server, and then have the test page pass the results back using AJAX.
Script launches an emulator with the package
$ /opt/adt/sdk/tools/emulator-x86 -avd $AVDNAME -qemu -m 2047 &
$ EMULATEPID=$!
$ adb wait-for-device #wait for device to start
$ adb shell input keyevent 82 #unlock screen
Make a test page using qunit, which when finished will communicate the test results with an AJAX call.
Make a basic nodejs server script that will listen for that ajax call and save the results to a file. A bash script can then read that file and determine if the tests passed or failed : see http://sourceforge.net/p/ustadmobil/codehtml5cordova/ci/master/tree/setup/node-qunit-server/node-qunit-server.js
In the build script wait for the result file to come, then kill the emulator and the NodeJS server - see http://sourceforge.net/p/ustadmobil/codehtml5cordova/ci/master/tree/setup/android/unit-test-setup-android.sh
Also worth noting: this approach works for the cross platform nature of Cordova: it should be possible to take the same approach running iOS, Windows Phone emulators etc (I also use this test method against our NodeWebKit desktop version which shares most of the code).
Hope this helps,
-Mike
I have to regularly test the availability and functioning of a movie rental website. I wrote a Windows program which is able to automate a web browser according to a script, so this task is basically solved. Now I have to automate the mobile version of this web application: a native iOS app and a native Android app.
These apps are closed source, so cannot be modified in any way. I think the test app should be deployed on the test devices (iPhone, iPad, Galaxy Tab, Galaxy S II), but I must be able to remote control it. I mean, I would like create a connection between the test devices and a PC, upload test scripts from the PC to the devices, run them, and download the test results to the PC. The test script should start the app to be tested, manipulate its GUI (fill editboxes, push buttons etc.), and follow its response somehow, for example by analyzing the GUI (the existence of some GUI elements, their caption, etc.), analyzing screenshots, and/or inspecting IP packets.
I wrote lots of similar test programs for Windows: I used ShellExecute, PostMessage, FindWindow, the WinPcap library etc., so I know how such a program should work. But since I never wrote applications for mobile OS's, I don't even know whether there are similar APIs and libraries for iOS and Android.
I would like to know where to start, I mean, which SDKs and developer tools could be used to write such an application. I'm also interested in commercial solutions. I would really appreciate any help.
I like "Calabash-iOS/Calabash-Android" by LessPainful. That is the best for me.
free
available on iPhone and Android
record and playback
test on native and simulator
They doesn't have a GUI IDE. They are Ruby-based solutions and it is very easy to write test case script, like this:
Then I swipe left
And I wait until I don't see "Please swipe left"
And take picture
Also it can be
Then I touch the "login" button
to tap a button, or
Then I fill in "placeholder" with "text to write"
to write something to a textbox.
And the script can be shared by Calabash-iOS and Calabash-Android. That feature is convenient for developers who make both iPhoneApp and Android App.
I thought MonkeyTalk was nice but actually unstable, at least in my environment.
Sometimes MonkeyIDE crashed, so we have to do debug of MonkeyTalk...
I hope this helps you.
MonkeyTalk looks promising. Features from the Gorilla Logic website:
Free & Open Source
Automated testing of iOS, Android, HTML5 and Adobe Flex applications
Cross-platform recording and playback
Test native, web, or hybrid apps, on iOS simulators, Android
emulators or real devices (no jailbreaking required)
Everything from simple "smoke tests" to sophisticated data-driven
test suites
Packet tracing: iOS, Android, Android
Selenium offers drivers for mobile devices and emulators. It is a Google project. They have good documentation. It has an IDE for rapid prototyping of testing suites and support for many languages like ruby, PHP, c#, etc.,
If scripting is your preffered solution on android you can easily import and run scripts after you install the Scripting Layer for Android. Just download the latest apk file, import the script and run it. This isn't available on iOS but half of your problem may be solved with this.
I know this is an old post but any one reading in 2016 first choice for automation should be Appium ( works on both IOS /Android). All the tools mentioned above have to be built with the App. Appium does require any build up with App code. Its hugely popular with variety of programming language support ( PHP/JAVA/RUBY/PYTHON). [Link]: appium.io and [Link]: https://github.com/appium/appium