Search code examples
rubyappium

Appium driver OS name


While writing script for Android and iOS in single file. How to check appium driver is created for iOS or Android? I have tried to check for version release but it gives build version only.


Solution

  • You can check as below. This line of code will return true if you are using android driver otherwise false.

    $driver.device_is_android?
    

    Above line of code will work only after initializing driver.