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

hide the URL in different file #1005

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

Hello Sir,
I really appreciate your efforts on this great framework. Can you please share, how can i use the URL with custom settings file?
for example:
URL.py

URL=www.yahoo.com
test.py

self.open(URL)
I don't want to pass the URL directly or use dotenv file. is there any option for me?

You must be logged in to vote

Hello @rjameel,
For a start page, you could pass that on the command line with:
pytest --url=https://seleniumbase.io

Or if you want to use a variable later, you could store it into self.data:
pytest --data=https://seleniumbase.io

self.open(self.data)

The custom_settings_file is specifically for modifying SeleniumBase settings. If you still want to have data in a file to be used later, you can use simple Python file I/O to read from that file in a test. https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates/file_parsing

Replies: 1 comment

Comment options

Hello @rjameel,
For a start page, you could pass that on the command line with:
pytest --url=https://seleniumbase.io

Or if you want to use a variable later, you could store it into self.data:
pytest --data=https://seleniumbase.io

self.open(self.data)

The custom_settings_file is specifically for modifying SeleniumBase settings. If you still want to have data in a file to be used later, you can use simple Python file I/O to read from that file in a test. https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates/file_parsing

You must be logged in to vote
0 replies
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
2 participants

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