This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { chromium } = require('playwright'); | |
(async () => { | |
const browser = await chromium.launch(); | |
const context = await browser.newContext(); | |
// Enable network request interception | |
await context.route('**/*', (route, request) => { | |
// Intercept the network request | |
console.log(`Intercepted: ${request.url()}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set dir_path=C:\Example\Directory | |
if not exist "%dir_path%" ( | |
echo Directory does not exist. | |
exit /b | |
) | |
echo Scanning directory "%dir_path%"... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set "dir=C:\path\to\APK\files" | |
for /r "%dir%" %%i in (*.apk) do ( | |
set "filename=%%~nxi" | |
goto install | |
) | |
echo No APK files found in %dir% | |
goto end | |
:install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from time import sleep | |
# os.system("start /B start cmd.exe @cmd /k appium") | |
os.system("start /B start cmd.exe @cmd /k appium -a 127.0.0.1 -p 4728") | |
sleep(8) | |
os.system("taskkill /F /IM node.exe") | |
os.system("taskkill /F /IM cmd.exe") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
import os | |
import time | |
mobile_emulation = { | |
"deviceMetrics": { "width": 411, "height": 731, "pixelRatio": 3.0 }, | |
"userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" } # For LINUX | |
#"userAgent": "mobile web mac : "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36" } # For MAC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## declare an array variable | |
## declare -a arr=("element1" "element2" "element3") | |
local=(ja) | |
#local=(pt-BR pt-PT ru th tr vi zh-TW) | |
function switchLocal(){ | |
adb shell am broadcast -a com.google.android.testing.i18n.localeswitcher.CHANGE_LOCALE -e LANGUAGE_TAG "$1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
from appium import webdriver | |
import time | |
@pytest.mark.parametrize("udid, systemPort", [ | |
("FA7BN1A04058", "8201"), | |
("FA7BN1A04086", "8202") | |
] | |
) | |
def test_SettingsTestCase(udid, systemPort): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from appium import webdriver | |
import time | |
import os.path | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.common.by import By | |
xpath = By.XPATH | |
id = By.ID | |
css = By.CSS_SELECTOR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
udid = '99SAY1BJFV' | |
filename = 'videoRecord' | |
def startRecord(filename): | |
adb = 'adb -s ' + udid + ' shell screenrecord /sdcard/' + filename + '.mp4' | |
os.system(adb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from appium import webdriver | |
import os.path | |
import time | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.common.by import By | |
from appium.webdriver.common.touch_action import TouchAction | |
xpath = By.XPATH | |
id = By.ID |
NewerOlder