Perfecto-Quantum / Quantum-Starter-Kit

Get started with Quantum! Clone or download this repository to start, contains examples of tests and step definitions.
MIT License
58 stars 80 forks source link

how to get current sessionURL to create new IOSdriver #31

Closed myProwess closed 4 years ago

myProwess commented 6 years ago

Hi folks,

I am currently using the command QAFExtendedWebdriver mydriver = getQAFDriver(); It will stores current driver in "mydriver" object so i can call 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.

I googled a lot. But its not working out for me. Any inputs will help me a lot

kulin24 commented 6 years ago

You cannot create a new driver for the existing session that is not correct. If you simply want to use the IOSDriver specific methods then you can use the IOSDriver which is available in AppiumUtils class. You will need to make sure the initial driver that you create is an IOSDriver and then you can access the IOSDriver specific methods using AppiumUtils.getIOSDriver()