我正在评估一些测试自动化框架,并希望得到一些意见.我们有一个大型的信用处理业务应用程序,它有三个端点:web ui,soap和基本的http/post.我的要求如下.
我们的QA非常习惯于数据驱动的测试(所有输入数据都来自excel,因此断言的预期结果也是如此).基本上,Excel工作表中的每一行都包含输入数据和相应的预期结果.我们希望我们的质量检查只需编辑Excel工作表.我们的开发团队将负责提供必要的测试库/夹具.鉴于上述情况,我想使用1个单独的自动化框架,可以读取这些excel表并测试我的应用程序的所有端点,即web ui,soap和http/post.请告诉我哪个测试自动化框架符合我的需求.感谢一些指导和教程让我开始.
我正在使用Robot Framework自动检查表中的TD或TR的数量.
我正在使用来自Selenium的Get Matching XPath Count关键字,但是它总是失败并出现错误.
我的示例HTML结构:
<table id="myTable">
<tr>
<td style="width: 50%">my td</td>
<td style="width: 50%">my td</td>
</tr>
<tr>
<td style="width: 50%">my td</td>
<td style="width: 50%">my td</td>
</tr>
<tr>
<td style="width: 50%">my td</td>
<td style="width: 50%">my td</td>
</tr>
<tr>
<td>Search me</td>
<td>Pagination here</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
我在XPath中使用关键字:.// [@ id ='myTable']/tr /td/@ width
因为我只想用"宽度"属性计算td.
和错误:InvalidSelectorException:消息:u"无效的选择器:无法找到具有XPath表达式的元素...
有解决方案吗 谢谢
当使用Jenkin插件进行Robot Framework时,指令声明我们需要强制机器人框架脚本从shell返回"exit 0".这不是一个非常明确的陈述.
有人能告诉我当测试成功时我们如何强制机器人框架返回"退出0".一个例子将非常有用.
以下是Jenkin维基的声明. 强制你的机器人脚本从shell返回"exit 0"成功返回以授权插件判断构建是否成功(默认情况下,当测试失败时,Robot会退出并显示错误代码)
谢谢.
在Robot Framework中,我们可以将列表分配给标量变量或列表变量,如下所示:
| @{list} = | Create List | a | b | c |
| ${scalar} = | Create List | a | b | c |
Run Code Online (Sandbox Code Playgroud)
列表变量和包含列表的标量变量之间有什么区别?
在我的机器人脚本中,在TEST Cases部分预设了总共10个测试用例.Test1是独立的,不需要一直运行; 一次执行就足够了.
请建议是否有关键字只会跳过testcase1.
但是,如果用户有兴趣运行包含的脚本testcase1,则用户必须在命令中指定类似的内容pybot <scriptname> "add testcase1".
testcase1
....
....
testcase2
....
....
testcase3
....
....
testcase10
....
....
Run Code Online (Sandbox Code Playgroud) 现在,我设置路径变量
path : D:..;C:\Program Files\Google\Chrome\Application
Chrome : C:\Program Files\Google\Chrome\Application\chromedriver.exe
Run Code Online (Sandbox Code Playgroud)
我可以Chrome在命令行中调用open .
但运行时出错 RIDE
失败:WebDriverException:消息:未知错误:Chrome无法启动:崩溃(驱动程序信息:chromedriver = 2.13.307647(5a7d0541ebc58e69994a6fb2ed930f45261f3c29),platform = Windows NT 6.1 SP1 x86)
testing google-chrome path robotframework selenium-chromedriver
我有一个页面,可能包含也可能不包含将影响所有xpath的特定元素.
我需要运行"Run Keyword If"来识别这个元素是否存在,如果存在则执行另一个关键字.
我试图将"Page Should Contain Element"和"Element should Be Visible"设置为变量并将其传递给If语句,但它只返回None.
我可以用什么来识别页面中的元素?
当我执行此关键字时,会显示"没有名称的关键字"和"找到的错误".
测试此关键字
[arguments] ${YearDiff} ${MonthDiff}
Run Keyword If ${YearDiff}>=0 and ${MonthDiff}>=0 Click Element id=Left_Calendar_Icon
Run Keyword If ${YearDiff}<=0 and ${MonthDiff}<=0 Click Element id=Right_Calendar_Icon
Run Code Online (Sandbox Code Playgroud)
如果我使用了错误的语法,请纠正我.
我有一个MyClass写在文件中的python类MyClass.py:
class MyClass(object):
def __init__(self):
self.myvar = list()
def setvar(self, val):
self.myvar = val
def mymethod(self):
return self.myvar
Run Code Online (Sandbox Code Playgroud)
我在Robot Framework中导入如下:
Library MyClass WITH NAME my_component
Run Code Online (Sandbox Code Playgroud)
我还有一个关键字,它调用传递给它的对象方法:
testing component
[Arguments] ${cmp}
log to console ************* ${cmp}
${result} = ${cmp}.mymethod
Run Code Online (Sandbox Code Playgroud)
我有几个从类实例化的MyClass对象,每个对象都有不同的属性.testing component无论对象本身如何,我都希望使用关键字获取其属性.
当我打电话testing component传球my_component:
Test Method Call
testing component my_component
Run Code Online (Sandbox Code Playgroud)
我明白了:
No keyword with name '${cmp}.mymethod' found.
Run Code Online (Sandbox Code Playgroud)
如果我在关键字中这样调用它testing component:
${result} = call method ${cmp} mymethod
Run Code Online (Sandbox Code Playgroud)
我明白了:
Object 'my_component' …Run Code Online (Sandbox Code Playgroud) 找不到Selenium这个元素:
<div class="import-file">
<input name="ctl00$MainContent$btnAttachment" type="button" id="MainContent_btnAttachment" class="button-norl img-upload-text b" value="???????">
<input type="file" name="ctl00$MainContent$fuAttachment" id="MainContent_fuAttachment" onchange="akUploadfile('[id$=fuAttachment]',$('[id$=hdnFileType1]').val());">
</div>
Run Code Online (Sandbox Code Playgroud)
我的机器人代码:
VA_M03_0108
[Tags] Carregis
Login.Input user name ${USER} ${PASS}
SendCar
Click Element id=ContentPlaceHolder1_rpt_search_lblCarReceiveDoc_0
Sleep 2s
Wait Until Element Is Visible id=UpdatePanel1 timeout=20s
Choose File id=MainContent_fuAttachment ${CURDIR}/???????.jpg
Run Code Online (Sandbox Code Playgroud)
机器人响应:
Element 'id=MainContent_fuAttachment' not visible after 20 seconds.
Run Code Online (Sandbox Code Playgroud)
有人,请帮帮我.这是UI:https://www.sendspace.com/file/kqerdt
robotframework ×10
selenium ×2
testing ×2
automation ×1
element ×1
fitnesse ×1
java ×1
list ×1
method-call ×1
object ×1
path ×1
python ×1
scalar ×1
variables ×1
xpath ×1