

#Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By

from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

class TestDefaultSuite():
  def setup_method(self, method):
    self.driver = webdriver.Chrome()
    self.vars = {}
  
  def teardown_method(self, method):
    self.driver.quit() #跑完代码自动退出
  
  def test_testsearch(self):
    self.driver.get("https://testerhome.com/")
    self.driver.set_window_size(1296, 696)
    self.driver.find_element(By.NAME, "q").click()
    self.driver.find_element(By.NAME, "q").send_keys("appium")
    #输入appium
    self.driver.find_element(By.NAME, "q").send_keys(Keys.ENTER)
    #回车
    self.driver.find_element(By.CSS_SELECTOR, ".result:nth-child(6) .number").click()
