My Android application have to synchronize data in the first time. It spend about 15 minute for synchronization. And in secondtime, I don't need get data from server. But when a run calabash to test feature:
calabash-android run MyApp.apk
I feel it remove all data in my app and rebuild application.
So, how to keep data when I run feature Scenario for my app?
My scenario :
Feature: create work order
As a techinical
I want to create work orders
So I can manage WO easier
Scenario: Technician create work order successfully
Given I am on the Create Work Order Screen
And I select customer name which is "Harris Teeter"
And I select equipment serial number which is "1A100438"
And I select Job code "1" and then is "100 HOUR SERVICE"
And I select order type "401"
And I input valid title "Create new work order"
And I input valid description "Work order description"
Then I see the successful messages "The new work order has been created successfully"
Try command
NO_LAUNCH=1 cucumber --format html --out index.html features/Your_feature_file.feature
It won't relaunch your app. But you need to run the app first time before you run this command. As long as your app in the foreground this command works.
Note: I use this for iPhone testing it should work on android too.
This is because calabash-android reinstall app before run every scenario.
To avoid that, you can comment this code in app_installation_hooks.rb file in android support folder
uninstall_apps
install_app(ENV["TEST_APP_PATH"])
install_app(ENV["APP_PATH"])
Related
I've trawled the internet but can't find anything specific to help me. I'm not overly-technical so please go easy with your answers (ha ha).
I am trying to create a very basic script that goes to a specific URL on a virtual device, enters a username and a password and logs in.
I take the following steps:
Start Appium server
Run Test
I've tried both of these as approaches for kicking up my instance of chrome on the Android Virtual Device:
Open Application ${global_appiumEndpoint}
... udid=emulator-5554
... platformName=Android
... androidPackage=com.android.chrome
... platformVersion=10
... deviceName=Google Pixel 2
... browserName=Chrome
... chromedriverExecutableDir=//AutomationDrivers//OLD
... fastReset=true'''
If I try and interact with the google chrome session created using selenium commands, I get an error of "No browser is open" (even though it is??!), however, commands from the appium library do seem to work (but are not sufficient for my testing)
If I try and kick up an instance of Chrome using this approach:
${capabilities}= Create Dictionary
Set to dictionary ${capabilities} udid emulator-5554
Set to dictionary ${capabilities} platformName Android
Set to dictionary ${capabilities} platformVersion 10
Set to dictionary ${capabilities} deviceName Google Pixel 2
Set to dictionary ${capabilities} browserName Chrome
Set to dictionary ${capabilities} chromedriverExecutableDir //AutomationDrivers//OLD
Set to dictionary ${capabilities} fastReset true
Set to dictionary ${capabilities} app com.android.browser
Create Webdriver Remote command_executor=http://localhost:4723/wd/hub desired_capabilities=${capabilities}
I get told that no application is open (which it is!).
So
What am I doing wrong?
Is it possible for selenium and appium commands to co-exist on the same test because I'm beginning to doubt my sanity!!
Thanks all
One thing is an Android App, the other is an Android Operating System App, like Chrome. The error you have is that there is no App started, because you did not provide an APK, or class path for an App.
When wanting to use SeleniumLibrary to do web testing with AppiumLibrary, you have to Switch context to Web testing (and from Web testing to App testing). There is appropriate keyword in AppiumLibrary, for this.
In your test script, to avoid libraries keyword names conflicts, you have to prefix with the intended one. For example: SeleniumLibrary.Capture Page Screenshot.
I recommend to try the Appium/AppiumLibrary "OrangeDemo" to start an App from APK.
After refreshing my knowledge on using Chrome with AppiumLibrary, I made a basic example:
*** Settings ***
Library AppiumLibrary run_on_failure=AppiumLibrary.Log Source
*** Test Cases ***
Open robotframework.org
[Documentation] Simple demo of opening Chrome, going to robotframework.org and capture a screenshot.
Open Application http://localhost:4723/wd/hub platformName=Android platformVersion=8.1 deviceName:emulator-5554 browserName=Chrome automationName=UIAutomator2
Switch To Context CHROMIUM
Go To Url https://robotframework.org/
Capture Page Screenshot
Close Application
Things to know:
Before starting server from AppiumDesktop, you need to add in settings the full path to the executable of chromedriver (i.e. chromedriver.exe).
To start Chrome on browser, use browserName=, for apps there are different options like, app=<path_to_APK>, appPackage= and appWaitActivity=, also automationName=UIAutomator2 is the more recent for Android.
I've been using selenium for sometime and now I'd like to try testing an app installed in my phone. So far I've done the following:
I installed appium for mac and I clicked on run.
I installed adb.
"abd devices" detects my phone
Installed perl libraries for appium.
I installed an app called apk analyzer to get the app's manifest and read activities names and package names.
I wrote the following code:
use strict;
use warnings;
use utf8;
use Appium;
use Selenium::Remote::Driver;
use Selenium::Waiter;
print "starting script:\n";
my $appium = Appium->new(caps => {
'remote_server_address' => '0.0.0.0',
'port' => 4723,
'platformName' => 'Android',
'platformVersion' => '6.0.1',
'deviceName' => 'my device',
'appPackage' => 'app package',
'appActivity' => 'activity path',
});
$appium->launch_app();
sleep(10);
my $element = $appium->find_element('element', 'xpath');
$element->tap();
$appium->quit;
With the paths and names that are working for my app and phone...
Well, when I execute it, it opens the app but it seems like it opens a new installation of the app, for example if I the app has a log in step and then you have some data stored there, the appium execution doesn't have those data stored.
Is this the normal behavior of appium or is it possible to test over an installation with saved data?
As an example of what I would like to do:
-I have an agenda with events in different days. I've saved those events over time manually but the app doesn't support an export function..
-I would like to open the app with appium and iterate over the days saving the text.
-If the app that appium opens is a new installation I can't get the data.
https://developer.github.com/v3/activity/notifications/
I am trying to use the Github Notifications API to display notifications like
"someone followed my repo", "someone followed me", "someone commented on my repo", etc.
on my Android application.
Before using it, I tried to understand how it works.
When I tried doing
GET https://api.github.com/notifications?access_token="mytoken"
on Postman to see what if gives, it just gave me
[]
When I asked my friend to follow me on Github, I expected something to appear in the response, but it still gave me
[]
after my friend tried to follow me.
In what case do I get a response, and how am I supposed to use it to fulfill my purpose?
Axibase developed a set of handy tools that use the GitHub API to create and send Webhooks based on the events you're describing.
The workflow for the Repo Watch notification is shown here, it's the same for each tool just a different flavor based on the alert event:
The whole set-up process takes less 10 minutes, follows this guide and runs in a Docker container which is pre-configured in the launch command. The procedure is goes like this:
From the Linux command line, launch ATSD with the following command:
docker run -d -p 8443:8443 -p 9443:9443 \
--name=atsd-sandbox \
--env SERVER_URL=https://atsd.company_name.com:8443 \
--env WEBHOOK=github \
--env SLACK_CONFIG="slack.properties \
--volume /home/user/slack.properties:/slack.properties \
--env ATSD_IMPORT_PATH='https://raw.githubusercontent.com/axibase/atsd-use-cases/master/how-to/github/resources/github-watch.xml' \
axibase/atsd-sandbox:latest
(Remove the terrible spacing that SO requires for code posts)
Replace the SERVER_NAME parameter with the public DNS name of the Docker host where the sandbox container will be running
What you're getting here is a local ATSD instance with a generated Webhook. The command is bootstrapped for Slack, so you need to create an .xml directory on your local machine or URL with the following parameters and then replace the slack.properties template variable with the appropriate path:
token=xoxb-************-************************
channels=general
Watch the Docker Logs, and copy the Webhook. It will look something like this:
Webhook URL: https://github:PdWnC1jF#atsd.company.com:8443/api/v1/messages/webhook/github?exclude=organization.*;repository.*;*.signature;*.payload;*.sha;*.ref;*_at;*.id&include=repository.name;repository.full_name&header.tag.event=X-GitHub-Event&excludeValues=http*&debug=true
Open the GitHub Settings menu for the repo for which you'd like to create notifications:
Configure the Webhook by pasting the one generated at runtime into the appropriate field and configure the remaining settings:
Confirm connectivity (GitHub will do this automatically), and you're ready to go.
Use one of these other guides according to the event which you'd like to trigger a notification. The really nice thing about them is that they can alert via third-party messenger so the notifications are send directly to your smartphone instead of just through email.
Disclaimer: I've worked for the development team that writes ATSD, which is the database responsible for the underlying data processing and management tasks.
Good luck!
I'm running Qpython (andoid) 1.2.3 (the latest as of 2016-01-31) and I can get scripts to run. I've been able to create a shortcut on my homescreen for a simple test script that put the current date in yyyy-mm-dd format into the clipboard, and speaks the content. I have #qpy: console directing the script to execure in the console. When I click the shortcut, the clipboard is happily updated, and read out to me. But... the console window stays open, telling me to hit enter to close the window.
I have tried:
adding "exit"
adding "exit(0)"
adding
import sys
sys.exit()
I have tried printing ctrl-d
I still get the console staying open until I manually hit enter.
I tried reheadering my script to run as kivy instead of console, and I could get it to exit, but it takes several seconds to load up kivy, and it's silly to load a huge amount of gui capability, when I neither need nor want them.
How can I close the console automatically?
Can you upgrade to the newest version ?
And it support Q mode, just insert "#qpy:qpyapp" into your script.
http://www.qpython.org/en/guide_program.html (In the end of the page)
edit the file end.sh. Remove or comment the "read" command.
I have been following to the letter the simple tutorial on Creating an App Engine Connected Android Project using the eclipse plugin.
After setting up everything, running the project leads to two possibilities:
If LOCAL_ANDROID_RUN = false, the project spits out the expected complaints:
1) Registration with Google Cloud Messaging...SUCCEEDED!
2) Registration with Endpoints Server...FAILED
Either your Cloud Endpoints server is not deployed to App Engine, or your
settings need to be changed to run against a local instance by setting
LOCAL_ANDROID_RUN to 'true' in CloudEndpointUtils.java.
If LOCAL_ANDROID_RUN = true, the second I click "register" the app crashes! This is the part I don't get. I am running the project right out of the box. The only thing I did was change LOCAL_ANDROID_RUN from false to true.
So I have been researching for the past four hours on a resolution. I see talks about -a 0.0.0.0 or -bindAddress 0.0.0.0; unless I am setting them incorrectly (I probably am), they are not working. Sometimes I get the "error" below. So if that's my problem please, what exactly am I supposed to have in the argument box before I click apply and run?
Options:
--help, -h Show this help message and exit.
--server=SERVER The server to use to determine the latest
-s SERVER SDK version.
--address=ADDRESS The address of the interface on the local machine
-a ADDRESS to bind to (or 0.0.0.0 for all interfaces).
--port=PORT The port number to bind to on the local machine.
-p PORT
--sdk_root=DIR Overrides where the SDK is located.
--disable_update_check Disable the check for newer SDK versions.
--generated_dir=DIR Set the directory where generated files are created.
--jvm_flag=FLAG Pass FLAG as a JVM argument. May be repeated to
supply multiple flags.
Any insights on how to get this out of the box project to work?