问题标签 [selenium2library]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1054 浏览

robotframework - 如何在没有输入类型=文件的情况下通过机器人框架上传文件

Selenium2Library 可以吗?关于在某种网站上使用像这样的上传上传文件http://www.dropzonejs.com/

0 投票
0 回答
1107 浏览

python - Creating selenium webdriver in python and using it in robotframework

So i am practically stacked. If you call the selenium2library keyword Open Browser a webdriver object instance will be created and placed in the browsercache(if i understand the functionality correctly). To this point i know how to acquire the created webdriver within a python class or script and use this webdriver with python-selenium commands. As Documented here Pass existing Webdriver object to custom Python library for Robot Framework

So i want to ask. We create,in a python script,a webdriver object with selenium.webdriver as documented here https://sites.google.com/a/chromium.org/chromedriver/getting-started

Is it possible now to use this webdriver object in robotframework-selenium2library's keywords? Also is it possible to use this webdriver with selenium-python scripts without passing it everytime as an argument? And how you do this?

0 投票
2 回答
5560 浏览

selenium - 在 RIDE(机器人框架)中添加 chrome web 驱动程序

我是机器人框架的新手。

我已将chromedriver.exe文件放在系统路径中。现在,当我在 RIDE 中运行脚本时,出现此错误:

WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

是否有任何其他方法可以在 RIDE 本身中设置路径?

更新:我的路径变量包括: C:\Driver\chromedriver.exe;

0 投票
2 回答
4978 浏览

python - 在带有 selenium2library 的机器人中使用的键“向下箭头”的 ASCII 码

请问,在使用 selenium2library 的机器人框架中,可以与关键字“PRESS KEY”一起使用的键“向下箭头”和“向上箭头”的 ASCII 代码是什么?我搜索了很多线程,尝试了很多组合(25、40 等等),但没有什么能真正模拟按下实际的向下箭头键。

我需要构造工作..我需要从下拉列表中选择一个值,但我找不到要单击的值,所以我想通过“向下箭头”键“滚动”到该值来完成。 .

谢谢你帮助我,我现在真的很迷茫!

0 投票
1 回答
875 浏览

selenium - Robot Framework - Selenium2Library - 使用边缘浏览器选择文件关键字

我创建了一个测试,用户将通过单击“选择文件”按钮将文件上传到网站。

我正在使用选择文件关键字,它在 Firefox 和 Chrome 中正常工作。当谈到 Edge 时,它​​只是坐在那里不响应。从而考试不及格。如果我查看生成的日志,但是它说关键字正确传递。(弹出的错误消息是停止测试继续 - 但 Edge 正在阻止关键字工作)

有办法解决这个问题吗?我需要让所有三个浏览器都使用这个测试。

仅供参考,这是我正在使用的线路:

0 投票
2 回答
701 浏览

selenium - Robot Framework - Selenium2library - 检查页面的 Favicon

我需要查看当前页面是否显示正确的标题图标。我们会根据您在网站上的位置更改图标,并需要对其进行检查。

我努力了

我们使用的 HTML 是:

关键字不起作用..还有什么我必须使用的吗?还是硒不支持进行这种测试?

0 投票
2 回答
1028 浏览

java - 在 RobotFramework 中扩展 selenium2library WebElement

我是 RobotFramework 的新手(实际上是为一个新的测试自动化项目评估它)。

过去,我总是使用 Java 和页面对象创建自己的小框架,但是这次我想知道是否可以使用现有的框架。我正在评估 Spock 和机器人框架。

我的要求是测试 web 应用程序、windows 对象和移动应用程序,所以 Robot 肯定比 Spock 更有优势。我也更喜欢 Python 而不是 Groovy。

我通常使用以下代码在我的框架中扩展 WebElement。我想知道是否可以在 Robot Framework 中做这样的事情。

到目前为止,Robot Framework 看起来不错,我也喜欢 python.. 但是我不知道我是否能够扩展 selenium2library 之类的库以拥有自己的自定义方法,就像我在上面的示例中在 java 中所做的那样。

0 投票
4 回答
4173 浏览

selenium - 如何在 XPATH 中使用变量,应在关键字或测试中设置哪个值?

我需要根据元素包含的值单击元素..但我想在测试运行或关键字定义中设置这个值(我猜最好的选择是在测试中)我应该怎么做?

包含 xpath 的变量应如下所示:

当我用“002”之类的实际数字替换变量时,此定位器有效,但我想让它更通用..

在关键字定义中,我像这样使用它:

在测试中我只调用关键字

我的问题是在哪里以及如何设置xpath 中使用的 ${second_number} 变量的变量值?PS:xpath 定义、关键字和测试都在单独的文件中,谢谢!

0 投票
1 回答
513 浏览

button - ExtendedSelenium2Library 中的单击按钮选择按钮非常慢

我正在使用“Click Button从”ExtendedSelenium2Library来选择登录页面上的登录按钮。

但是选择按钮需要超过 12 秒。使用Selenium2library它可以立即工作。我更喜欢使用 Extendedselenium2 而不是 selenium2。如何让它点击更快?

0 投票
1 回答
429 浏览

flash - 从 Selenium2Library 启动的浏览器的 .swf 播放器中出现“不支持此插件”错误

我在过去 2 年的项目中使用 Selenium2Library。此外,定期更新我的图书馆和浏览器。

最近,我遇到了一个问题,即 .swf 文件未加载到由 selenium 启动的浏览器中。我正在使用最新的 Chrome 浏览器“v54”和 Chrome 驱动程序 v2.25。

但是,.swf 在手动启动时会按预期加载(正常浏览器交互)。我相信缺少一些设置/配置。

快照: 在此处输入图像描述

我在此链接https://techhelpkb.com/this-plug-in-is-not-supported/中看到了一些解决方案,但没有运气

非常感谢这里的任何帮助。