Multi driver switching in single test

36 views
Skip to first unread message

Ranjan Kale

unread,
May 17, 2024, 3:45:57 AMMay 17
to qaf users
Hi All,

I am trying to use two drivers in my test; chrome and android.

Below is the test : 

Screenshot 2024-05-17 at 1.02.47 PM.png

Below is the application.properties
Screenshot 2024-05-17 at 1.05.25 PM.png

Behaviour -  Chrome is launched and mentioned step is performed. But when the setDriver("androidDriver") is called the existing open chrome browser gets closed and then android test continue to run. After android test run and upon switch back to chrome the test fails. This is because the chrome driver is again initialised.

Expected Behaviour : The chrome browser should not close when switched to other driver

Error:
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"*[name='q']"}
  (Session info: chrome=124.0.6367.208)

qaf-version - 4.0.0-RC3

Any help and suggestions will be helpful.

Thanks,
Ranjan

cjayswal

unread,
Jun 1, 2024, 1:52:15 PMJun 1
to qaf users
did you set android driver capabilities? if not you should try setting capabilities using android.additional.capabilities property.
Reply all
Reply to author
Forward
0 new messages