Seamus  Quitzon

Seamus Quitzon

1596243372

Auto install application from Playstore with Appium

The example scenario we will be doing is to install CocCoc browser application from Playstore. We would need the following things to get along

  • Python3
  • Appium
  • Venv
  • Pytest
  • Pycharm (or any IDE / Code Editor)
  • Android SDK

Android SDK

We need to install Android SDK, so that we can connect and access to Android devices. Also, with uiautomatorviewer from Android SDK, we can inspect element in the running application in Android devices.

To open uiautomator viewer, we will need to add PATH to Android SDK location. After that, simply run this

uiautomatorviewer

Then UIAutomator viewer will be opened up and we can inspect element by simply clicking on the element in the UI.

Image for post

From stackoverflow


Find and tap on element with Appium

We will interact with elements by Appium , structured in Page Object Models for better readability and maintenance.

  • Playstore locators
class PlaystoreLocators: PLAYSTORE_PACKAGE_NAME = 'com.android.vending' SEARCH_BAR_BOX = (By.ID, PLAYSTORE_PACKAGE_NAME+':id/search_bar_hint') SEARCH_BAR_BOX_TEXT_INPUT = (By.ID, PLAYSTORE_PACKAGE_NAME+':id/search_bar_text_input') COCCOC_BROWSER_ITEM_SEARCH_RESULT = (By.XPATH, '//android.widget.FrameLayout[contains(@content-desc, "Cốc Cốc Browser")]') INSTALL_BUTTON = (By.ID, PLAYSTORE_PACKAGE_NAME+':id/right_button') OPEN_BUTTON = (By.XPATH, '//android.widget.Button[contains(@text, "Open")][@clickable="true"]')
  • Playstore elements
from appium_client.models.pageobject.elements.base_elements import BaseElements
	from appium import webdriver
	from selenium.webdriver.support import expected_conditions as ec
	from appium_client.models.pageobject.locators.playstore_locators import PlaystoreLocators

	class PlayStoreElements(BaseElements):

	    def find_search_box_playstore(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver).until(
	            ec.visibility_of_element_located(PlaystoreLocators.SEARCH_BAR_BOX))

	    def find_search_box_text_input(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver).until(ec.presence_of_element_located(PlaystoreLocators.SEARCH_BAR_BOX_TEXT_INPUT))

	    def find_coccoc_browser_item_search_result(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver).until(ec.presence_of_element_located(PlaystoreLocators.COCCOC_BROWSER_ITEM_SEARCH_RESULT))

	    def find_install_button(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver).until(ec.presence_of_element_located(PlaystoreLocators.INSTALL_BUTTON))

	    def find_open_button(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver, timeout=80).until(ec.presence_of_element_located(PlaystoreLocators.OPEN_BUTTON))

#python #android #appium #programming #automation

What is GEEK

Buddha Community

Auto install application from Playstore with Appium
Seamus  Quitzon

Seamus Quitzon

1596243372

Auto install application from Playstore with Appium

The example scenario we will be doing is to install CocCoc browser application from Playstore. We would need the following things to get along

  • Python3
  • Appium
  • Venv
  • Pytest
  • Pycharm (or any IDE / Code Editor)
  • Android SDK

Android SDK

We need to install Android SDK, so that we can connect and access to Android devices. Also, with uiautomatorviewer from Android SDK, we can inspect element in the running application in Android devices.

To open uiautomator viewer, we will need to add PATH to Android SDK location. After that, simply run this

uiautomatorviewer

Then UIAutomator viewer will be opened up and we can inspect element by simply clicking on the element in the UI.

Image for post

From stackoverflow


Find and tap on element with Appium

We will interact with elements by Appium , structured in Page Object Models for better readability and maintenance.

  • Playstore locators
class PlaystoreLocators: PLAYSTORE_PACKAGE_NAME = 'com.android.vending' SEARCH_BAR_BOX = (By.ID, PLAYSTORE_PACKAGE_NAME+':id/search_bar_hint') SEARCH_BAR_BOX_TEXT_INPUT = (By.ID, PLAYSTORE_PACKAGE_NAME+':id/search_bar_text_input') COCCOC_BROWSER_ITEM_SEARCH_RESULT = (By.XPATH, '//android.widget.FrameLayout[contains(@content-desc, "Cốc Cốc Browser")]') INSTALL_BUTTON = (By.ID, PLAYSTORE_PACKAGE_NAME+':id/right_button') OPEN_BUTTON = (By.XPATH, '//android.widget.Button[contains(@text, "Open")][@clickable="true"]')
  • Playstore elements
from appium_client.models.pageobject.elements.base_elements import BaseElements
	from appium import webdriver
	from selenium.webdriver.support import expected_conditions as ec
	from appium_client.models.pageobject.locators.playstore_locators import PlaystoreLocators

	class PlayStoreElements(BaseElements):

	    def find_search_box_playstore(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver).until(
	            ec.visibility_of_element_located(PlaystoreLocators.SEARCH_BAR_BOX))

	    def find_search_box_text_input(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver).until(ec.presence_of_element_located(PlaystoreLocators.SEARCH_BAR_BOX_TEXT_INPUT))

	    def find_coccoc_browser_item_search_result(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver).until(ec.presence_of_element_located(PlaystoreLocators.COCCOC_BROWSER_ITEM_SEARCH_RESULT))

	    def find_install_button(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver).until(ec.presence_of_element_located(PlaystoreLocators.INSTALL_BUTTON))

	    def find_open_button(self, driver: webdriver.Remote, ):
	        return self.wait_for_element(driver=driver, timeout=80).until(ec.presence_of_element_located(PlaystoreLocators.OPEN_BUTTON))

#python #android #appium #programming #automation

Chet  Lubowitz

Chet Lubowitz

1595855400

How to install PgAdmin 4 on CentOS 8

pgAdmin is the leading graphical Open Source management, development and administration tool for PostgreSQLpgAdmin4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL database.

In this tutorial, we are going to show you how to install pgAdmin4 in Server Mode as a web application using httpd and Wsgi module on CentOS 8.

Install pgAdmin4 on CentOS 8

**01-**To install pgAdmin4 on CentOS 8 we need to add an external repository, so execute the following command:

$ sudo rpm -i https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-1-1.noarch.rpm

02- After we add the pgAdmin4 repository, let’s use the below command to install pgAdmin4 as server mode:

$ sudo dnf install pgadmin4-web

03- Before proceeding with the configuration of pgAdmin4, we need to install policycoreutils tool:

$ dnf install policycoreutils-python-utils  

04- Once we done installing pgAdmin4, we need to configure the pgAdmin4 by setting up the initial pgAdmin user account

#databases #linux #ubuntu #install pgadmin4 #install pgadmin4 centos #pgadmin #pgadmin 4 install #pgadmin 4 install centos #pgadmin4 #pgadmin4 install centos

Brain  Crist

Brain Crist

1595372400

How to Install Android Studio on Ubuntu 20.04

1./ Install Android Studio Using APT

Method 1./ Install Android Studio Using APT

1- We need to add official repository to the sources list. Therefore, type the below command to add the Android Studio repository:

$ sudo add-apt-repository ppa:maarten-fonville/android-studio

02- Now let’s install Android studio and all the software dependencies as below.

$ sudo apt update
$ sudo apt install android-studio

Method 2./ Install Android Studio Using snap

We can install using the snap tool. So, use the below command to install Android Studio:

$ sudo snap install android-studio --classic

2./ Starting Android Studio

01- You can start Android Studio either by typing the command android-studio in your terminal or by clicking on the Android Studio icon (Activities -> Android Studio).

How to Install Android Studio on Ubuntu 20.04

02- When you start Android Studio for the first time, a window like the following will appear asking you to import Android Studio settings from a previous installation. However, if you have a previous installation of Android Studio, simply browse to the configuration folder. If not, go with the default option which is Do not import settings.

How to Install Android Studio on Ubuntu 20.04

03- Click on the Next button, and you will be presented with a window to choose your type of setup you want for Android Studio. So, let’s choose Standard which will install the most common settings and options as below.

How to Install Android Studio on Ubuntu 20.04

04- Click Next and you’ll be taken to the following window to choose your UI theme:

How to Install Android Studio on Ubuntu 20.04

05- You’ll be taken to a window to verify your chosen settings. Simply click on Next. Finally, wait for the Wizard to download and install the required dependencies before you can start your first Android project

How to Install Android Studio on Ubuntu 20.04

#linux #ubuntu #install android studio #install android studio ubuntu #install sdk ubuntu #sdk #sdk install android studio #ubuntu install android studio

Nat  Grady

Nat Grady

1660748160

installr: Functions for Installing Softwares From within R

installr

Introduction

The installr package offers a set of R functions for the installation and updating of software (currently, only on Windows OS), with a special focus on R itself. This package has two main goals:

  1. To make updating R (on windows) as easy as running a function.
  2. To make it as easy as possible to install all of the needed software for R development (such as git, RTools, etc), as well as for reproducible research using R (such as MikTeX, pandoc, etc).

Motivation

While for Linux users, the installation process of new software may be just running a short line of code, for the regular Windows user it often includes browsing online, finding the latest version, downloading it, running the installer, and deleting the installation file. All of these steps are automatically done using functions in this package.

Installation

To install the stable version on CRAN:

install.packages('installr')

To install the latest installr version from GitHub use:

if (!require('remotes')) install.packages('remotes'); # make sure you have Rtools installed first! if not, then run:
#install.packages('installr')
#install.Rtools()
remotes::install_github('talgalili/installr')

Usage

If you are using the Rgui, you will see a new menu added on your top right (just by "help"), giving you the option to update R, or install new software.

For command line use you can update R by running:

if(!require("installr")) install.packages('installr')
library("installr")
updateR() # this will open dialog boxes to take you through the steps.
# OR use:
# updateR(TRUE) # this will use common defaults and will be the safest/fastest option

Or install a new software simply by running:

library("installr")
installr() #  user can easily select (via a GUI interface) a software to install.

Troubleshooting

If you get either of the following errors from some commands:

Error in download.file(URL, destfile = ...) : 
  unsupported URL scheme

Or:

install.RStudio()
Error in file(con, "r") : cannot open the connection
updateR()
Error in file(con, "r") : cannot open the connection

Try running:

setInternet2(TRUE)

Sources:

Contact

You are welcome to:

Available functions are:

You can see the most recent changes to the package in the NEWS.md file:

http://talgalili.github.io/installr/news/index.html

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Download Details:

Author: Talgalili
Source Code: https://github.com/talgalili/installr/ 

#r #installing #softwares 

Yogi Gurjar

1600307091

How to Install Laravel 8 on Windows 10 Xampp

How to install laravel 8 on windows 10. In this tutorial, i would love to share with you how to install laravel 8 on windows 10.

How to Install Laravel 8 on Windows 10 Xampp

Installing laravel 8 on windows 10 xampp server step by step:

  1. Step 1 – Prerequisiteto Install Composer On Windows
  2. Step 2 – Server Requirements For Laravel 8
  3. Step 3 – Installing Laravel On Windows 10 Xampp
  4. Step 4 – Start Development Server For Laravel 8

https://laratutorials.com/installing-laravel-8-on-windows-10-xampp/

#install laravel on windows xampp #how to install laravel in windows 10 xampp #install xampp on windows 10 laravel installation steps #laravel installation steps #how to run laravel project on localhost xampp