- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
那里有高级自动化人员吗?我正在使用 Python 和 SST 编写自动化脚本,但我遇到了 SST 的一些限制。我想从标准 Selenium 库中借用一个函数在我的脚本中使用,我在其中双击一行文本以突出显示它。我在脚本的开头使用 SST 创建了一个 webdriver 实例,并开始在网页上执行操作。我的问题是:有什么方法可以与 Selenium 函数共享该实例以执行此操作。我意识到我可以在 Selenium 中完成整个脚本,但我工作的公司致力于 SST,因此不会被接受。不过,如果我加入一个 Selenium 函数,我认为没有人会介意。由于 SST 是建立在 Selenium 之上的,我想一定有一个新的类已经编写好了,我可以导入它来执行这样的操作。我想要执行的代码如下所示。但是当然,当我用 Selenium 创建第二个 webdriver 实例时,会打开一个新的浏览器,然后脚本在逻辑上分成两半。有什么建议吗?
from sst.actions import *
from selenium import webdriver
from selenium.webdriver.firefox.webdriver import *
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import *
go_to('http:/yadayada.net/')
## perform a bunch of actions
text = ## get text element with SST
driver = webdriver.Firefox()
action = ActionChains(driver)
action.double_click(text)
action.perform()
最佳答案
要访问底层 webdriver,您需要引用:
sst.actions._test.browser
这是一个 SST 的例子直接使用 webdriver.Firefox
实例的脚本:
import sst.actions
# a regular SST action
sst.actions.go_to('http:/testutils.org/sst')
# now using webdriver directly
sst.actions._test.browser.get('http://www.python.org')
你问题中的例子可以写成:
from sst.actions import *
from selenium.webdriver.common import action_chains
go_to('http:/yadayada.net/')
## perform a bunch of actions
text = ## get text element with SST
driver = sst.actions._test.browser
action = action_chains.ActionChains(driver)
action.double_click(text)
action.perform()
关于python - 在 Python/SST 自动化脚本中使用 Selenium 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18130839/
我有一个 galera 集群 (10.0.27),有 3 个节点,每个节点位于一个专用服务器上。其中一台服务器重新启动后,该节点无法再加入集群,也无法执行完整的 SST。实际上,这就像 mysql “
我在运行服务一段时间后使用 RocksDBJava,我可以看到“打开文件太多”异常。通过深入研究门户上提到的上一个问题,我发现这是因为系统限制了打开最大文件数。当我检查rocksDB正在使用的目录时,
请记住,据我所知,Microsoft/Azure 认知服务的“语音服务”目前正在进行合理化工作 https://learn.microsoft.com/en-us/azure/cognitive-se
我试图关闭 DB 和它生成的所有打开的文件,但是 .sst 文件仍然打开。 什么是.sst 文件? (供 LevelDB 使用) 为什么我在关闭数据库后仍然看到它们? 谁/什么关闭了它们? 我想在运行
我正在尝试接受在我的网页上删除元素时弹出的 javascript 警告。当我使用 accept_alert() 或 dismiss_alert() 时,我收到了 NoAlertPresentExcep
我问这个问题有点傻,因为使用基本的 Selenium ,我保存屏幕截图没有问题,但使用 SST 我使用 take_screenshot('screenshot_name.png') 它告诉我应设置 r
我正在与 Kafka 合作,将数据保存到 RocksDB 中。 现在我想看看 Kafka 创建的数据库键和值。 我下载了 FastNoSQL 并尝试过但失败了。 该文件夹包含: .sst 文件 .lo
我正在使用具有 5 个节点的 Percona Xtradb 集群。我无法启动节点并面临以下错误。 我使用命令mysqld --console 来跟踪和查看这个错误。 WSREP: Failed to
那里有高级自动化人员吗?我正在使用 Python 和 SST 编写自动化脚本,但我遇到了 SST 的一些限制。我想从标准 Selenium 库中借用一个函数在我的脚本中使用,我在其中双击一行文本以突出
我在包含 5 个数据库的应用程序中使用 LevelDB。每个数据库都使用选项 max_open_files = 64 打开。 ulimit -Sn 显示操作系统有 1024 个文件的限制。将限制设置为
我确信有一个简单的解决方案,但请原谅我是 PXC 的新人。我正在使用 rsync 将引导节点的状态传输到 node2。 node2 是我要加入集群的节点。我最初尝试过 Xtrabackup,但遇到了一
我有来自 Microsoft 的 SST 文件,我需要将其添加到 java 信任库中。 问题是 Microsoft 提供的所有工具,将 SST 文件中的证书添加到 Windows 商店,因此很难从 S
要求:基于CentOS的Docker容器提供了MariaDB 10.x Galera集群 主机环境:OX X El Capitan 10.11.6,Docker 1.12.5(14777) Docke
我是一名优秀的程序员,十分优秀!