Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Pavel Zakharov
/
Dispatch_Central
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 903daf3c
authored
Mar 29, 2019
by
Igor Salmanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
have been added navigate to find vehicles" page and checked option "All" in orig…
…in and destination element select
1 parent
14a0f7c6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
CentralDispatcher/Program.cs
CentralDispatcher/Program.cs
View file @
903daf3
...
@@ -27,21 +27,20 @@ namespace CentralDispatcher
...
@@ -27,21 +27,20 @@ namespace CentralDispatcher
// var options = new ChromeOptions();
// var options = new ChromeOptions();
// options.AddArguments("--headless", "--log-level=3", "--no-sandbox", "--disable-web-security", "--disable-gpu", "--incognito", "--hide-scrollbars");
// options.AddArguments("--headless", "--log-level=3", "--no-sandbox", "--disable-web-security", "--disable-gpu", "--incognito", "--hide-scrollbars");
// options.AddUserProfilePreference("profile.default_content_setting_values.images", 2);
// options.AddUserProfilePreference("profile.default_content_setting_values.images", 2);
// using (
// using (
var
driver
=
new
ChromeDriver
(
chromedriverPath
);
var
driver
=
new
ChromeDriver
(
chromedriverPath
);
// )
// )
// {
// {
driver
.
Navigate
().
GoToUrl
(
titlePageUrl
);
driver
.
Navigate
().
GoToUrl
(
titlePageUrl
);
Actions
action
=
new
Actions
(
driver
);
Actions
action
=
new
Actions
(
driver
);
action
.
KeyDown
(
Keys
.
Control
).
SendKeys
(
Keys
.
F12
).
action
.
KeyDown
(
Keys
.
Control
).
SendKeys
(
Keys
.
F12
).
KeyUp
(
Keys
.
Control
).
KeyUp
(
Keys
.
Control
).
Perform
();
Perform
();
var
btn
=
driver
.
FindElementsByClassName
(
"loginBtn"
).
ToArray
().
Where
(
x
=>
x
.
Location
.
X
!=
0
&&
x
.
Location
.
Y
!=
0
).
FirstOrDefault
();
var
btn
=
driver
.
FindElementsByClassName
(
"loginBtn"
).
ToArray
()
.
Where
(
x
=>
x
.
Location
.
X
!=
0
&&
x
.
Location
.
Y
!=
0
).
FirstOrDefault
();
btn
.
Click
();
btn
.
Click
();
...
@@ -55,10 +54,19 @@ namespace CentralDispatcher
...
@@ -55,10 +54,19 @@ namespace CentralDispatcher
var
submit
=
driver
.
FindElement
(
By
.
XPath
(
"//button[@type='submit'][text()='Login']"
));
var
submit
=
driver
.
FindElement
(
By
.
XPath
(
"//button[@type='submit'][text()='Login']"
));
submit
.
Click
();
submit
.
Click
();
var
exp
=
driver
.
FindElementsByClassName
(
"loginBtn"
).
ToArray
();
// var findItem = driver.FindElement(By.Id("navSearchVehicles"));
// findItem.Click();
driver
.
Navigate
().
GoToUrl
(
"https://www.centraldispatch.com/protected/listing-search"
);
var
originRegion
=
driver
.
FindElementByName
(
"origin[region]"
);
var
selectOriginRegionElementAll
=
new
SelectElement
(
originRegion
);
selectOriginRegionElementAll
.
SelectByValue
(
"All"
);
var
destinationRegion
=
driver
.
FindElementByName
(
"destination[region]"
);
var
selectDestinationRegionElementAll
=
new
SelectElement
(
destinationRegion
);
selectDestinationRegionElementAll
.
SelectByValue
(
"All"
);
var
body_html
=
driver
.
PageSource
;
var
body_html
=
driver
.
PageSource
;
// }
// }
}
}
}
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment