Cannot use Selenide with Appium

375 views
Skip to first unread message

Alexander Raichman

unread,
Mar 30, 2020, 6:28:53 PM3/30/20
to selenide
Hi,
I'm using Selenide with appium for my mobile tests.
Since I upgraded Selenide to the last version I have the following problem:
I create driver before I start test suite (AndroidDriver<MobileElement> or IOSDriver<MobileElement>) and before tests start I call for the function WebDriverRunner.setWebDriver() with created driver.
But when I want to use Selenide functions (like $()) I get the following message: "No webdriver is bound to current thread. You need to call open(url) first."
In previous versions it worked fine.
Can someone please help?
Thanks!
I use Tesng 7.1.0,    Selenide 5.1.0,   Appium 7.3.0

Andrei Solntsev

unread,
Mar 31, 2020, 4:00:34 AM3/31/20
to Alexander Raichman, selenide
Hi. 
As a quick solution, you can just upgrade to latest Selenide 5.10.0

But I recommend to understand why you are getting this error. 
It happens because you are calling $ or $$ method BEFORE opening a webdriver. Typically it happens when you use static fields which is a bad test design.

Andrei Solntsev


вт, 31 мар. 2020 г. в 01:28, Alexander Raichman <alex...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "selenide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenide+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenide/c8774cdb-34c7-4665-8e15-911de667044f%40googlegroups.com.
Message has been deleted

Alexander Raichman

unread,
Apr 1, 2020, 1:58:00 AM4/1/20
to selenide
Thank you for the answer, Andrei.
I have no static fields in my code.
However, I  found, that in TestNG XML files, if I remove time-out attribute from the suite element everything works fine.
I don't know why , but it fixed this issue.

On Tuesday, 31 March 2020 11:00:34 UTC+3, Andrei Solntsev wrote:
Hi. 
As a quick solution, you can just upgrade to latest Selenide 5.10.0

But I recommend to understand why you are getting this error. 
It happens because you are calling $ or $$ method BEFORE opening a webdriver. Typically it happens when you use static fields which is a bad test design.

Andrei Solntsev


вт, 31 мар. 2020 г. в 01:28, Alexander Raichman <alex...@gmail.com>:
Hi,
I'm using Selenide with appium for my mobile tests.
Since I upgraded Selenide to the last version I have the following problem:
I create driver before I start test suite (AndroidDriver<MobileElement> or IOSDriver<MobileElement>) and before tests start I call for the function WebDriverRunner.setWebDriver() with created driver.
But when I want to use Selenide functions (like $()) I get the following message: "No webdriver is bound to current thread. You need to call open(url) first."
In previous versions it worked fine.
Can someone please help?
Thanks!
I use Tesng 7.1.0,    Selenide 5.1.0,   Appium 7.3.0

--
You received this message because you are subscribed to the Google Groups "selenide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sele...@googlegroups.com.

Andrei Solntsev

unread,
Apr 1, 2020, 6:14:07 AM4/1/20
to alexa...@phytech.com, selenide
Ok, I know why.
When you set timeout for the test or suite, TestNG runs "@Before" and "@Test" methods in different threads. 

In case of Selenide, you don't really need this timeout, because every Selenide command has a finite timeout anyway. So the test cannot run forever. 

Andrei Solntsev


ср, 1 апр. 2020 г. в 08:54, <alexa...@phytech.com>:
Thank you for the answer, Andrei.
I have no static fields in my code.
However, I  found, that in TestNG XML files, if I remove time-out attribute from the suite element everything works fine.
I don't know why , but it fixed this issue.

On Tuesday, 31 March 2020 11:00:34 UTC+3, Andrei Solntsev wrote:
Hi. 
As a quick solution, you can just upgrade to latest Selenide 5.10.0

But I recommend to understand why you are getting this error. 
It happens because you are calling $ or $$ method BEFORE opening a webdriver. Typically it happens when you use static fields which is a bad test design.

Andrei Solntsev


вт, 31 мар. 2020 г. в 01:28, Alexander Raichman <alex...@gmail.com>:
Hi,
I'm using Selenide with appium for my mobile tests.
Since I upgraded Selenide to the last version I have the following problem:
I create driver before I start test suite (AndroidDriver<MobileElement> or IOSDriver<MobileElement>) and before tests start I call for the function WebDriverRunner.setWebDriver() with created driver.
But when I want to use Selenide functions (like $()) I get the following message: "No webdriver is bound to current thread. You need to call open(url) first."
In previous versions it worked fine.
Can someone please help?
Thanks!
I use Tesng 7.1.0,    Selenide 5.1.0,   Appium 7.3.0

--
You received this message because you are subscribed to the Google Groups "selenide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sele...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "selenide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenide+u...@googlegroups.com.

Alexander Raichman

unread,
Apr 1, 2020, 6:31:05 AM4/1/20
to selenide
OK, thank you
Reply all
Reply to author
Forward
0 new messages