robotframework

How to make a POST (ReST) API in Robot framework with

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 08:14:42
问题 I need to replicate the below API call in Robot Framework: curl -X POST "http://xyz/api/createApp" -H "Content-Type:application/json" -d @/tmp/testfile.json testfile.json has a json payload. I cannot send the content of Json file as body. I have imported the HTTP libraries. But do not see any key-word to make an API call with file. 回答1: http://bulkan.github.io/robotframework-requests/#Post has files parameter. And what you could do is use Get File keyword from OperatingSystem library and pass

Multiple remote libraries with robot framework

一笑奈何 提交于 2019-12-19 04:18:14
问题 According to the example in the manual of 'Robot Framework', in order to provide keywords from a remote computer one has to instantiate RobotRemoteServer with an instance of the class implementing the Keywords RobotRemoteServer(ExampleRemoteLibrary(), *sys.argv[1:]) What if I have multiple libraries/classes which I want to be available remotely? Do I have to start a new server for each class? Is robot framework suitable for automated distributed testing, where multiple computers have to run

How to handle windows authentication popup in Robot Framework RIDE?

三世轮回 提交于 2019-12-19 04:05:08
问题 Windows authentication popup of my application appears similar to this app https://www.engprod-charter.net/ I had used below code to handle window authentication popup in selenium using python. from selenium import webdriver import time import win32com.client driver=webdriver.Firefox() driver.maximize_window() driver.get('https://www.engprod-charter.net/') shell = win32com.client.Dispatch("WScript.Shell") shell.Sendkeys("username") shell.Sendkeys("{TAB}") shell.Sendkeys("password@123") time

Is possible to create new variable in suite/test set up - Robot Framework?

旧街凉风 提交于 2019-12-19 03:10:59
问题 Is it possible to initialize a variable in a suite or test setup based on the return value of a keyword? I've tried this sort of syntax and it didn't work: *** Settings *** | Suite Setup | ${A variable}= | Set Variable | A String I know I can call keywords like "Set Suite Variable" but they don't allow me to set the variable to the result of another keyword. I used "Set Variable" in this example, but I want to be able to call any keyword here. 回答1: Strictly speaking, no, it's not possible.

Is possible to create new variable in suite/test set up - Robot Framework?

廉价感情. 提交于 2019-12-19 03:10:08
问题 Is it possible to initialize a variable in a suite or test setup based on the return value of a keyword? I've tried this sort of syntax and it didn't work: *** Settings *** | Suite Setup | ${A variable}= | Set Variable | A String I know I can call keywords like "Set Suite Variable" but they don't allow me to set the variable to the result of another keyword. I used "Set Variable" in this example, but I want to be able to call any keyword here. 回答1: Strictly speaking, no, it's not possible.

How to implement a java library in Robot Framework

拈花ヽ惹草 提交于 2019-12-18 18:37:54
问题 How can I create a library in Eclipse and then import it in Robot FrameWork? I am searching a lot now and none of the guides out to help me out. 回答1: You need to do the following: Create your java library Add it to the classpath when running robot framework jython edition Creating your java library: Define a new java class. At this point try not to use a constructor yet (although it is possible to support constructors with fields) Define the ROBOT_LIBRARY_SCOPE static String variable in the

Logging HTML requests in robot framework

拜拜、爱过 提交于 2019-12-18 18:12:42
问题 I have been struggling to find much information to go along with this so I have turned here for help. I am running UI tests of a web app using robot framework. When a test fails I want a log of the HTML requests so I can look back and see what failed, i.e. things not loading, 500 errors etc. To this point I haven't managed to find something within the robot framework or selenium? Another option is to see if there is a python library for logging this sort of thing or whether it would be a

How to include Java test libraries in a Python based Robot framework

空扰寡人 提交于 2019-12-18 18:05:25
问题 I am trying to get a Robot framework in place based on Python. On one side of the test block box is a Python simulator for which I have written test libraries to interact with. On the other side there is a Java library. I have the following questions on how to interact with Java classes from within the Python based Robot framework: Option A: Robot Framework (based on Python) includes both the Python test libraries and Java test libraries seamlessly. After reading through the Robot

aggregate the reports from different robot testsuites

混江龙づ霸主 提交于 2019-12-18 17:14:20
问题 I have different test suites in different directories. I use a script to run all these tests in one shot. Now I want to view the report of all these test suites in some aggregated way. What is the best way to aggregate these reports of different test suites(from different directories) in robot? 回答1: Robot comes with a tool called "rebot" for combining test results into a single report. For example, to combine "output1.xml" and "output2.xml" into a single log and report file, you would do

How to load a json data file into a variable in robot framework?

点点圈 提交于 2019-12-18 16:28:09
问题 I Am trying to load a json data file into a variable directly in Robot Framework. Can anyone please elaborate with an e.g. giving the exact syntax as to how to do it? Thanks in advance :) 回答1: One way would be to use the Get File keyword from the OperatingSystem library, and then use the built-in Evaluate keyword to convert it to a python object. For example, consider a file named example.json with the following contents: { "firstname": "Inigo", "lastname": "Montoya" } You can log the name