Skip to content
Selenium Webdriver and Appium extension module framework - this combines some functions of webdriver / appium and include some other functions.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
coriander-1.jar
selenoid.jar

README.md

Coriander

Selenium Webdriver and Appium extension module framework - this combines some functions of webdriver / appium and extend other functions.

This is created in 2018 June, updated regularly as I work along different projects. Selenoid is part of Coriander where it focus on gestures / UI interactions for common web and mobile usages. This repositary is for Java.



Prerequisite
Install Appium. See Link for instruction.



Setup (Android / iOS / Webdriver)

selenoid sel = new selenoid (String jsonFile);

jsonFile contains the desired capabilities

Example of usage

public AppiumDriver<AndroidElement> getAndroidDriver (){

		  selenoid sel = new selenoid (String jsonFile);
		  
		  String jsonFile = "MyApp.json"
		  
		 return  (AppiumDriver<AndroidElement>) sel.desiredCapabilitiesConfig(jsonFile, DriverType.Android_Native);
	}



DriverType . This are the enums for DriverTypes currently

public enum DriverType {

   Android_Native , iOS_Native , Web_Chrome , Web_Firefox 
}



You may use one of DriverType when initializing Selenoid.




Example of JSON file

{
"deviceName": "iPhone 11",
"platformName": "IOS",
"automationName": "XCuiTest",
"platformVersion": "13.1",
"app": "/Users/Download//UICatalog.app",
"noReset": "true",
"forceMjsonwp": "true",    
}

Gestures usage



Android Gesture



Android Navigate back button

void androidNavigateBack ()



Android Scroll to UI Text

void androidScrollUIAutomatorText(String text)



Android Swipe - Swipe left / right / up / down

void androidSwipe(AppiumDriver driver, int startx, int starty, int endx,int endy,Duration duration)



Android scroll down

void androidScrollDown( int startX, int startY,int xOffset, int yOffset )



Android - Find UI by xpath

boolean androidScrollUIUntilFindXPath(By xpath, int NumberOfScrolls)


iOS gesture



iOS navigate back

void iOSNavigateBack ()



iOs move direction. move can be "left" , "right"

void iOSHorizontalScroll(String move)



iOS Swipe scroll down

void iOSSwipeScroll (IOSDriver driver, WebElement element, int xOffset, int yOffset)



iOS double tap on element

iOSDoubleTap (IOSElement element)



iOS double tap on x , y

iOSDoubleTap (float x, float y)



iOS single tap on element

void iOSTap (IOSElement element)



iOS single tap on x, y coordinates

void iOSTap (float x, float y)



iOS two finger tap on Element

void iOSTwoFingersTap (IOSElement element)



iOS general two finger tap

void iOSTwoFingersTap ()



iOS drag and drop

void iOSDragAndDrop (float x1, float y1, float x2, float y2, IOSElement element)



iOS PickelWheel

void iOSPickerWheel (IOSElement element, String order , float offset)


Web



Web Scroll up or down

void webScroll ( int endx , int endy)



Web search a string in list box , click and. Returns false if cannot find

boolean webClickDropdown(List elems, String searchString)



Web find element in second level of iFrame

WebElement findElementInSecondLeveliFrame (By by)



Web switch to another tab in browser

void webSwitchTab (boolean closeOriginalTab)



Web select dropdrown and click the successful search string element

webClickDropdown(List elems, String searchString)



Web Use action to move to element and click

void clickAction (By by)




General usage



There are a several public properties under this. But I am testing it and expanding it. Will document them here when they passed my tests



Web / Mobile - Check that it is visible / presence before clicking

void clickElement (By by)



Web / Mobile - Check that it is visible / presence before sending text. Will clear text before sending

void sendKeys (By by, String text)



Web / Mobile - Check that it is visible / presence before sending text. Will clear text before sending. Use this is sendKeys do not work

void setValue (By by, String text)



Web / Mobile - Check that it is visible / presence before sending text. The send keys do not include enter like sendKeys()

void sendKeysNoEnter (By by, String text)



Web / Mobile - Get element text. This will also check for presence before execution

public String getElementText (By by)



Web / Mobile - Explicit wait Presence. Return true if found. False otherwise

public boolean isPresence(By by)



Web / Mobile - Explicit wait clickable. Return true if found. False otherwise

public boolean isClickable(By by)



Web / Mobile - Explicit wait visible. Return true if found. False otherwise

public boolean isVisible (By by)



Web / Mobile - Explicit wait invisibility. Return true if found. False otherwise

public boolean isInvisible (By by)



Web / Mobile - Explicit wait by XPath string. Return true if found. False otherwise

public boolean isPresenceXPath (String xpath_element)







I can be contacted by Linkedin or Skype : tay.phones if you want more details

You can’t perform that action at this time.