--- tags: Rapi Document English --- # Cross-Browser Testing Rapi facilitates cross-browser testing by supporting the execution of recorded test cases across various modern browsers using WebDriver, Selenium Standalone Server, and Appium. ## Desktop Browsers 1. Install [Java SE](https://www.oracle.com/technetwork/java/javase/downloads/index.html) 2. Create a folder, for example, `selenium_server` 3. Download [Selenium Server](https://www.selenium.dev/downloads/) (Recommended version: 4.8.1) 4. Put `selenium-server-{version}.jar` in `selenium_server` 5. Put the drivers that you'd like to test in `selenium_server` >#### Here are the browsers currently supported by Rapi >- [Chrome](#Chrome) >- [Firefox](#Firefox) >- [Edge](#Edge) >- [Safari](#Safari) #### Chrome 1. Download [chromeDriver](http://chromedriver.chromium.org/downloads) for your corresponding chrome version 2. Unzip the downloaded file and put the chrome driver file in `selenium_server` #### Firefox 1. Download [geckodriver](https://github.com/mozilla/geckodriver/releases) and find your corresponding OS version 2. Unzip the downloaded file and put the gecko driver file in `selenium_server` #### Edge 1. Download [msedgedriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/#downloads) and find your corresponding browser version 2. Unzip the downloaded file and put the edge driver file in `selenium_server`. Note that, for the Selenium Server 3.x, the file name of the driver should be renamed to `MicrosoftWebDriver.exe`. <!-- #### Edge Legacy > Tested version: EdgeHTML 17.17134 on Windows 1. Download [msedgedriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/#downloads) and find your corresponding browser version :::warning Webdriver for Edge version above 18 is now a Windows [Feature on Demand](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/#downloads). ::: 2. Unzip the downloaded file and put the edge driver file in `selenium_server` --> #### Safari 1. Open terminal to run `safaridriver --enable` and enter your user password. 2. Open Safari and enable the **Develop** menu by clicking **Safari** > **Preferences** > **Advanced**. Select the **Show Develop Menu** check box. 3. Enable **Remote Automation** by clicking the **Develop** menu and then **Allow Remote Automation**. 6. Open Rapi and press the setting button in the upper right corner 7. Toggle **Playback through WebDriver** ![](https://i.imgur.com/U1FFAfS.png) 8. Fill in **Selenium Server URL** with `localhost` and **Port** with `4444` (You can change `localhost` to the IP where your selenium server runs) 9. Fill in **browerName** with `chrome`, `firefox`, `MicrosoftEdge` or `safari`, and leave the other fields blank![](https://i.imgur.com/K3tCJWD.png) 10. Open terminal and change the path to the `selenium_server` folder. Run `java -jar selenium-server-{version}.jar standalone` 11. If you are using MAC OS, grant permission to your drivers by going into **System Preferences** -> **Security & Privacy**, and allow the driver to run. Another way to grant permission is by running the following commands in the terminal under the same path as the previous step: - For Chrome, run `spctl --add --label 'Approved' chromedriver` - For Firefox, run `spctl --add --label 'Approved' geckodriver` - For Microsoft Edge, run `spctl --add --label 'Approved' MicrosoftWebDriver` - Safari does need additional permissions 12. Play the test case. A Chrome, Firefox, Edge or Safari window will be automatically triggered by the selenium server ## Mobile Browsers > Here are the mobile Platforms currently supported by Rapi > - [Android(Emulator)](#Android(Emulator)) > - [iOS(Simulator)](#iOS(Simulator)) ### Android(Emulator) > The first 7 steps are for setting up Appium and an Android emulator. If you already have the Appium and Android environment set up, you can skip to step 8. 1. Install [Appium](https://appium.io/) 2. Install [Java](https://www.oracle.com/technetwork/java/javase/downloads/index.html) 3. Download [Android Studio](https://developer.android.com/studio) and make sure that Android SDK Tools are installed. (Customize→All settings →Appearance&Behavior→System Settings→Android SDK→SDK Tools) ![](https://i.imgur.com/oT0OY0C.png) ![](https://i.imgur.com/iHixZGJ.png) 4. Use the [**Android Virtual Device**](https://developer.android.com/studio/run/managing-avds) feature of Android Studio to start a virtual machine, and make sure that the `USB debugging` `feature is turned on. 5. Download [Chromedriver](https://chromedriver.chromium.org/downloads) and make sure the chromedriver version matches the browser on your mobile device. 6. Open Appium and click `Edit Configurations`. In the `ANDROID_HOME` field, enter the SDK Location of Android Studio, and in the `JAVA_HOME` field, enter `/path/to/JAVA/jrex.x.x_x`. Click `Save and Restart`. 7. Switch to the `Advanced` settings in Appium, scroll down to `Android`, and enter the Chrome Driver file path in the `Chromedriver Binary Path` field. Click `Start Server`. 8. Open the Rapi configuration page, go to `WebDriver Settings` -> `Add New Service` -> `Appium`. Enter localhost in the `Server URL` field, and 4723 in the `Port` field. Click `Add New Browser`, and in the **browserName**, **platformName**, **deviceName**, and **automationName** fields, enter `chrome`, `android`, `<YOUR_PHONE_NAME>`, and `UiAutomator2`, respectively. ![](https://i.imgur.com/uCG3SRh.png) 9. Enable `Playback through WebDriver` in the `Basic Setting`. 10. Run the test case. ### iOS(Simulator) 1. Launch the iOS Simulator. 2. Switch to the `Advanced` settings in Appium, scroll down to `iOS`, and enter `8100` in the `WebDriverAgent Port` field. Click `Start Server`. 3. Open the Rapi configuration page, go to `WebDriver Settings` -> `Add New Service` -> `Appium`. Enter localhost in the `Server URL` field, and 4723 in the `Port` field. Click `Add New Browser`, and in the **browserName**, **platformName**, **deviceName**, and **automationName** fields, enter `Safari`, `iOS`, `<YOUR_PHONE_NAME>`, and `XCUITest`, respectively. ![](https://i.imgur.com/ZHgpb0H.png) 4. Enable `Playback through WebDriver` in the `Basic Setting`. 5. Run the test case.