1

I am currently using the command in Qmetry Automation Framework

QAFExtendedWebdriver mydriver = getQAFDriver();

It will stores current driver in ´mydriver´ object so I can access its available methods.

Now I need to create a new driver object in the same current session itself to access IOSDriver specific methods.

IOSDriver<WebElement> driver= new IOSDriver<WebElement>(url, capabilities);

How to get current session url, capabilities to pass as parameters in the above instantiation.

pirho
  • 11,565
  • 12
  • 43
  • 70
Prabu K
  • 11
  • 1

1 Answers1

0

Make sure you have provided driverClass capability having value fully qualified name of driver class. For example

properties:

driver.name=appiumDriver
appium.capabilities.driverClass=io.appium.java_client.ios.IOSDriver

You can get driver class object anytime by casting underlying driver as below:

IOSDriver<WebElement> iosdriver = (IOSDriver)driver.getUnderlayingDriver();

NOTE: driverClass capability will not applicable with remote driver, so if you provide driver name appiumRemoteDriver then driver class will not be considered and you will get class cast exception in above statement.

user861594
  • 5,733
  • 3
  • 29
  • 45