robotframework

RobotFramework Selenium2Library and External Libraries- pass webdriver?

落花浮王杯 提交于 2019-11-29 15:57:21
I have created a Java library that utilizes an instance of Selenium Web Driver. I would like to run the test I have written with this library, as well as the Selenium2Library. In a way, the Java Library would add some functionality that I need (working with Ajax elements), but much of the test could be written with Selenium2 keywords. Is there a way to pass the webdriver instantiated in Selenium2Library to my external library so that they can run the same test? Thank you for your input! The current browser is stored in a WebDriverCache field that is protected. You could extend Selenium2Library

How to write a variable into a file?

梦想的初衷 提交于 2019-11-29 15:45:06
问题 I would like to store ${Username} value in an output file: E.g. If ${Username} equals 0401190926729000 , this value will be stored in a file. 回答1: Here is an proposal: *** Settings *** Library OperatingSystem Library String *** test cases *** write_variable_in_file ${Username} = Generate Random String 1 abc log to console ${Username} run keyword if '${Username}' == 'a' write_variable_in_file ${Username} *** Keywords *** write_variable_in_file [Arguments] ${variable} Create File ${EXECDIR}

How to handle prompt box with Robot Framework?

蓝咒 提交于 2019-11-29 15:43:36
问题 I am using Robot Framework with Selenium2Library for website tests automation. In one of the cases there is a prompt box (pop-up similar to alert, but with an input field in it, see example here) asking for some text. The problem is Robot Framework can only click OK or Cancel (Confirm Action and Choose Cancel On Next Confirmation keywords) on such pop-ups. So the question is: how can I input some text into the prompt box? Is it possible? In SeleniumLibrary there was a Press Key Native keyword

Robot framework installation issue for wxPython

爷,独闯天下 提交于 2019-11-29 08:59:38
I am trying to install robot framework but getting an error for wxPython version. When I type ride.py in cmd then an error message is shown: "C:\Users\snar13>ride.py Wrong wxPython version. You need to install wxPython 2.8.12.1 with Unicode support to run RIDE. wxPython 2.8.12.1 can be downloaded from http://sourceforge.net/projects/wxpytho n/files/wxPython/2.8.12.1/" I have done following steps: Installed python version 2.7, set an environment variable and verified in cmd by typing “python –version” with output “Python 2.7.12”. Installed Robot framework with PIP command i.e. “pip install

How to use variable, which value should be set in keyword or test, in XPATH?

爱⌒轻易说出口 提交于 2019-11-29 07:44:51
I need to click on element based on what value it contains..but I want to set this value in test run or keyword definition (best option is in the test I guess) How should I do it? the variable containing xpath should look like that: ${DROPDOWN ITEMS} xpath=//*[contains(@class,'listitem-element')]/span[contains(text(),'${second_number}')] This locator works when I replace the variable with actual number like '002', but I want to have it more general.. In keyword definition I use it like: Choose Value From Dropdown focus ${DROPDOWN ITEMS} click element ${DROPDOWN ITEMS} and in test I just call

How to write multiple conditions of if-statement in Robot Framework

强颜欢笑 提交于 2019-11-28 19:06:48
问题 I have trouble writing if conditions in Robot Framework. I want to execute Run Keyword If '${color}' == 'Red' OR '${color}' == 'Blue' OR '${color}' == 'Pink' Check the quantity I can use this " Run keyword If " keyword with one condition, but for more than one conditions, I got this error: FAIL: Keyword name cannot be empty. And also I would like to use these keywords: Run Keyword If '${color} == 'Blue' AND '${Size} == 'Small' AND '${Design}' != '${Simple}' Check the quantity And Run Keyword

Selenium and Headless Environment

这一生的挚爱 提交于 2019-11-28 17:39:15
I recently installed Python 2.7, Robot Framework and the Selenium Library (I still don't know if I succeeded though...) on a Red Hat Server to run some test on a web application. So I tried a simple test case using Robot Framework to see if Selenium Library is functional, just to Open a web page, nothing more... Selenium Server is up and running according to the result of ps, and Firefox binaries are in the PATH... Running the test case from the Robot Framework (with the pybot testcasename.tsv) I get an exception: ERROR: Problem capturing a screenshot to string: java.awt.AWTException: headless

Robotframework: Selenium2Lib: Wait Until (…) Keywords

爱⌒轻易说出口 提交于 2019-11-28 13:09:29
I am using Selenium2 w RF to test GUI of rather complex web application. Since I do get some fails with elements load, would like to know what are differences between keywords: Wait Until Element Is Enabled locator Wait Until Element Is Visible locator Wait Until Page Contains Element locator What is the scoope of each one and which keyword is most reliable in case, when I wanna check if element of the page is fully loaded and ready to use? Is there a keyword that checks if a full page is loaded? I don't know what you mean by "scope". They all work in the same scope. Wait Until Element Is

Nested loop in RobotFramework

家住魔仙堡 提交于 2019-11-28 11:52:32
问题 I need to create a nested loop in Robot framework. Can you please Help me do it? ${contents}= Get File ${file path} @{lines}= Split to lines ${contents} ${matched elements}= Get Webelements ${LABEL PORTAIL XPATH } : FOR ${element} IN @{matched elements} \ ${text}= Get Text ${element} \ : FOR ${line} IN @{lines} \ Run Keyword If '${text}' == '${line}' Log '${text} matched' I need to have a nested loop which compares all the ${text} with all the @{lines} in the file. Thanks in Advance 回答1: No

It errors when specifying the user defined java library into RED robot framework eclipse editor

那年仲夏 提交于 2019-11-28 11:50:41
问题 My requirement is to make use of user defined java libraries in robot framework using RED eclipse editor. When trying to specify library in the robot framework, the system errors as no such library available(shown underline in red for library name). Please correct my mistakes done. I have followed the below steps, Updated Eclipse with RED Editor(Eclipse Neon (v 4.6), RED - Robot Editor v0.7.5) Created a class file just as Project in the same eclipse. (Package name: org.robot.KCCKeywords and