robotframework

How to check if an Android App is a device owner?

怎甘沉沦 提交于 2019-12-04 13:05:14
I am executing one test case using robot framework where I have to install an app and make it as device owner and then check if the same app has become a device owner or not. I have searched though Stack Overflow and other search engine results but there, they have mentioned on how to make an app as device owner but not the way how to check if an app is a device owner. I have used following command to make my app as device owner : adb shell dpm set-device-owner com.myapp.package/.main.receiver.DeviceAdminReceiver Now, I wanted to validate whether it is a device owner or now using ADB command.

How to pass objects to keywords in robot framework?

六月ゝ 毕业季﹏ 提交于 2019-12-04 12:18:43
问题 I have a python class MyClass written in file MyClass.py : class MyClass(object): def __init__(self): self.myvar = list() def setvar(self, val): self.myvar = val def mymethod(self): return self.myvar I have imported in Robot Framework as below: Library MyClass WITH NAME my_component I also have a keyword which call a method of objects which are passed to it: testing component [Arguments] ${cmp} log to console ************* ${cmp} ${result} = ${cmp}.mymethod I have multiple objects

Publish Multiple Robot Test Results From Jenkins Pipeline

拜拜、爱过 提交于 2019-12-04 08:14:30
I have a Jenkins 2.0 Pipeline script that runs a two separate suite of Robot tests. The script tries to publish both test suite results, however the publisher over-writes the first publish, with the last one. node('robot') { ... publishTestResults('journey') publishTestResults('regression') } void publishTestResults(String type) { step([ $class : 'hudson.plugins.robot.RobotPublisher', outputPath : 'portfolio-app\\target\\robot-output\\' + type, passThreshold : 100, unstableThreshold: 100, otherFiles : '', reportFileName : '*\\report*.html', logFileName : '*\\log*.html', outputFileName : '*\

Install wxPython 2.8 (For Ride) on OSX “El Capitan”

故事扮演 提交于 2019-12-04 07:56:25
问题 I'm trying to install wxPython 2.8 unicode version, to be able to use robotframework-ride. So far the installer downloaded from the site failed with an error saying "There was no software to install" And using Brew installs the 3.0 version, that is not compatible with ride. I would appreciate some help on this issue, I'm a new Mac user (just got given one at the office, and have to use it for my project) , and this is the only thing so far that I haven't been able to solve at all. The version

Modifying lists of lists in Robot Framework

老子叫甜甜 提交于 2019-12-04 07:44:13
I have a nested list that I am using in Robot Framework. I would like to change one item in a sublist at the Robot Framework level. My list looks like this: [ bob, mary, [june, july, august]] I want to change "july" to something else, say "september" Robot Framework will let me change 'bob' or 'mary', but if I try to insert a list, it is converted into strings. (Oh, I have tried to use the "Insert Into List keyword to insert a new sub list, and other List keywords, no luck with any.) I was able to achieve the modification with Collections library keywords like this *** settings *** Library

Is there a way to keep the browser window open after the test execution in RobotFramework? [closed]

可紊 提交于 2019-12-04 07:01:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 months ago . I am looking to keep the browser window open even after test execution. I would like to keep it open indefinitely. As of now , as a work around I am just using "Sleep" to keep the window from closing. Any help would be much appreciated. Thank you ! 回答1: Simple - do not call Close Browser at the end. 回答2:

Robot Framework: Generating Unique Random number

为君一笑 提交于 2019-12-04 04:40:33
问题 I have to generate unique random numbers in robot framework. I have used "Generate Random String" to get random numbers. Command: ${random} Generate Random String 1 [NUMBERS]) I gave the above statement in a for loop. Now I am able to get 'n' random numbers. But they are not unique. How do I make them unique? Whats my case exactly: I want four unique random numbers ranging from 1 to 10. I am trying to give the generate random number command in for loop and in the second loop i am trying to

How can a test called by Robot Framework return information to the console

南笙酒味 提交于 2019-12-04 03:51:44
I have a robot framework test suite that calls a python method. I would like that python method to return a message to the console without failing the test. Specifically I am trying to time a process. I can use "raise" to return a message to the console, but that simultaneously fails the test. def doSomething(self, testCFG={}): ''' Do a process and time it. ''' testCFG['operation'] = 'doSomething' startTime = time.time() response=self.Engine(testCFG) endTime = time.time() duration = int(round(endTime-startTime)) raise "doSomething took", duration//60 , "minutes and", duration%60, "seconds."

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

醉酒当歌 提交于 2019-12-03 20:58:17
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. 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 Code: # Keyword Metrics Code: (save following snippet as python file and execute) from robot.api import

IF ELSE in robot framework with variables assignment

爷,独闯天下 提交于 2019-12-03 17:13:05
问题 I need to execute some keywords conditionally in robot framework, but I dont know how to do it, it does not work. I tried many options, but I guess I have the "IF-ELSE" statement completely wrong.. Choose Particular Filter ${FILTER} And Uncheck All Values ${bool}= is filter opened ${AVAILABLE FILTERS} ${FILTER} ${uncheck_all_button}= run keyword if "${bool}" == "True" uncheck all in filter ${AVAILABLE FILTERS} ${FILTER} ... click element ${uncheck_all_button} ... ELSE ... Set variable $