How to scroll vertically in appium for hybrid app using java - java

I am automating a hybrid app and I want scroll vertically from top to bottom in a page which is in web view. I am using java client-5.0.4 and appium version is v1.7.2
enter image description here

You can swipe in an app with appium using the press method. E.g. :
TouchAction().press(el0).moveTo(el1).release()
It also works with coordinates if you wish to use that instead of webelements.
More information on touch actions can be found here : https://appium.io/docs/en/writing-running-appium/touch-actions/

Related

Android WebView: Display only half of a webpage

Currently I have a HTML page with a container containing element A on the left side and element B on the right side. I'm trying to view this page using ViewPager with two tabs ie. have only half of the webpage displayed on Tab1 and the other half on Tab2. This makes it so that even if the user chooses to scroll all the way on Tab1, he can never see the content on the right side unless he swipes to Tab2. The size can be determined by 0-50% and 51% - 100% horizontally if possible.
Any idea how this can be implemented?
Android webview is a kind of browser, it will behave the same as another bowser is doing for showing webpage, as per your requirement ask your Web development team to make it browser compatible, and check their output in Chrome, Firefox browser in your device then integrate into Android Webview.

Selenium click chrome physical buttons like menu, left, right navigation, bookmarks

I'm working on a some automation work, as per my requirement I need to click on Chrome Physical buttons like left nav, right nav, bookmarks, menu etc. I can do with shortcuts but my requirement is to click on browser buttons. Any ideas would be helpful. Thanks in advance.
As per your question you want to click on Chrome Physical buttons like left navigation, right navigation, bookmarks, menu etc.
But if you look into the documentation in Selenium Home Page it clearly mentions that :
The entire suite of tools provided by Selenium results in a rich set of testing functions specifically geared to the needs of testing of web applications. These operations allow many options for locating UI elements and comparing expected test results against actual application behavior.
So factually Selenium by design interacts with the HTML DOM and the WebElements located in the DOM Tree
Now the desired controls e.g. left navigation, right navigation, bookmarks, menu are out of the DOM. Hence you cannot mock the click on those controls.
However all the Selenium Language Binding Art provides a handfull of methods to achieve the same result. Here are a few from the Selenium Python Binding Art :
Maximize : To maximize the browser window.
driver.maximize_window()
Minimize : To minimize the browser window.
driver.minimize_window()
Close : To close the browser window.
driver.close()
Quit : To close the browser window gracefully.
driver.quit()
Refresh : To refresh the url.
driver.refresh()
Forward : To move forward.
driver.forward()
Back : To move backwards.
driver.back()
And of-coarse Get : To invoke an url.
driver.get('http://google.com/')
There are functions for this that is built-in:
driver.forward()
driver.back()
https://selenium-python.readthedocs.io/navigating.html#navigation-history-and-location
It doesn't appear that selenium can interact with the Bookmark, but let me check some more.
This can't be done with selenium webdriver and I think also not with the standalone selenium server. Selenium only allows to interact with the DOM.
The only way to achieve what you want to do is to use an automation tool that actually runs directly in the OS that you use. Java can be used to write such a program.
I would however recommend to not go this route. Instead try to convince whoever is responsible for your requirements to re-think and allow to use other means of achieving back and forward actions.

Unable to click on dropdown button in web view of iOS 11 in Appium

I am trying to automate a hybrid app using Appium in iPhone 6 real device.
I am able to locate the dropdown element with path and Appium shows it has clicked on the element also. But it is not actually clicked as the dropdown is not opening.
Please find below attached screenshot of the scenario
Any help will be highly appreciated
The element is a Select and not just a standard WebElement, so you must treat it as such.
Select dropdown = new Select(driver.findElement(By.id("RelationOption")));
Then you directly access which option you wish by visible text, value, or index.
dropdown.selectByVisibleText("Mother");

Unable to get Clickable button in UI Automator Viewer

I am trying to automate clickable button for a react-native based Application. I was stopped getting clickable button as in UI Automator Viewer displaying clickable button status FALSE. So, can you suggest me any other alternative way to automate the clickable action using Appium.
Using Selenium 3.5.3 version, Appium for Windows 1_4_16_1.
Image 1
Image2
First: start using appium-desktop and not an old appium server 1.4.16, but 1.7.x
Second: ReactNative app is interpreted as Native application, so you need to use Appium on client side, not Selenium
Final: In appium-desktop you can directly try to click your button to see if it works.

Selenium IDE does not change PrimeFaces control

we have a web form developed by Java and PrimeFaces framework. In this form we have a ui control which is called slider. It contanins a button on a horizontal line. When we move the button it gives us a number in [50,99] range.
The problem is when i use Selenium IDE to record test cases, Selenium is not able to move the slider control. How can i achieve this?
Here is what my slider looks like:

Categories

Resources