-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-selenium.py
More file actions
42 lines (38 loc) · 1.85 KB
/
python-selenium.py
File metadata and controls
42 lines (38 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 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 TestUntitled():
def setup_method(self, method):
self.driver = webdriver.Chrome()
self.vars = {}
def teardown_method(self, method):
self.driver.quit()
def test_untitled(self):
self.driver.get("https://dev-ps-loadtest-dummy.pantheonsite.io/")
self.driver.set_window_size(1024, 700)
self.driver.find_element(By.CSS_SELECTOR, ".site-logo > img").click()
element = self.driver.find_element(By.LINK_TEXT, "Articles")
actions = ActionChains(self.driver)
actions.move_to_element(element).perform()
element = self.driver.find_element(By.CSS_SELECTOR, "body")
actions = ActionChains(self.driver)
actions.move_to_element(element, 0, 0).perform()
self.driver.find_element(By.CSS_SELECTOR, ".read-more:nth-child(4) > .read-more__link").click()
self.driver.execute_script("window.scrollTo(0,318.6666564941406)")
self.driver.find_element(By.LINK_TEXT, "Edit").click()
self.driver.find_element(By.LINK_TEXT, "Edit").click()
element = self.driver.find_element(By.LINK_TEXT, "Edit")
actions = ActionChains(self.driver)
actions.double_click(element).perform()
self.driver.find_element(By.ID, "edit-title-0-value").click()
self.driver.find_element(By.ID, "edit-title-0-value").send_keys("None his job guess expect. AD")
self.driver.find_element(By.CSS_SELECTOR, ".layout-region-node-footer").click()
self.driver.find_element(By.ID, "edit-submit").click()