-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
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
-
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
Beta Was this translation helpful? Give feedback.