Sample Appium Framework - frameworks

This might be a big ask. Can anyone point to the direction of a to a page or a blog with a sample appium framework that (for iOS and android) I can take a look at?
Any frameworks that use page mode factory or BDD would be perfect.

I write AppiumBoot to use yaml to run Appium auto test. It makes using Appium very simple, and no need to write java or python code.
demo video
demo code
some code like
# AppiumBoot/example/material/comp5.yml
# home page: click 5th cell
- click_by:
xpath: /hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.FrameLayout[5]/android.widget.LinearLayout # 按钮的xpath路径
sleep: 1
# second page: click 3th demo
- click_by:
xpath: /hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout[2]
# thirth page: drag and move
move_track: '360,1100;360,600;800,600;800,1600;100,1600;100,600'
# back to second page: click 4th demo
- back:
click_by:
xpath: /hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout[4]
swipe_up:

Appium sample project link here
Appium with bdd sample project link here
Appium with Grid sample project link here

Related

appium python - how to dump details of an element?

StackOverflow friends,
I'd like to find a programmatical way to dump a selected element in Appium Python.
The current solution from StackOverflow is to use
element.get_attribute('outerHTML')
but this only works in WebView Context. Nowadays most apps run in NativeApp context, therefore, the 'outerHTML' isn't available.
I saw Appium Inspector can display the selected element's detail,
I'd like to mimic this in Python, and print out to terminal.
I could have dumped the whole page using
driver.page_source
but I'd like to use the element-only dump to assert that I have selected the correct element.
By the way, I am testing on Android 13 device.
Thank you

Unable to perform the action on android webview

I am using Robot Framework with python. I have a page that has a web view. I am able to find the element through Appium inspector and also through the Chrome Dev tools. But those locators are not working. The test case passes but it does not click on that element.
Is there any work around for this issue?
Did you try the class name locator?
driver.find_element_by_class_name()

How do I actually install and use YouTube Android Player API?

I want to make a Flutter app that can play YouTube playlists using the YouTube Android Player API, found here: https://developers.google.com/youtube/android/player
The "Getting started" instructions say:
The following documents will help you to set up your development environment and use the YouTube Android Player API:
The download page provides a link to download the API client library
and JavaDocs.
The instructions for registering your application explain how to
register your app in the Google API Console and to obtain an Android
API key, which you will need to use the API.
The setup instructions explain how to set up an API project using
either Eclipse or IntelliJ.
The sample applications overview describes the sample applications
included in the API download.
The JavaDoc reference provides detailed definitions of the API's
interfaces, classes, methods, and enums.
I've followed every step in those points and links, but I still don't know how to use the provided package in my code! I now have a sample app running on my phone, and apparently using the package... which is cute... but it is in Java, which I don't speak, so it doesn't help me make my own app! Plain English instructions would have been more helpful...
I have tried:
import 'com.google.android.youtube.player'
and even:
import '<path>/YouTubeAndroidPlayerApi.jar'
but Dart Analysis tells me the URL doesn't exists. And when I try any of the classes that are supposed to be included in the package, I get that it's not defined.
I've tried right-clicking on the YouTubeAndroidPlayerApi.jar file and choosing "Add as library", but same result.
So what I normally do is to write something in my pubspec.yaml file, like:
dependencies:
provider: ^4.3.2+3
Then I would run pub get.
Then I would write import <package name> in my code, and now the classes will be ready to use.
What is the correspondence in this case? What am I supposed to do with this package so that I can use the classes in my code? I'm using Android Studio.
Most grateful for guidance!

Fluentautomation with multiselect

I am having trouble selecting multiple values from a SELECT box via FluentAutomation.
Sample test case:
I.Open("http://www.htmlcodetutorial.com/forms/_SELECT_MULTIPLE.html");
I.Select(1).From("select[name='toppings']");
I.Select(2).From("select[name='toppings']");
I.Select(3).From("select[name='toppings']");
When this code is executed only the 3rd option is selected, whereas I would like all 3 options to be selected (This would be equivalent to a user holding down ctrl and clicking the 3 options).
This has been tested with Internet Explorer (v11.0.9600.17728) and Chrome (v42.0.2311.90)
Any insights would be appreciated.
Thanks.
I believed what you want is this:
I.Select(1,2,3).From("select[name='toppings']");
See the documentation here:
https://github.com/stirno/FluentAutomation/blob/b084f3e2638edf0a169f4286628706f042dc9339/Docs/v2/actions.select.md
Edit
It appears that there is a bug in the older version of Chrome WebDriver. Because FluentAutomation bundles the Chrome WebDriver in FluentAutomation.SeleniumWebDriver.dll, you must compile this on your computer (instead of using nuget):
Download the latest Chrome WebDriver: https://sites.google.com/a/chromium.org/chromedriver/
Download FluentAutomation source: https://github.com/stirno/FluentAutomation
Go to "{source path}\FluentAutomation.SeleniumWebDriver\3rdPartyLib\" and replace chromedriver.exe with the one downloaded in 1
Recompile FluentAutomation and use the compiled FluentAutomation.SeleniumWebDriver.dll instead of the one you got from nuget.
Good luck!
Edit 2
There is a way to override FluentAutomation's ChromeDriver. See #stirno comments below.

How can I embed the OpenEars framework in my application?

How can I embed the OpenEars framework in my application?
When I download the sample project form this website http://www.politepix.com/openears/ it gives me 20 errors and (gcc- exit code 1 error)
If you have any tutorials for this project then please share it with me.
Without any description of what the errors are it's impossible to say what the issue is, but if you look at the first tutorial page for OpenEars here (this is what Jano is referring to):
http://www.politepix.com/openears/gettingstarted
And read onwards from the line "If (and only if) you get multiple build errors, you may have to take one more step of assigning the base SDK for the library and sample app" and follow the instructions and images there step by step, there is a good chance it will help with your problem. I agree with Jano that you should systematically go through the steps in the tutorial starting on the page I've linked and make sure you have downloaded the libraries and run the configuration script just as it says.
Jano, that is odd with the codesigning, I'll look into it.