robotframework

Can I get statistics for test cases steps inside robot framework?

自作多情 提交于 2019-12-05 07:58:52
问题 In order to optimize time of execution, i create some test cases dependent from each other i want to get metrics and statistics not only for each testcase and testsuite. But also i want to generate statistics and metrics for each step. Is that possible ? PS : I'm using team city for continuous integration. Best regards, Emna A. 回答1: Using robot framework api we can get TEST and KEYWORD Metrics Reference: Link API: class robot.result.model.Keyword class robot.result.model.Test Keyword Metrics

how to use “Run Keyword If” in robot framework

大憨熊 提交于 2019-12-04 23:51:07
问题 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 ?

Robot Framework data-driven automation testing: Can data derived from a database be used as a data source for a test template?

你。 提交于 2019-12-04 23:26:44
I am familiar with using template keywords in data-driven Robot Framework testing and know that external sources of data such as text files and csv files can be used to provide test data. However, the organisation I work for wants to use data held in a database as a source for test case data. Does anybody know if this is possible? I have searched Stack Exchange, Stack Overflow and other resources but cannot find an answer or any examples. Here is an example of the data-driven approach I am familiar just to give you an idea of where we are now. *** Settings *** Library Selenium2Library Library

Saving class objects in robot framework

狂风中的少年 提交于 2019-12-04 22:45:53
I am new to Robot Framework. I am writing my own library to work with Robot and I want to save the class object. I want the object to be created and saved once at the suite setup and keep using that same object for the entire test suite. Is there a way to do that? Aristalibrary.py import pyeapi active_conn = None class AristaLibrary: def __init__(self, proto="https", hostname='localhost', username="admin", passwd="admin", port="443"): self.hostname = hostname self.proto = proto self.port = port self.username = username self.passwd = passwd def connect_to(self, proto, hostname, username, passwd

How to handle dynamic elements using Robot Framework

不羁的心 提交于 2019-12-04 22:26:08
I am currently working on the Robot Framework and using Selenium2Libraries to work on a Web Application. I'm working on a Form and I'm dealing with a dynamic elements which is an editable text area and drop down list.. I really hope someone would be able to guide me on how I can do this. An example of what I am doing is, [Example element code] input id="textfield-1237-inputEl" class="x-form-field x-form-text x-form-text-default x-form-focus x-field-form-focus x-field-default-form-focus" data-ref="inputEl" size="1" name="textfield-1237-inputEl" maxlength="200" role="textbox" aria-hidden="false"

How to use robot framework with python in eclipse and How to run the Robot framework tests in eclipse using python interpreters?

霸气de小男生 提交于 2019-12-04 22:09:07
I have installed robot framework plugin into my eclipse. I have added python plugins and interpreter in the path, python files are executing successfully. I have added built-in library index file in the project, created robot text file and i want to execute the test but i right click on the test and try to run as, it is not giving the run configurations. I tried F9 for execution but it is not working. I think there is the separate set up required for running the robot tests in eclipse. my project we don't have access to Maven and client doesn't want Maven. Please let me know how to execute the

Set auto download preference profile using selenium2library

寵の児 提交于 2019-12-04 20:01:57
Environment: robotframework-selenium2library I am looking for a way in selenium2library to make the auto-downloading the file by setting the preference in FirefoxProfile as this is the solution I can find. However, it seems that I can not use the way I listed as following in selenium webdriver to import the preference profile into the browser in selenium2library. Using selenium webdriver: fp = webdriver.FirefoxProfile() fp.set_preference("browser.download.folderList",2) fp.set_preference("browser.download.manager.showWhenStarting",False) fp.set_preference("browser.download.dir",getcwd()) fp

Multiple devices connected error in Robotframework

我的未来我决定 提交于 2019-12-04 19:48:33
I am using Robot Framework with UI-Automator for automating Native Android application. In my current instance I have connected two devices to my PC- one for my general testing work and in the second device, I am running Automation. I have given serial of the device while running the test cases. But I am getting following error in the console: EnvironmentError: Multiple devices attached but default android serial not set can somebody help me what I need to do. The answer is on the documentation for the Set Serial keyword, on uiautomatorlibrary.html , below: Set Serial android_serial Specify

setup pythonpath before starting test suite

血红的双手。 提交于 2019-12-04 19:37:27
Currently I am setting pythonpath as pybot --pythonpath ~/Test_suite main.robot while running the tests. I also see there is option Set Environment Variable PYTHONPATH ${CURDIR} to set through robot framework. But it doesn't run before main settings *** Settings *** Documentation Suite description Resource settings.robot And below is settings.robot file *** Settings *** Resource keywords/keywords_test.robot Library tests.test_1.TestClass How to setup the pythonpath before running the suite? You can't do what you want. The settings are all processed before any test or keyword is run. You can

Robot Framework: log messages sent through log4j's ConsoleAppender are not visible in output

寵の児 提交于 2019-12-04 19:10:21
I use Robot Framework with custom keywords implemented in java libraries. Messages written directly to System.out from my java classes are visible in the robot output - as promised in documentation. However, since the keyword implementations are reusable components, independent from robot framework, I wanted to have more flexible logging there and not using System.out directly. I thought if I redirect my log output to System.out (with log4j's ConsoleAppender), the messages will be visible in robot output. Unfortunately it does not work. My log4j properties file: log4j.appender.Stdout=org