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 aa1b1dd0
authored
Mar 30, 2019
by
Igor Salmanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getting list lorries
1 parent
41c7c71a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
63 deletions
CentralDispatcher/Program.cs
CentralDispatcher/Program.cs
View file @
aa1b1dd
...
@@ -33,11 +33,6 @@ namespace CentralDispatcher
...
@@ -33,11 +33,6 @@ namespace CentralDispatcher
// {
// {
driver
.
Navigate
().
GoToUrl
(
titlePageUrl
);
driver
.
Navigate
().
GoToUrl
(
titlePageUrl
);
/*Actions action = new Actions(driver);
action.KeyDown(Keys.Control).SendKeys(Keys.F12).
KeyUp(Keys.Control).
Perform();*/
// find login button
// find login button
var
loginBtn
=
driver
.
FindElementsByClassName
(
"loginBtn"
).
ToArray
()
var
loginBtn
=
driver
.
FindElementsByClassName
(
"loginBtn"
).
ToArray
()
.
Where
(
x
=>
x
.
Location
.
X
!=
0
&&
x
.
Location
.
Y
!=
0
).
FirstOrDefault
();
.
Where
(
x
=>
x
.
Location
.
X
!=
0
&&
x
.
Location
.
Y
!=
0
).
FirstOrDefault
();
...
@@ -54,69 +49,59 @@ namespace CentralDispatcher
...
@@ -54,69 +49,59 @@ namespace CentralDispatcher
// push for authorization button
// push for authorization button
var
exp
=
driver
.
FindElementsByClassName
(
"loginBtn"
).
ToArray
();
var
exp
=
driver
.
FindElementsByClassName
(
"loginBtn"
).
ToArray
();
// redirect to find vehicles page
// redirect to find vehicles page
driver
.
Navigate
().
GoToUrl
(
findVehiclesUrl
);
driver
.
Navigate
().
GoToUrl
(
findVehiclesUrl
);
var
originRegionTypeSelector
=
driver
.
FindElementById
(
"originRegionTypeSelector"
);
originRegionTypeSelector
.
Click
();
var
destinationRegionTypeSelector
=
driver
.
FindElementById
(
"destinationRegionTypeSelector"
);
destinationRegionTypeSelector
.
Click
();
// find area originRegion
// find area originRegion
var
originRegion
=
driver
.
FindElementByName
(
"origin[region]"
);
var
originRegion
=
driver
.
FindElementByName
(
"origin[region]"
);
var
selectOriginRegionElementAll
=
new
SelectElement
(
originRegion
);
var
selectOriginRegionElementAll
=
new
SelectElement
(
originRegion
);
selectOriginRegionElementAll
.
SelectByValue
(
"All"
);
selectOriginRegionElementAll
.
SelectByValue
(
"All"
);
// find region area destinationRegion
// find region area destinationRegion
var
destinationRegion
=
driver
.
FindElementByName
(
"destination[region]"
);
var
destinationRegion
=
driver
.
FindElementByName
(
"destination[region]"
);
// select "All" item
// select "All" item
var
selectDestinationRegionElementAll
=
new
SelectElement
(
destinationRegion
);
var
selectDestinationRegionElementAll
=
new
SelectElement
(
destinationRegion
);
selectDestinationRegionElementAll
.
SelectByValue
(
"All"
);
selectDestinationRegionElementAll
.
SelectByValue
(
"All"
);
;
// open area date and pricing options
var
dateAndPricingOptions
=
driver
.
FindElementById
(
"page-date-pricing-chev"
);
// open area date and pricing options
dateAndPricingOptions
.
Click
();
var
dateAndPricingOptions
=
driver
.
FindElementById
(
"page-date-pricing-chev"
);
dateAndPricingOptions
.
Click
();
// open list "readyToShip" items
driver
.
Manage
().
Window
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
900
);
// open list "readyToShip" items
var
readyToShip
=
driver
.
FindElementById
(
"readyToShip"
);
driver
.
Manage
().
Window
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
900
);
readyToShip
.
Click
();
var
readyToShip
=
driver
.
FindElementById
(
"readyToShip"
);
driver
.
Manage
().
Window
.
Size
=
new
System
.
Drawing
.
Size
(
windowSize
.
Width
,
windowSize
.
Height
);
readyToShip
.
Click
();
driver
.
Manage
().
Window
.
Size
=
new
System
.
Drawing
.
Size
(
windowSize
.
Width
,
windowSize
.
Height
);
// open list "paymentType" items
// select "14 Days" item
var
paymentType
=
driver
.
FindElementById
(
"paymentType"
);
var
paymentTypeAll
=
new
SelectElement
(
paymentType
);
var
optionTypeAll
=
paymentTypeAll
.
Options
.
Where
(
x
=>
x
.
Text
==
"All"
).
First
();
// open list "paymentType" items
optionTypeAll
.
Click
();
var
paymentType
=
driver
.
FindElementById
(
"paymentType"
);
// paymentType.Click();
var
readyToShipWithin
=
new
SelectElement
(
readyToShip
);
var
optionReadyToShipWithin
=
readyToShipWithin
.
Options
.
Where
(
x
=>
x
.
Text
==
"14 Days"
).
First
();
// select "All" item
optionReadyToShipWithin
.
Click
();
var
paymentTypeAll
=
new
SelectElement
(
paymentType
);
// open area date and pricing options
var
optionTypeAll
=
paymentTypeAll
.
Options
.
Where
(
x
=>
x
.
Text
==
"All"
).
First
();
var
pageResultOptions
=
driver
.
FindElementById
(
"page-results-options-chev"
);
optionTypeAll
.
Click
();
pageResultOptions
.
Click
();
//paymentTypeAll.SelectByValue("All");
// open area cargo options
driver
.
Manage
().
Window
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
900
);
var
vehicleOptions
=
driver
.
FindElementById
(
"page-vehicle-spec-chev"
);
vehicleOptions
.
Click
();
var
readyToShipWithin
=
new
SelectElement
(
readyToShip
);
driver
.
Manage
().
Window
.
Size
=
new
System
.
Drawing
.
Size
(
windowSize
.
Width
,
windowSize
.
Height
);
// readyToShipWithin.SelectByValue("60 Days");
var
optionReadyToShipWithin
=
readyToShipWithin
.
Options
.
Where
(
x
=>
x
.
Text
==
"14 Days"
).
First
();
var
btnSearch
=
driver
.
FindElementById
(
"btnSearch"
);
optionReadyToShipWithin
.
Click
();
btnSearch
.
Click
();
var
body_html
=
driver
.
PageSource
;
// open area date and pricing options
var
pageResultOptions
=
driver
.
FindElementById
(
"page-results-options-chev"
);
pageResultOptions
.
Click
();
// open area cargo options
driver
.
Manage
().
Window
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
900
);
var
vehicleOptions
=
driver
.
FindElementById
(
"page-vehicle-spec-chev"
);
vehicleOptions
.
Click
();
driver
.
Manage
().
Window
.
Size
=
new
System
.
Drawing
.
Size
(
windowSize
.
Width
,
windowSize
.
Height
);
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