Scriptworks Logo

Selenium and Appium Configuration

19 Oct 2018

This resource article contains general hints and tips on configuring Selenium (What is Selenium?) and the various browser it supports.

The official Selenium website is at seleniumhq.org

Driver Download Locations

Selenium Webdriver requires specific Browser Drivers to run tests on the Browser of choice. The Browser Drivers are required to be installed in the same Directory as the Selenium Server is run from or reachable via the PATH environment variable.

The Browser specific Drivers can be found below at:

Chrome (ChromeDriver): http://chromedriver.chromium.org
Firefox (GeckoDriver): https://github.com/mozilla/geckodriver/releases
IE (IEDriver): https://www.seleniumhq.org/download/
Edge (Microsoft Wedriver): https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ 
Safari (AppleSafariDriver): https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
Appium: http://appium.io/downloads.html

Driver Versioning

It is important to keep up to date with Driver versions as most browsers such as Chrome and Firefox are on rapid release cycles. When a new version of a browser is released a new version of the Driver is also close to follow. Using the incorrect driver for a newer version of a Browser can cause issues.

One such issue with Chrome and Chromedriver can be:

Unknown error: call in function results missing ‘value’

This error is resolved with swapping the Chromedriver executable in your directory with a newer version of Chromedriver.

PATH Environment Variable for Drivers

For some Drivers such as Firefox (GeckoDriver), Chrome (ChromeDriver) and Internet Explorer (IEDriver) the location of the Driver will need to be registered in the Path Environment Variable. This will require the parent folder of the Selenium components for example:

C:\Program Files (x86)\Selenium

Internet Explorer

General IE Set Up

For best results testing Selenium with IE and the InternetExplorerDriver we recommend the following settings:

  • Enable Protected Mode for all Security zones to be consistent. The value can be on or off, as long as it is the same for every zone. To set the Protected Mode settings, choose "Internet Options..." from the Tools menu, and click on the Security tab. For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode".
  • "Enhanced Protected Mode" must be disabled for IE 10 and higher. This option is found in the Advanced tab of the Internet Options dialog.
  • The browser zoom level must be set to 100% so that the native mouse events can be set to the correct coordinates.
  • For Windows 10, you will also need to set "Change the size of text, apps, and other items" to 100% in display settings.
  • Obviously the InternetExplorerDriver will only work on Windows!
  • IE Driver works fastest using the 32bit Driver which will launch a 32bit Version of Internet Explorer.

Any more information and configuration options for the IE Driver can be found at the following Wiki: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

Safari

Safari and Safari Technology Preview each provide their own safaridriver executable. Make sure you already have the executable on your device:

  • Safari’s executable is located at /usr/bin/safaridriver.
  • Safari Technology Preview's executable is part of the application bundle’s contents.

Each safaridriver is capable of launching only the Safari version it’s associated with, and the two can run simultaneously. Although you can launch safaridriver manually by running a safaridriver executable. Most Selenium libraries launch the driver automatically.

See the documentation for your preferred client library to learn how to specify which browser to use.

Safari also requires the “Allow Remote Automation” setting to be on which can be found in the “Developer” section of the Safari Menus.

There are older obsolete versions of SafariDriver which are no longer supported by the Selenium Project or Apple please make sure that the SafariDriver comes from the above resource.

Edge

Edge is driven by the MicrosoftWebdriver which is provided by Microsoft, please note that each version of the MicrosoftWebdriver and version of Edge have to be corresponding to the Build number of your Windows Build.

To find your Build number of Windows Go to Start > Settings > System > About and locate the number next to OS Build on the screen. This is your build number. Having the correct version of WebDriver for your build ensures the MicrosoftWebdriver runs correctly.

Zoom Settings

It is recommended for all Browsers and Drivers to have the Zoom setting set to 100%. This will reduce any issues with the driver clicking incorrect elements or clicks not being set on the correct location in the Application under test.

Appium

For ease of use with Appium it is suggested that Appium Desktop is installed.

Appium desktop works much like the Selenium Server but handles all Appium Traffic for your tests.

The Appium Desktop service can be started by opening the Appium application and pressing the “Start Server” button. This will enable Appium to start listening and it will pick up Appium tests and assign them to the device.

Android Set Up

When tests are being run Locally with Android and Emulators it is suggested that Android Studio is installed to create and run Emulators. Android Studio can be found from Google at:

https://developer.android.com/studio/

Other tools such as Appium Studio and Micro Focus Mobile Center can also be used to configure real devices and Emulators.

When using Real Devices, the correct USB drivers are required to be installed for Automation on the Real Device please make sure these are installed from the correct Vendor so the Real Device can be seen by Appium and the Test Script.

iOS Set Up (XCode)

When looking towards tools for iOS testing please note that XCode is Mac OSX only and is required for the running of iOS emulators and real device tests for Appium.

If using Emulators with XCode please note that you need to have the right simulator files in the Preferences>Components section of the options.

XCode is available from Apple at: https://developer.apple.com/xcode/

Cloud Service Providers (Saucelabs, Bitbar, TestingBot)

Cloud Service Providers for Cross Browser and Device testing such as Saucelabs , Bitbar and TestingBot which can be set up in the Run Settings.

These providers can be used to configure Virtual Machines and Real Devices in the cloud. Which can be used for the running of your automated testing.

These services provide platforms and configuration to empower your test coverage as these devices may not be available in your current organisation.

Saucelabs provides a configuration tool which can be used to configure your environment and these parameters can be added to your Run Settings to pass through to the test this can be found at:

https://wiki.saucelabs.com/display/DOCS/Platform+Configurator

 

 

Scriptworks logo
© Copyright 2024 | Scriptworks is part of Odin Technology Ltd, a company registered in England no. 03735083