Try   HackMD

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

  2. Create a folder, for example, selenium_server

  3. Download Selenium Server (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

    1. Download chromeDriver for your corresponding chrome version
    2. Unzip the downloaded file and put the chrome driver file in selenium_server

    Firefox

    1. Download geckodriver and find your corresponding OS version
    2. Unzip the downloaded file and put the gecko driver file in selenium_server

    Edge

    1. Download msedgedriver 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.

    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

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  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

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  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)

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
  2. Install Java
  3. Download Android Studio and make sure that Android SDK Tools are installed.
    (Customize→All settings →Appearance&Behavior→System Settings→Android SDK→SDK Tools)
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  4. Use the Android Virtual Device feature of Android Studio to start a virtual machine, and make sure that the USB debugging `feature is turned on.
  5. Download Chromedriver 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.
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  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.
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  4. Enable Playback through WebDriver in the Basic Setting.
  5. Run the test case.