This project uses the Playwright library to crawl a specified webpage with Chrome and Firefox with WebAssembly enabled and disabled. The downloaded webpage files are downloaded to the folder JSOutput
. Screenshots are saved to the Screenshots
folder. The playwright will emulate as an android device.
- Node.js
- MySQL
- Android Studio/ Real Android Device
- Run the
found_page_schema.sql
under theDatabase
folder to set up the schema and table for metadata logging. - Run the command
npm install
in the root directory of this project (same as this README). - Run
npm update
to update all the packages - Run
npm run build
- Download Android Studio from the website, installed it with virtual devices support.
- Create a virtual device using device manager in Android device, and installing firefox on your virtual device.
- Setting the environment variable to get adb work, type
adb
to check if it works. - Setting environment variable
ANDROID_HOME
to where you installed your Android Studio,JAVA_HOME
to your jdk npm install -g appium@next
, this will install appium v2.x- Run
appium driver install uiautomator2
,appium driver install chromium
,appium driver install gecko
, this will get you the required driver - Download geckodriver from geckodriver download website, extra the downloaded file and add the path to your environment.
- Run the virtual devices through Android Studio Device Manager or through terminal
- Run Appium in the root directory. To do this, open up a new terminal and type
appium --base-path /wd/hub
- Open another terminal and run the command
node ./build/index.js --url <url_to_san>
to scan the<url_to_san>
and all of its first-level subpages. For example, try running the commandnode ./build/index.js --url https://jkumara.github.io/pong-wasm/
as this site contains WebAssembly. - To scan a list of urls with the crawler, run the command
node ./build/index.js --file <file_path>
to read in the file at<file_path>
. For example, to use the included filesites.txt
, run the commandnode ./build/index.js --file sites.txt
- To generate visual analysis report, run
python scripts/ScreenshotAnalysis.py
- If in the emulator device open the browser but never goto the url, shut down appium terminal, and run
adb uninstall io.appium.uiautomator2.server
andadb uninstall io.appium.uiautomator2.server.test
, then relaunch appium