Third step finalized

parent c39ce047
Pipeline #21045 passed with stages
in 2 minutes and 51 seconds
import sys
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class ASWWU:
def __init__(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(5) # seconds
self.driver.get('https://aswwu.com/')
def searchMask(self, name):
xpath = "//a[contains(@href, 'https://aswwu.com/mask')]"
self.driver.find_element_by_xpath(xpath).click()
self.driver.find_element_by_id('mask-search-query').send_keys(name, Keys.ENTER)
self.driver.implicitly_wait(5) # seconds
xpath = "//search-results[contains(@ng-reflect-query,'" + name + "')]"
self.driver.find_element_by_xpath(xpath)
xpath = "//h4[contains(text(),'" + name + "')]"
result = self.driver.find_elements_by_xpath(xpath)
return result
def login(self, username, password):
self.driver.find_element_by_xpath("//a[contains(@href, 'https://saml.aswwu.com/?sso&redirect=/mask/search')]").click()
self.driver.find_element_by_id('userNameInput').send_keys(username)
self.driver.find_element_by_id('passwordInput').send_keys(password)
self.driver.find_element_by_id('submitButton').click()
self.driver.implicitly_wait(3) # wait to be logged in
def updateProfile(self, parameters):
# Access the profile editing page
self.driver.find_element_by_id('bubbleicon').click()
self.driver.find_element_by_xpath("//a[contains(text(),'Update Profile')]").click()
self.driver.implicitly_wait(3)
# Find the correct input based on the key value and enter the dictionary entry for that key
for key, value in parameters.items():
self.driver.find_element_by_id(key).clear()
self.driver.find_element_by_id(key).send_keys(value)
# Submit the changes
self.driver.find_element_by_xpath("//div[@id='submit']/button").click()
# Logout code. I wasn't sure
def close(self):
self.driver.find_element_by_id('bubbleicon').click()
self.driver.find_element_by_xpath("//div[@class='dropdown-menu show']/button").click()
# add login() [x], updateProfile(), and close() to ASWWU
# iterate over a dictionary with `for key, value in dict.items():`
def main():
aswwu = ASWWU()
assert(len(aswwu.searchMask('Ladd')) == 1)
# provide the user email and password as command-line arguments (for security)
aswwu.login(sys.argv[1], sys.argv[2])
aswwu.updateProfile({
'favorite_booksinput': 'F.A. Hayek, The Road to Serfdom',
'quoteinput': 'The road to hell is paved with good intentions.' })
aswwu.updateProfile({
'favorite_booksinput': 'Dune',
'quoteinput': 'Fear is the mindkiller',
'quote_authorinput': 'Frank Herbert' })
aswwu.close()
if __name__ == "__main__":
main()
......@@ -803,3 +803,100 @@ console.warn: TopSitesFeed: Failed to fetch data from Contile server: NetworkErr
###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
1644014325148 geckodriver INFO Listening on 127.0.0.1:23241
1644014328175 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "23242" "-no-remote" "-profile" "C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofilestAZiq"
1644014328513 Marionette INFO Marionette enabled
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofilestAZiq\\search.json.mozlz4", (void 0)))
DevTools listening on ws://localhost:23242/devtools/browser/b184a4be-52a2-4c62-a32a-3fa62c011fb8
1644014330513 Marionette INFO Listening on port 23247
1644014330913 RemoteAgent WARN TLS certificate errors will be ignored for this session
1644014345673 Marionette INFO Stopped listening on port 23247
console.warn: TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource.
###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
1644014347350 geckodriver INFO Listening on 127.0.0.1:23322
1644014350418 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "23323" "-no-remote" "-profile" "C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofileUEDDZX"
1644014350720 Marionette INFO Marionette enabled
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofileUEDDZX\\search.json.mozlz4", (void 0)))
DevTools listening on ws://localhost:23323/devtools/browser/259059ee-4451-4b3b-bd3d-7ddfc3a501a7
1644014352596 Marionette INFO Listening on port 23328
1644014353093 RemoteAgent WARN TLS certificate errors will be ignored for this session
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
1644014574302 Marionette INFO Stopped listening on port 23328
console.warn: TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource.
###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
1644014579012 geckodriver INFO Listening on 127.0.0.1:23441
1644014582053 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "23442" "-no-remote" "-profile" "C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofileqFGlpd"
1644014582353 Marionette INFO Marionette enabled
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofileqFGlpd\\search.json.mozlz4", (void 0)))
DevTools listening on ws://localhost:23442/devtools/browser/97f21d30-46e9-4846-ae96-ebe96abf3975
1644014584254 Marionette INFO Listening on port 23449
1644014584729 RemoteAgent WARN TLS certificate errors will be ignored for this session
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
1644014592821 Marionette INFO Stopped listening on port 23449
console.warn: TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource.
[Parent 1344, IPC I/O Parent] WARNING: file /builds/worker/checkouts/gecko/ipc/chromium/src/base/process_util_win.cc:167
###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
1644016081020 geckodriver INFO Listening on 127.0.0.1:23783
1644016084083 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "23784" "-no-remote" "-profile" "C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofile1XTMho"
1644016084399 Marionette INFO Marionette enabled
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofile1XTMho\\search.json.mozlz4", (void 0)))
DevTools listening on ws://localhost:23784/devtools/browser/abd46841-0620-433b-9cf1-73c9394c608a
1644016086442 Marionette INFO Listening on port 23790
1644016086779 RemoteAgent WARN TLS certificate errors will be ignored for this session
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://aswwu.com"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://aswwu.com"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
1644016106889 geckodriver INFO Listening on 127.0.0.1:23886
1644016109962 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "23887" "-no-remote" "-profile" "C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofilebf2Y2R"
1644016110258 Marionette INFO Marionette enabled
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at C:\\Users\\brado\\AppData\\Local\\Temp\\rust_mozprofilebf2Y2R\\search.json.mozlz4", (void 0)))
DevTools listening on ws://localhost:23887/devtools/browser/3fb7192a-cd06-42fb-8a32-02cb38672612
1644016112289 Marionette INFO Listening on port 23892
1644016112646 RemoteAgent WARN TLS certificate errors will be ignored for this session
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://aswwu.com"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://adfs.wallawalla.edu"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "https://aswwu.com"
JavaScript error: resource://gre/modules/LoginManagerParent.jsm, line 136: TypeError: gRecipeManager is null
1644016127763 Marionette INFO Stopped listening on port 23892
console.warn: TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment