我正在尝试提交输入(type =按钮).但我无法更新该值.任何帮助表示赞赏.我已附上下面的测试用例供您参考.
在这里搜索点击失败
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
import unittest, time, re,datetime,os,sys
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
def is_element_present(inst,selector,value):
try:
inst.find_element(by=selector, value=value)
return True
except:
return False
class Testing(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.implicitly_wait(5)
self.base_url = "http://new.ossmoketest.appspot.com/"
self.verificationErrors = []
def test_ing(self):
try:
driver = self.driver
driver.get(self.base_url + "/Apab4b39d4_09d7_11e1_8df9_139372201eeb/1/signin?forward=/%3F")
now = datetime.datetime.now()
start = time.clock()
for i in range(5000000):
try:
if is_element_present(driver,By.ID,"userid"): break
except: pass …Run Code Online (Sandbox Code Playgroud) 我试图在默认值为0.00的文本框中键入一个浮点数.但是它尝试获取附加而不是覆盖它.我尝试使用.clear()然后发送send_keys('123.00'),但它仍然会被追加.然后我尝试使用send_keys(Keys.CONTROL +'a','123.00').它仅更新0.00.
任何帮助都非常感谢.
有关详细信息.. URL:http ://new.ossmoketest.appspot.com userid:senthil.arumugam@mycompanyname.com - mycompanyname = orangescape(对不起,以避免垃圾邮件)密码现在不需要.点击购买订单...在形式请新产品和新价格...自动化的样品申请..谢谢