Skip to content

Commit 63e7ece

Browse files
committed
Running scripts in headless mode
1 parent 7466927 commit 63e7ece

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

Practice/geckodriver.log

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,3 +578,81 @@ DevTools listening on ws://127.0.0.1:61213/devtools/browser/22d4685a-fc02-4764-a
578578
console.warn: LoginRecipes: "Falling back to a synchronous message for: https://the-internet.herokuapp.com."
579579
1716895830151 Marionette INFO Stopped listening on port 61222
580580
Dynamically enable window occlusion 1
581+
1718097581085 geckodriver INFO Listening on 127.0.0.1:63562
582+
1718097584172 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "63563" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\HP\\AppData\\Local\\Temp\\rust_mozprofile1EQHIW"
583+
console.warn: services.settings: Ignoring preference override of remote settings server
584+
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
585+
Dynamically enable window occlusion 0
586+
1718097584989 Marionette INFO Marionette enabled
587+
1718097585096 Marionette INFO Listening on port 63574
588+
WebDriver BiDi listening on ws://127.0.0.1:63563
589+
Read port: 63574
590+
1718097585356 RemoteAgent WARN TLS certificate errors will be ignored for this session
591+
DevTools listening on ws://127.0.0.1:63563/devtools/browser/3f62aa8a-1c7f-4576-9e8e-9ed192eeeb73
592+
1718097598845 Marionette INFO Stopped listening on port 63574
593+
Dynamically enable window occlusion 1
594+
1718097616360 geckodriver INFO Listening on 127.0.0.1:63627
595+
1718097619416 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "63628" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\HP\\AppData\\Local\\Temp\\rust_mozprofileyjqZMx"
596+
console.warn: services.settings: Ignoring preference override of remote settings server
597+
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
598+
Dynamically enable window occlusion 0
599+
1718097619819 Marionette INFO Marionette enabled
600+
1718097619901 Marionette INFO Listening on port 63637
601+
WebDriver BiDi listening on ws://127.0.0.1:63628
602+
Read port: 63637
603+
1718097620095 RemoteAgent WARN TLS certificate errors will be ignored for this session
604+
DevTools listening on ws://127.0.0.1:63628/devtools/browser/7108428a-e93d-4b46-acc2-490cf4713851
605+
1718097635810 Marionette INFO Stopped listening on port 63637
606+
Dynamically enable window occlusion 1
607+
1718097653911 geckodriver INFO Listening on 127.0.0.1:63690
608+
1718097656955 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "63691" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\HP\\AppData\\Local\\Temp\\rust_mozprofile7kph0e"
609+
console.warn: services.settings: Ignoring preference override of remote settings server
610+
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
611+
Dynamically enable window occlusion 0
612+
1718097657352 Marionette INFO Marionette enabled
613+
1718097657439 Marionette INFO Listening on port 63700
614+
WebDriver BiDi listening on ws://127.0.0.1:63691
615+
Read port: 63700
616+
1718097657637 RemoteAgent WARN TLS certificate errors will be ignored for this session
617+
DevTools listening on ws://127.0.0.1:63691/devtools/browser/dddbf6ee-88f8-4181-b481-d0863afe9d44
618+
1718097678969 Marionette INFO Stopped listening on port 63700
619+
Dynamically enable window occlusion 1
620+
1718097732363 geckodriver INFO Listening on 127.0.0.1:63769
621+
1718097735410 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "63770" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\HP\\AppData\\Local\\Temp\\rust_mozprofileMkpmmY"
622+
console.warn: services.settings: Ignoring preference override of remote settings server
623+
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
624+
Dynamically enable window occlusion 0
625+
1718097735782 Marionette INFO Marionette enabled
626+
1718097735866 Marionette INFO Listening on port 63780
627+
WebDriver BiDi listening on ws://127.0.0.1:63770
628+
Read port: 63780
629+
1718097736081 RemoteAgent WARN TLS certificate errors will be ignored for this session
630+
DevTools listening on ws://127.0.0.1:63770/devtools/browser/7ceb7711-75ee-4906-bf84-12edda0471f0
631+
1718097755614 Marionette INFO Stopped listening on port 63780
632+
Dynamically enable window occlusion 1
633+
1718097882307 geckodriver INFO Listening on 127.0.0.1:63883
634+
1718097885378 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "63884" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\HP\\AppData\\Local\\Temp\\rust_mozprofileKGG1HT"
635+
console.warn: services.settings: Ignoring preference override of remote settings server
636+
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
637+
Dynamically enable window occlusion 0
638+
1718097885808 Marionette INFO Marionette enabled
639+
1718097885892 Marionette INFO Listening on port 63893
640+
WebDriver BiDi listening on ws://127.0.0.1:63884
641+
Read port: 63893
642+
1718097886116 RemoteAgent WARN TLS certificate errors will be ignored for this session
643+
DevTools listening on ws://127.0.0.1:63884/devtools/browser/4ef59d6c-337c-4b1e-94a9-7a5668ab993e
644+
1718097905090 Marionette INFO Stopped listening on port 63893
645+
Dynamically enable window occlusion 1
646+
1718097920844 geckodriver INFO Listening on 127.0.0.1:63947
647+
1718097923922 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "63948" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "C:\\Users\\HP\\AppData\\Local\\Temp\\rust_mozprofileE80VL8"
648+
console.warn: services.settings: Ignoring preference override of remote settings server
649+
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
650+
Dynamically enable window occlusion 0
651+
1718097924308 Marionette INFO Marionette enabled
652+
1718097924391 Marionette INFO Listening on port 63957
653+
WebDriver BiDi listening on ws://127.0.0.1:63948
654+
Read port: 63957
655+
1718097924601 RemoteAgent WARN TLS certificate errors will be ignored for this session
656+
DevTools listening on ws://127.0.0.1:63948/devtools/browser/38412db8-9cab-4f54-8213-4663dc8e80b1
657+
1718097932287 Marionette INFO Stopped listening on port 63957
658+
Dynamically enable window occlusion 1
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
# Run in headless mode - It supposed to run in the background but it doesn't
3+
"""
4+
5+
from selenium import webdriver
6+
from selenium.webdriver.common.by import By
7+
8+
# Run in headless mode
9+
firefox_options = webdriver.FirefoxOptions()
10+
firefox_options.add_argument("Headless") # Is it usefull?
11+
12+
# Firefox webdriver for herokuapp site
13+
fDriver = webdriver.Firefox()
14+
fDriver.get('https://the-internet.herokuapp.com/abtest')
15+
16+
# Header 3 text and make assertion
17+
headerText = fDriver.find_element(By.TAG_NAME, 'h3').text
18+
print(f'The text of the header is: {headerText}')
19+
assert headerText == 'A/B Test Variation 1'

0 commit comments

Comments
 (0)