When running the following automation script using gigafox I am faced with the error
Assert self.caps, 'Driver capabilities must be defined' AssertionError: Driver capabilities must be defined
This occurs while I am running against a browser or an app. Not sure why. Gigafox replaces appium in this case and should not need to be appium. I have tried Chrome and the package name. Not sure why this shows up after all the different settings I have tried.
from __future__ import print_function
import sys
import time
from appium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
GF_USER_NAME = 'admin'
GF_API_KEY = ''
GF_DEVICE_ID = '1edcc865-60d9-4574-b46f-96070af21b8a'
GF_HOST = '192.168.0.162'
# These variables probably don't need change unless you change the app or
# the way you use Appium.
#APP_PACKAGE = 'com.fisglobal.d1amerismobile.sit/com.fisglobal.d1amerismobile.sit.MainActivity'
#APP_ACTIVITY = 'com.fisglobal.d1amerismobile.sit/com.fisglobal.d1amerismobile.sit.MainActivity'
AUTOMATION_NAME = 'UiAutomator2'
#desired_caps = DesiredCapabilities.CHROME
desired_capabilities = {
'gigafox:UserName' : GF_USER_NAME,
'gigafox:ApiKey' : GF_API_KEY,
'gigafox:Device' : GF_DEVICE_ID,
'gigafox:application' : "",
'appPackage' : "",
'appActivity' : "",
'browserName' : "Chrome",
'newCommandTimeout' : 20000,
'platformName' : "Android",
'automationName' : AUTOMATION_NAME
}
#url used to connect to the host server where the device is
url = 'http://{0}/Appium'.format(GF_HOST)
print('loading driver')
#Starts the driver to establish connection to device
driver = webdriver.Remote(url, desired_capabilities)
print('connected.')
time.sleep(10)
#Sets the site the browser will open
driver.get("https://www.appium.io")
print('connected.')
time.sleep(10)
driver.quit()```