Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function waitAndClick(locator, time) {
  2.     return driver.wait( until.elementLocated( locator ), time = 20000)
  3.         .then(element => element.click())
  4. }
  5.  
  6. function waitAndSendKeys(locator, value) {
  7.     return driver.wait( until.elementLocated( locator ),time = 20000)
  8.         .then(el => el.sendKeys(value));
  9. }
  10.  
  11.  
  12. waitAndClick( By.xpath( '//li/a[@href = "/newOrder/index" ]' ) )
  13.     .then(waitAndClick( By.id( 'SenderSelectButton' ) ))
  14.     .then(waitAndClick( By.xpath( '//div[@id = "filter_journal_cities_div"][1]//div/i[@class = "icon-remove"]' ) ))
  15.     .then(waitAndSendKeys( By.id( 'filter_journal_cities' ) , 'Полтава' ))
  16.     .then(driver.wait(until.elementLocated(By.xpath( '//li[@class = "browser_element_main active"]/a[1][ contains(text( ), "Полтава") ]' ))))
  17.     .then(waitAndClick( By.id( 'filter_journal_address' ) ))
  18.     .then(waitAndClick( By.id( 'address_ul' ) ))
  19.     .then(driver.sleep(1500))
  20.     .then(waitAndSendKeys( By.id( 'filter_journal_address' ), 'Ковпака' ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement