diff --git a/README.md b/README.md index 87729146..0ead2643 100755 --- a/README.md +++ b/README.md @@ -348,6 +348,16 @@ To make things easier, you can add your frequently-used proxies to PROXY_LIST in pytest proxy_test.py --proxy=proxy1 ``` + +### **Changing the User-Agent:** + +If you wish to change the User-Agent for your browser tests (Chrome and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command line. + +```bash +pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7412.EU" +``` + + ### **Production Environments & Integrations:** diff --git a/help_docs/ReadMe.md b/help_docs/ReadMe.md index f3fe8f12..0ca7425f 100755 --- a/help_docs/ReadMe.md +++ b/help_docs/ReadMe.md @@ -7,7 +7,8 @@ > - [**Installing Python, Pip, & Git**](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/install_python_pip_git.md) > - [**Python Virtual Env Tutorial**](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md) > - [**Verify Webdriver Installation**](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/verify_webdriver.md) -> - [**The Command Line Tutorial**](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/command_line.md) +> - [**The Command Line Tutorial**](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) +> - [**The Console Scripts Tutorial**](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md) > - [**SeleniumBase Method Summary**](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md) > - [**MySQL Installation Overview**](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mysql_installation.md) > - [**Safari Driver Detailed Info**](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/using_safari_driver.md) diff --git a/help_docs/customizing_test_runs.md b/help_docs/customizing_test_runs.md index fc1ccf75..e677126f 100755 --- a/help_docs/customizing_test_runs.md +++ b/help_docs/customizing_test_runs.md @@ -6,6 +6,7 @@ In addition to [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/m * Choose betweeen pytest & nose unittest runners * Choose whether to enter Debug Mode on failures * Choose additional variables to pass into tests +* Choose the User-Agent for the browser to use * Change the automation speed (with Demo Mode) * Choose whether to run tests multi-threaded * Choose whether to retry failing tests @@ -39,9 +40,11 @@ pytest test_suite.py --reruns 1 --reruns-delay 2 pytest test_suite.py --server=IP_ADDRESS --port=4444 -pytest test_suite.py --proxy=IP_ADDRESS:PORT +pytest proxy_test.py --proxy=IP_ADDRESS:PORT -pytest test_suite.py --proxy=USERNAME:PASSWORD@IP_ADDRESS:PORT +pytest proxy_test.py --proxy=USERNAME:PASSWORD@IP_ADDRESS:PORT + +pytest user_agent_test.py --agent="USER-AGENT STRING" pytest test_fail.py --pdb -s ``` @@ -178,3 +181,11 @@ To make things easier, you can add your frequently-used proxies to PROXY_LIST in ```bash pytest proxy_test.py --proxy=proxy1 ``` + +#### **Changing the User-Agent:** + +If you wish to change the User-Agent for your browser tests (Chrome and Firefox only), you can add ``--agent="USER-AGENT STRING"`` as an argument on the command line. + +```bash +pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7412.EU" +```