Commit aa1b1dd0 by Igor Salmanov

getting list lorries

1 parent 41c7c71a
Showing with 6 additions and 21 deletions
...@@ -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();
...@@ -57,19 +52,21 @@ namespace CentralDispatcher ...@@ -57,19 +52,21 @@ namespace CentralDispatcher
// 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 // open area date and pricing options
var dateAndPricingOptions = driver.FindElementById("page-date-pricing-chev"); var dateAndPricingOptions = driver.FindElementById("page-date-pricing-chev");
...@@ -80,41 +77,29 @@ namespace CentralDispatcher ...@@ -80,41 +77,29 @@ namespace CentralDispatcher
var readyToShip = driver.FindElementById("readyToShip"); var readyToShip = driver.FindElementById("readyToShip");
readyToShip.Click(); readyToShip.Click();
driver.Manage().Window.Size = new System.Drawing.Size(windowSize.Width, windowSize.Height); driver.Manage().Window.Size = new System.Drawing.Size(windowSize.Width, windowSize.Height);
// select "14 Days" item
// open list "paymentType" items // open list "paymentType" items
var paymentType = driver.FindElementById("paymentType"); var paymentType = driver.FindElementById("paymentType");
// paymentType.Click();
// select "All" item
var paymentTypeAll = new SelectElement(paymentType); var paymentTypeAll = new SelectElement(paymentType);
var optionTypeAll = paymentTypeAll.Options.Where(x => x.Text == "All").First(); var optionTypeAll = paymentTypeAll.Options.Where(x => x.Text == "All").First();
optionTypeAll.Click(); optionTypeAll.Click();
//paymentTypeAll.SelectByValue("All");
var readyToShipWithin = new SelectElement(readyToShip); var readyToShipWithin = new SelectElement(readyToShip);
// readyToShipWithin.SelectByValue("60 Days");
var optionReadyToShipWithin = readyToShipWithin.Options.Where(x => x.Text == "14 Days").First(); var optionReadyToShipWithin = readyToShipWithin.Options.Where(x => x.Text == "14 Days").First();
optionReadyToShipWithin.Click(); optionReadyToShipWithin.Click();
// open area date and pricing options // open area date and pricing options
var pageResultOptions = driver.FindElementById("page-results-options-chev"); var pageResultOptions = driver.FindElementById("page-results-options-chev");
pageResultOptions.Click(); pageResultOptions.Click();
// open area cargo options // open area cargo options
driver.Manage().Window.Size = new System.Drawing.Size(100, 900); driver.Manage().Window.Size = new System.Drawing.Size(100, 900);
var vehicleOptions = driver.FindElementById("page-vehicle-spec-chev"); var vehicleOptions = driver.FindElementById("page-vehicle-spec-chev");
vehicleOptions.Click(); vehicleOptions.Click();
driver.Manage().Window.Size = new System.Drawing.Size(windowSize.Width, windowSize.Height); driver.Manage().Window.Size = new System.Drawing.Size(windowSize.Width, windowSize.Height);
var btnSearch = driver.FindElementById("btnSearch");
btnSearch.Click();
var body_html = driver.PageSource; var body_html = driver.PageSource;
// } // }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!