Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Import seleniumbase in visual studio code #1125

Answered by mdmintz
Binyamin999 asked this question in Q&A
Discussion options

Hi there,
First of all I want to thank you for the amazing framework.
I'm a junior QA started working for a startup company and they want me to start automation testing on python.
I wanted to ask you, how do I import seleniumbase on visual studio code after I installed seleniumbase :)

You must be logged in to vote

Hello @Binyamin999, and welcome!

Once you've installed seleniumbase, you can create a Python file like the one below, and then run it with pytest from the terminal. :)

from seleniumbase import BaseCase
class DemoSiteTests(BaseCase):
 def test_demo_site(self):
 self.open("https://seleniumbase.io/demo_page")
 self.type("#myTextInput", "This is Automated")
 self.type("textarea.area1", "Testing Time!\n")
 self.type('[name="preText2"]', "Typing Text!")
 self.assert_text("This Text is Green", "#pText")
 self.click("#myButton")
 self.assert_text("This Text is Purple", "#pText")

Replies: 1 comment 9 replies

Comment options

Hello @Binyamin999, and welcome!

Once you've installed seleniumbase, you can create a Python file like the one below, and then run it with pytest from the terminal. :)

from seleniumbase import BaseCase
class DemoSiteTests(BaseCase):
 def test_demo_site(self):
 self.open("https://seleniumbase.io/demo_page")
 self.type("#myTextInput", "This is Automated")
 self.type("textarea.area1", "Testing Time!\n")
 self.type('[name="preText2"]', "Typing Text!")
 self.assert_text("This Text is Green", "#pText")
 self.click("#myButton")
 self.assert_text("This Text is Purple", "#pText")
You must be logged in to vote
9 replies
Comment options

@Binyamin999 The terminal is the same for all files. Unless you're using a virtual environment, (which is recommended for local machines), then after running pip install seleniumbase in a terminal, you should be able to run any SeleniumBase test with pytest.

Comment options

@Binyamin999 The terminal is the same for all files. Unless you're using a virtual environment, (which is recommended for local machines), then after running pip install seleniumbase in a terminal, you should be able to run any SeleniumBase test with pytest.

When I run pip install seleniumbase in a terminal, I still have the same error, that i need to import seleniumbase.
What should I do?
Is it possible to share my screen recording?

Comment options

@Binyamin999 Can you share a screen recording? Or we can chat directly on https://gitter.im/seleniumbase/SeleniumBase

Comment options

@Binyamin999 Can you share a screen recording? Or we can chat directly on https://gitter.im/seleniumbase/SeleniumBase

How do I share screen recording here?

Comment options

@Binyamin999 CMD-SHIFT-5 on a Mac.

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /