summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-07-30 20:10:11 +0200
committerSanto Cariotti <santo@dcariotti.me>2021-07-30 20:10:11 +0200
commite4971fdadfda1de6038274df5f163077de1acb4e (patch)
treea09c586e344c3472f7db447592e49bba522a8ff5 /src
parentae38752e503ce921bea34e72415be4b4aadcdf68 (diff)
fix: login url and sleep between input send keys
Diffstat (limited to 'src')
-rw-r--r--src/browser/web_browser.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/browser/web_browser.rs b/src/browser/web_browser.rs
index 53b8baa..da8bcd1 100644
--- a/src/browser/web_browser.rs
+++ b/src/browser/web_browser.rs
@@ -4,7 +4,7 @@ use thirtyfour::error::{WebDriverError, WebDriverErrorInfo, WebDriverErrorValue}
use thirtyfour::prelude::{By, WebDriverResult};
use thirtyfour::{FirefoxCapabilities, WebDriver, WebDriverCommands};
-const LOGIN_URL: &str = "https://studenti.smartedu.unict.it/WorkFlow2011/Logon/Logon.aspx";
+const LOGIN_URL: &str = "https://studenti.smartedu.unict.it/WorkFlow2011/Logon/Logon.aspx?ReturnUrl=%2fStudenti%2fDefault.aspx";
pub struct Browser {
driver: Option<WebDriver>,
@@ -33,12 +33,14 @@ impl Browser {
let cf_input = _d.find_element(By::Name("ctl01$contents$UserName")).await?;
cf_input.send_keys(&credentials.cf).await?;
+ thread::sleep(time::Duration::from_millis(3000));
+
let psw_input = _d
.find_element(By::Name("ctl01$contents$UserPassword"))
.await?;
psw_input.send_keys(&credentials.password).await?;
- thread::sleep(time::Duration::from_millis(1000));
+ thread::sleep(time::Duration::from_millis(3000));
_d.find_element(By::Name("ctl01$contents$LogonButton"))
.await?