Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.91 KB | None | 0 0
  1. package bean
  2.  
  3. import org.openqa.selenium.By
  4. import org.springframework.test.context.ContextConfiguration
  5. import org.springframework.test.context.testng.AbstractTestNGSpringContextTests
  6. import org.testng.annotations.Test
  7. import spring.PageManager
  8. import spring.SpringConfiguration
  9. import ui.Page1
  10.  
  11.  
  12. @ContextConfiguration(classes = [SpringConfiguration::class])
  13. class TestBean : AbstractTestNGSpringContextTests() {
  14.  
  15.     @Test
  16.     fun tt2() {
  17.         val driver = PageManager.getDriver()
  18.         val page1 = PageManager.getPage(Page1::class.java, driver)
  19.         page1.open()
  20.         driver.findElement(By.xpath("(.//a[text()='В корзину'])[1]")).click()
  21.     }
  22.  
  23.     @Test
  24.     fun tt3() {
  25.         val driver = PageManager.getDriver()
  26.         driver.get("https://www.officemag.ru/catalog/goods/141409/")
  27.         driver.findElement(By.xpath("(.//a[text()='В корзину'])[1]")).click()
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement