I am creating testing of my website in pytest using selenium and selenoid.
I have a class that inherits from BaseCase and for example when I want to open a webpage I write super().open(URL). Or, if I want to click on an element I write: self.click(element_selector).
I am a bit confused, however, on why most other examples I find online first have to create a webdriver, and only then can they do actions such as open and click, thru it. Whereas I can just access it thru class object (self.click()).
I understand that this has to do with my using selenoid. However, I am not quite sure how it all fits together.
I have had a lot of trouble finding an explanation online, as every time I try to type in the words selenoid and webdriver together, google assumes I mean selenium. I can't find any related results.
Anyone have an explanation on this? (Or, even a better search term to use than Selenoid Webdriver Pytest or What do I use instead of Webdriver in Selenoid?

1 Answer

I suggest implementing your tests in the way like tutorials suggest, at least until you'll feel experienced. In this way, you will do your tasks in the way most other people do.

So I suggest do not use some libraries classes inheritance, but creating webdriver instance and using it. (But still, it's your choice and up to you). I cannot add anything more without seeing your code..

Selenium + Selenoid

Selenoid behaves like Selenium Grid.

If your Selenoid started on localhost:4444, just

from selenium import webdriver chrome_options = webdriver.ChromeOptions() driver = webdriver.Remote( command_executor=' options=chrome_options ) driver.get("") driver.quit() 

Setup Selenoid

(assumed you already have Docker):

1 Download cm from

2 Run chmod +x cm

3 Run

./cm selenoid start 

And your Selenoid will be ready to accept requests.

Check .


References

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy