Skip to content

Commit d04f8aa

Browse files
committed
Add a User-Agent test
1 parent 0b9276e commit d04f8aa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

examples/user_agent_test.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import time
2+
from seleniumbase import BaseCase
3+
4+
5+
class MyTestClass(BaseCase):
6+
7+
def test_user_agent(self):
8+
self.open('http://www.whatsmyua.info/')
9+
user_agent = self.get_text("#custom-ua-string")
10+
print("\n\nUser-Agent = %s\n" % user_agent)
11+
print("Displaying User-Agent Info:")
12+
print(self.get_text("#useragent"))
13+
print("\nThe browser will close automatically in 7 seconds...")
14+
time.sleep(7)

0 commit comments

Comments
 (0)