iOS UI automation testing - java

I'm a beginner in mobile iOS testing and I'm trying to write some tests, for example:
Click "Install" on intallation popup --> Check if app is installed on the device
But I can't find any tools that make possible to execute such test. So far I've been using Appium, but it requires app or bundleId to run tests. Is there any way to automate popups/browsing the device?

You can work with popups as simple IOS elements.
Or you can force appium to auto enable (or disable) any popup by adding appropriate capability (“autoAcceptAlerts”,true);

Related

Is there a way to bring a running mobile device into focus or run it in the foreground using appium

I am running an appium script on an Android emulator from via Android studio device manager. I want to see the device on the screen when my appium test is running on it, so I manually click the device icon in the taskbar to bring the device to the foreground so it can be in focus. No issues with that.
Now, sometimes I forget to bring the device to the foreground before running the script, so whilst the script is running, I quickly bring it to focus manually. Is there a way programmatically bring the running device to the foreground?
I easily achieve this with selenium webdriver to bring a browser tab into focus by doing this:
String window = driver.getWindowHandle();
((JavascriptExecutor) driver).executeScript("alert('Test')");
driver.switchTo().alert().accept();
driver.switchTo().window(window);
This is not working in appium. Is there a way to achieve a similar result with appium? Or perhaps, Is there some settings in Android studio to automatically bring the running device into focus?
It's a maven project and I am running the test on macOS.
My guess would be to create a gradle run configuration that would use some kind of terminal script that would focus the emulator window by name? Like running wmctrl on Linux.
You would probably have to create a focussed question here if you would get stuck on any of these steps though. As I don't even know what OS you are on.

Closing chrome browser after tests with Appium? JAVA

I'm trying to find a way for me to close all tabs of chrome after performing certain tasks with Appium using Java, for example on Android. Is there a way I can do that? All tabs keep growing and growing and that causes the tests to crash.
One possible solution is to clear the application data using ADB:
adb shell pm clear com.android.chrome
You may do this as a precondition for your tests, for example somewhere in #BeforeClass or #BeforeSuite if you use TestNG. The side effect is that you have to accept terms and conditions upon chrome opening and click the No thanks button on the Sign-in to Chrome View. But this is not a big deal.
Pros: clean Chrome browser without any tabs and cache on every test run
Cons: some Chrome initialization is required every time (~5..10 seconds to perform)
You can also try another approach as written here: https://developers.perfectomobile.com/display/TT/How+To%3A+Close+Tabs+in+Google+Chrome
Create a function (inside your app #BeforeSuite or #BeforeClass) that will simulate touch events of a mobile user that press a button to close all chrome tabs.

Is it possible to run test code written by other languages in flutter?

I am trying to automate my webview app by using Appium, but code that I exported from Appium is written in java. Is it possible to test flutter app by test code written in other languages, not in dart?
UPDATE: You can use Appium in conjunction with Selenium. I think that should work. See: http://appium.io/docs/en/writing-running-appium/web/mobile-web/
If what the test framework does is to integrate with, or emulate, a browser, and manipulate the DOM in order to test, and
If your Dart application only manipulates the DOM to generate a web view -- e.g., it would work in a regular browser without using plugins,
Then yes, you can use such a tool (like Selenium) to test a Dart app.
The caveat here is, if you are using a WebView to embed your app in a mobile app framework, then these tools will have to have the ability to open an app on a mobile device to access the WebView.
If you can create an alternate scaffolding for your application, such that it can also run in a browser, not only as an embedded WebView in a mobile app, then the tools needed to test it are only simple web app testing frameworks.
This is generally a good approach if you can get faster feedback deploying to a web server and running your tests, than packaging the app and pushing it to a connected device.
It doesn't obviate the need to test in the WebView as there are often differences between browser capabilities as embedded in a WebView versus in a desktop browser, but any differences found would be purely based on the capabilities of the browser, as opposed to problems in your Dart logic.

Is it possible to automate NFC payment tests for Android?

I'm testing an app that supports NFC payments, however I was unable to find any solutions on automating these tests.
I'm using Appium as my open-source automation tool.
Fully automate NFC payments with desired variables.
It's not supported by appium neither any other framework. However, I have a solution for you. Have your app's developers add a menu for you with several choices, each choice represents a payment scenario from your design. Once you click on each one of them, it will mock the real NFC action. Make sure that this menu is only in debug mode and not in release mode.

How to recrod our screen of android emulator operations

I am automating my android app through Appium in Emulator. During the test case run, i want to capture all operations performed in the emulator into a video. How can i do this?
As i want to deal with programmatically, are there any APIs supported to do this?
Is there any methods to do this using Java?
I heard that we can record for Android real devices(adb shell screenrecorder), but not for Emulator.
Can someone please help me on this?
Thanks,
Uday
You can consider the emulator itself as a windows application and hence you could record it like any other windows app. For a more platform independent option, there are a few java libraries with api.

Categories