Skip to content

Instantly share code, notes, and snippets.

View wswebcreation's full-sized avatar
🤣
SaaS (Selles as a Service)

Wim Selles wswebcreation

🤣
SaaS (Selles as a Service)
View GitHub Profile
@wswebcreation
wswebcreation / README.md
Created November 3, 2024 17:33
WDIO Native Longpress

Native longPress usage

Adjust the config like this

import { longPress } from "./longPress";

export const config: WebdriverIO.Config = {
  //...
  before: function (capabilities, specs) {
@wswebcreation
wswebcreation / README.md
Created November 3, 2024 09:55
WDIO Native scrollIntoView

Native scrollIntoView usage

Adjust the config like this

import { scrollIntoView } from "./scrollIntoView";

export const config: WebdriverIO.Config = {
  //...
  before: function (capabilities, specs) {
@wswebcreation
wswebcreation / LINKED-SALES-NAV-MESSAGE-SCRAPER.md
Last active September 21, 2024 15:19
LinkedIn Sales Nativator Message Scraper

There are many APIs available for downloading LinkedIn Sales Navigator data, but I couldn't find any for downloading archived messages.

This script is a "simple" scraper that will retrieve all messages and store them in a CSV file. You can use this with WebdriverIO.

Steps

  1. Create a new WDIO project.
  2. Add the script.
  3. Update the config with this configuration.
  4. Start WebdriverIO, but run it in watch mode using npm run wdio -- --watch.
@wswebcreation
wswebcreation / appium.1.18.3.log
Last active November 15, 2020 14:10
Appium Android Hybrid App not getting active webview
[Appium] Welcome to Appium v1.18.3
[Appium] Non-default server args:
[Appium] basePath: /
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /session
[HTTP] {"capabilities":{"alwaysMatch":{"automationName":"UiAutomator2","deviceName":"Pixel_3_10.0","platformName":"Android","platformVersion":"10.0","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/SauceLabsHybridApp/apps/Android.SauceLabs.Hybrid.app.1.0.0.apk","appWaitActivity":"com.saucelabshybridapp.MainActivity","noReset":true,"autoGrantPermissions":true,"newCommandTimeout":240,"language":"en","locale":"en"},"firstMatch":[{}]},"desiredCapabilities":{"automationName":"UiAutomator2","deviceName":"Pixel_3_10.0","platformName":"Android","platformVersion":"10.0","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/SauceLabsHybridApp/apps/Android.SauceLabs.Hybrid.app.1.0.0.apk","appWaitActivity":"com.saucelabshybridapp.MainActivity","noReset":true,"autoGrantPermissions":true,"newCommandTimeout":240,"language":"en
@wswebcreation
wswebcreation / draw.sauce.bolt.js
Last active March 27, 2020 20:28
The Test to draw the Sauce Labs Bolt with Appium, WebdriverIO and the W3C actions
// You can download the app from here
// http://appium.s3.amazonaws.com/ApiDemos-debug-2015-03-19.apk
//
// If you want to use the app, make sure you add this into your capabilities
// appActivity: '.graphics.FingerPaint',
// This will make sure that the FingerPaint screen is opened at once!
//
// Thanks to Jonathan Lipps for this Article
// https://appiumpro.com/editions/29
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"alwaysMatch":{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build/wdioDemoApp/Build/Products/Debug-iphonesimulator/wdioDemoApp.app","appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build/wdioDemoApp/Build/Products/Debug-iphonesimulator/wdioDemoApp.app","appium:newCommandTimeout":240}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build
[debug] [W3C (0bedd823)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"iOS","deviceName":"iPhone X","platformVersion":"12.2","orientation":"PORTRAIT","automationName":"XCUITest","app":"/Users/wimselles/Sauce/Git/appium-boilerplate/apps/iOS-Simulator-NativeDemoApp-0.3.0.app.zip","newCommandTimeout":240,"udid":"EAE23CD4-7B34-42D6-BBFB-F74B1543944D"}}
[HTTP] <-- POST /wd/hub/session 200 98636 ms - 569
[HTTP]
[HTTP] --> POST /wd/hub/session/0bedd823-3af4-4e59-a0c0-f9cfc370c6d6/element
[HTTP] {"using":"accessibility id","value":"Home, tab, 1 of 5"}
[debug] [W3C (0bedd823)] Calling AppiumDriver.findElement() with args: ["accessibility id","Home, tab, 1 of 5","0bedd823-3af4-4e59-a0c0-f9cfc370c6d6"]
[debug] [XCUITest] Executing command 'findElement'
[debug] [BaseDriver] Valid locat
[Appium] Welcome to Appium v1.14.0
[Appium] Non-default server args:
[Appium] chromedriverExecutable: ./chromedriver
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"alwaysMatch":{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.app.zip","noReset":true,"newCommandTimeout":240,"fullContextList":true},"firstMatch":[{}]},"desiredCapabilities":{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.app.zip","noReset":true,"newCommandTimeout":240,"fullContextList":true}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app"
This file has been truncated, but you can view the full file.
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"alwaysMatch":{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.1.0.0.app.zip","noReset":true,"newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.1.0.0.app.zip","noReset":true,"newCommandTimeout":240}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.1.0.0.app.zip","noReset":true,"newCommandTimeout":240},null,{"alwaysMatch":{"deviceName":"iPhone X","platformName":"iOS","platformVer
@wswebcreation
wswebcreation / selectors.js
Last active August 10, 2022 21:51
Preferred Native Appium Selectors for WebdriverIO
// The `~` tells WebdriverIO that it needs to look for an accessibiltyID
// Android: `content description`
// iOS: `accessibility id`
$('~accessibiltyID').click();
// -ios predicate string
const loginButton = 'type == \'XCUIElementTypeOther\' && name CONTAINS \'test-LOGIN\'';
$(`-ios predicate string:${ loginButton }`).click();
// -ios class chain, to make complex selectors