robotframework

Robot framework: Is there a way to write dynamic test cases?

喜夏-厌秋 提交于 2021-02-07 14:47:48
问题 I am pretty new to robot framework. I would like to create test cases dynamically without having a input key-value driven approach. Found some material that suggested the following: suite = TestSuite('Example suite', doc='...') tc = TestCase('Example test') tc.add_step(TestStep('Log', args=['Hello, world!']) suite.add_test(tc) I dont see add_step in test case class, Will continue to look around and see if there are any solutions. 回答1: The TestSuite object has a keywords attribute which itself

Unable to use Robot Framework custom library which has written using Python

*爱你&永不变心* 提交于 2021-02-07 08:48:30
问题 Created a sample Python script( Elements.py) with a function like below: from robot.api.deco import keyword @keyword("join two strings") def join_two_strings(arg1, arg2): return arg1 + " " + arg2 Then I have imported into Robot Framework script(.robot file) as a Library: *** Settings *** Library AppiumLibrary Library Selenium2Library Library BuiltIn #Here is the import of Custom Lib Library Elements.py *** Variable *** *** Test Cases *** Example that calls a Python keyword ${result}= join two

Unable to use Robot Framework custom library which has written using Python

与世无争的帅哥 提交于 2021-02-07 08:43:25
问题 Created a sample Python script( Elements.py) with a function like below: from robot.api.deco import keyword @keyword("join two strings") def join_two_strings(arg1, arg2): return arg1 + " " + arg2 Then I have imported into Robot Framework script(.robot file) as a Library: *** Settings *** Library AppiumLibrary Library Selenium2Library Library BuiltIn #Here is the import of Custom Lib Library Elements.py *** Variable *** *** Test Cases *** Example that calls a Python keyword ${result}= join two

How log the command output in the Robot framework log file after test execution?

大憨熊 提交于 2021-02-07 03:54:43
问题 In Robot Framework log.html, I want to log the command output that I am executing from a python file . As shown in the attached screenshot of log.html, now I am not able to see the command output. Simple it prints or logs as PASS. My Robot File: *** Settings *** Library test *** Test cases *** check test Python Keyword: def test(): cmd = ' net test" ' output = os.popen(cmd).read() match1 = re.findall('.* (successfully).*',output) mat1 = ['successfully'] if match1 == mat1: print "PASS::" Can

How log the command output in the Robot framework log file after test execution?

假如想象 提交于 2021-02-07 03:51:27
问题 In Robot Framework log.html, I want to log the command output that I am executing from a python file . As shown in the attached screenshot of log.html, now I am not able to see the command output. Simple it prints or logs as PASS. My Robot File: *** Settings *** Library test *** Test cases *** check test Python Keyword: def test(): cmd = ' net test" ' output = os.popen(cmd).read() match1 = re.findall('.* (successfully).*',output) mat1 = ['successfully'] if match1 == mat1: print "PASS::" Can

How log the command output in the Robot framework log file after test execution?

非 Y 不嫁゛ 提交于 2021-02-07 03:51:22
问题 In Robot Framework log.html, I want to log the command output that I am executing from a python file . As shown in the attached screenshot of log.html, now I am not able to see the command output. Simple it prints or logs as PASS. My Robot File: *** Settings *** Library test *** Test cases *** check test Python Keyword: def test(): cmd = ' net test" ' output = os.popen(cmd).read() match1 = re.findall('.* (successfully).*',output) mat1 = ['successfully'] if match1 == mat1: print "PASS::" Can

Inner nested class access from robot framework

℡╲_俬逩灬. 提交于 2021-02-05 11:15:11
问题 Robot - 3.1.1 Python - 3.7.3 I wanted to access method that are written in nested inner class from robot framework. Robot: *** Settings *** Library ../***/***/***/OrderList.py *** Keywords *** Click from order click_order Python: class OrderList(): pass class Ordertable(OrderList): def click_order(self): foo I am getting below error while running the above robot suite. No keyword with name 'click_order' found. If I move the click_order method under parent class (OrderList) like below, then

Inner nested class access from robot framework

独自空忆成欢 提交于 2021-02-05 11:14:46
问题 Robot - 3.1.1 Python - 3.7.3 I wanted to access method that are written in nested inner class from robot framework. Robot: *** Settings *** Library ../***/***/***/OrderList.py *** Keywords *** Click from order click_order Python: class OrderList(): pass class Ordertable(OrderList): def click_order(self): foo I am getting below error while running the above robot suite. No keyword with name 'click_order' found. If I move the click_order method under parent class (OrderList) like below, then

URL blacklisting with BrowserMobProxy in Robot Framework/Selenium?

喜夏-厌秋 提交于 2021-02-05 08:32:49
问题 I'm using RobotFramework with Selenium library for writing automated test cases for various websites. I've encountered an issue where due to slow loading from third-party URLs, some pages take forever to load and I want to block them to speed up test execution. However, I am stuck on implementing that solution via BrowserMob in Robot Framework. Can anyone help? So far, I have this code: Start Browser ## Init BrowserMob Proxy ${BMPATH} Join Path ${EXECDIR} browsermob-proxy-2.1.4 bin browsermob

URL blacklisting with BrowserMobProxy in Robot Framework/Selenium?

筅森魡賤 提交于 2021-02-05 08:30:51
问题 I'm using RobotFramework with Selenium library for writing automated test cases for various websites. I've encountered an issue where due to slow loading from third-party URLs, some pages take forever to load and I want to block them to speed up test execution. However, I am stuck on implementing that solution via BrowserMob in Robot Framework. Can anyone help? So far, I have this code: Start Browser ## Init BrowserMob Proxy ${BMPATH} Join Path ${EXECDIR} browsermob-proxy-2.1.4 bin browsermob