robotframework

Testcase level variables in [Documentation] for robot framework

五迷三道 提交于 2019-12-03 16:25:18
I cannot get test level variables to appear in documentation. Let's say I have this testsuite: | *Variables* | | ${SystemUnderTest} = | Staging | *testcase* | | Device Test | | | Set Test Variable | ${device} | iPhone | | [Documentation] | Device is: ${device} | | | ... | System is: ${SystemUnderTest} | | | No Operation That produces this log: TEST CASE: Device TestExpand All Full Name: T.Device Test Documentation: Device is: ${device} System is: Staging Notice that the Suite level variable is treated properly, but the test level one is not. How do I get all variables to be treated equally?

how to use “Run Keyword If” in robot framework

↘锁芯ラ 提交于 2019-12-03 15:35:25
I just started working on Robot Framework and I am trying to use Try Keyword If keyword, but all the examples I see online show the solution in a single line whereas I have columns and rows in RIDE. If I have a button with the ID of "Current Status" on the current page then I want to go to URL www.xyz.com and perform some action. The confusion is when I write Run Keyword If in the first cell of a test case in RIDE, what should I write in second column? Should this be the Page Should Contain ? or Page Should Not Contain ? Please let me know what information I am missing for above. Bryan Oakley

How to use User Keyword Arguments with default values in RobotFramework

不想你离开。 提交于 2019-12-03 15:13:25
Can someone explain me how to use default values for optional keyword arguments in connection with data-driven testcases? As you can see in my example not all default values are used in some cases: *** Test Cases *** | testArgs | [Template] | doSomething | | 111 : 222 : 333 : 444 | | xxx : 222 : 333 : 444 | xxx | | 111 : xxx : 333 : 444 | | xxx | | 111 : xxx : 333 : 444 | ${EMPTY} | xxx | | None : xxx : 333 : 444 | ${None} | xxx | | None : xxx : 333 : 444 | ${null} | xxx | | 111 : 222 : xxx : 444 | | | xxx *** Keywords *** | doSomething | | [Arguments] | ${expected} | ${arg1}=111 | ${arg2}=222

How to get All Text in robot framework ?

吃可爱长大的小学妹 提交于 2019-12-03 13:56:42
问题 Consider the following source code, <div id="groupContainer" class="XXXXXX"> <ul id="GroupContactListWrapper" class="list-wrapper"> <li class="contactNameItemContainer"> <div class="contactNameItem"> <span class="name">Name1</span> </div> </li> <li class="contactNameItemContainer"> <div class="contactNameItem"> <span class="name">Name2</span> </div> </li> </ul> </div> How do i retreive the two names (Name1,Name2) in a list variable ? I tried the following xpath for a "Get Text" keyword, but

execute robot keyword from python using robotframework api

拜拜、爱过 提交于 2019-12-03 13:10:06
问题 Writing complex robot keywords in robot language is sometimes very time consuming because robot language is not a real programming language. I would like to write my keywords in python and only expose simple html tables in robotframework language. The problem is that we already have a lot of low level robot keywords written in robot language (in .robot and .txt files). Is it possible to execute those keywords from the python code using the robotframework python api ? 回答1: Yes, it is possible.

Error: Opening Robot Framework log failed

醉酒当歌 提交于 2019-12-03 11:56:16
问题 If I open any .html file that generated by Robot Framework and try to convert it in any other format(for example, docx formate) using either any python code or inbuilt command line tool that are available. I am getting below error, Opening Robot Framework log failed • Verify that you have JavaScript enabled in your browser. • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended. • Check are there messages in your browser

How to test for blank text field when using robotframework-selenium?

浪尽此生 提交于 2019-12-03 11:28:45
How can I specify blank/empty value for a text field when using the robotframework-seleniumlibrary with a TSV file? For example, I have the following: Textfield Value Should Be identifier=name1 Chris Textfield Value Should Be identifier=name2 I want to test that name2 is blank. I have tried leaving it blank (which returns a message about an incorrect number of arguments. I have tried "", which looks for a pair of quotes, and '' which enters a single quote, and selenium seems to look for that janne You can use either a single backslash \ or special variable ${EMPTY} to create an empty string in

Is there a way to get Robot Framework to run test suites in a certain order?

半城伤御伤魂 提交于 2019-12-03 11:16:59
Suppose I have 2 test suites in the local directory, foo and bar, and I want to run the test suite in the order of foo then bar. I tried to run pybot -s foo -s bar . , but then it just goes and run bar then foo (i.e. in alphabetical order). Is there a way to get pybot to run robot framework suites to be execute in the order that I define? Robot framework can use argument files that can be used to specify order of execution ( docs ): This is from older docs (not online anymore): Another important usage for argument files is specifying input files or directories in certain order. This can be

How to set preferences for FireFox in Robot Framework

主宰稳场 提交于 2019-12-03 09:07:12
I'm trying to write a test case in robot framework to download an excel file automatically from a web-site. I want to set preferences for my browser using robot scripts to download files automatically in my desired destination directory without asking me! I have tried this solution ; but it didn't work. I also tried to set an existing firefox profile as this says which works fine, but I want to be capable of automatically adjusting preferences. Any idea? As @Sachin said I wrote a python script to set preferences for FireFox as well: from selenium import webdriver class WebElement(object):

Browser never opens when running Robot Framework tests from Jenkins

故事扮演 提交于 2019-12-03 09:04:06
I'm experimenting with running my RF/Selenium2Library tests from Jenkins on my OSX laptop. Jenkins is installed as default as user 'jenkins'. I have the RF plugin for Jenkins installed and environment variables set, and everything works fine EXCEPT the browser never opens (neither firefox nor chrome) and the tests fail with selenium timeouts saying that such and such element never appeared. My hunch is that I need to set a display variable somewhere to get the browser to open properly. Here's my 'execute shell' command from Jenkins for this project: source /Users/Shared/Jenkins/.bash_profile;