robotframework

Access Dictionary element inside the list in RobotFramework display error list object has no attribute

孤街醉人 提交于 2019-12-10 22:35:22
问题 Here is program code, I have one json file code.json which structure is like this : [ {key:value}, {key:value} ] When I convert list element into dictionary , it throws error *** Settings *** Library JSONLibrary Library OperatingSystem Library unicodelist.py Library Collections *** Test Cases *** test json data1 ${json_obj}= Get file code.json ${getfile}= evaluate json.loads('''${json_obj}''') json #getfile contain json of list with dictionary ${obj}= Convert To List ${getfile} log to console

Problem with SELECT from database if using unicode character

淺唱寂寞╮ 提交于 2019-12-10 20:44:07
问题 I'm using latest version of python and robot framework with DatabaseLibrary (https://franz-see.github.io/Robotframework-Database-Library/api/1.0.1/DatabaseLibrary.html) And I have problem with SELECT from database when I try using Unicode character like this: select * from labcamprodfull where PRODUCTNAME like '% ščť %' Then I execute/run test and i get this error: UnicodeEncodeError: 'ascii' codec can't encode character '\xae' in position 54: ordinal not in range(128) Here is my code: ***

How to trim or strip white spaces from a String while using Robot Framework

冷暖自知 提交于 2019-12-10 12:59:36
问题 How to trim or strip white spaces from a String while using Robot Framework If I have a string " Hello How are you " how to convert it to "HelloHowareyou" (stripping all the white spaces) 回答1: Also ${str.strip()} works. It uses the Extended variable syntax Example: *** Variables *** ${str}= ${SPACE}${SPACE}${SPACE}foo${SPACE}${SPACE}${SPACE} *** Test cases *** print string log ${str} # will be printed with spaces around it log ${str.strip()} # will be printed without spaces around it Run with

installing Autolit library

倾然丶 夕夏残阳落幕 提交于 2019-12-10 12:11:43
问题 I am writing robot tests for web testing using Google's Robot Framework with SeleniumLibrary (a test library) , one of my test involves uploading a file from the desktop by clicking on a"Browse" button on the webpage and using the windows file explorer window that pops up to navigate to and select the file ( providing a text path to file is disabled on the website for security reasons.) I have tried digging around but found little on automating this Windows File Explorer action , is there a

Robot Framework makes two instances from the class instead of one

落爺英雄遲暮 提交于 2019-12-10 12:03:03
问题 I have a python class: from robot.api import logger class TestClass(object): def __init__(self, arg1, arg2): self.arg1 = arg1 self.arg2 = arg2 logger.info('initialized', also_console=True) def print_arg1(self): print self.arg1 def print_arg2(self): print self.arg2 I have wrote a keyword file named "CommonKeywords.robot": *** Settings *** Library ../Libs/TestClass.py arg1 arg2 WITH NAME class1 *** Keywords *** print arg1 class1 class1.print_arg1 print arg2 class1 class1.print_arg2 And my

Running RobotFramework Tests on Sauce Labs - error with timing out

◇◆丶佛笑我妖孽 提交于 2019-12-10 11:50:41
问题 I have existing selenium tests written in Robot IDE Framework that I'm trying to run in Sauce Labs. I'm using the sample test from this tutorial to see if I can get at least one test running. http://datakurre.pandala.org/2014/03/cross-browser-selenium-testing-with.html The test passes locally, and passes all the tests on Sauce Labs, but then times out and gives and error, "Test did not see a new command for 90 seconds. Timing out. error" because it's not disconnecting Remote Web Driver. I've

Robot Framework - Run Firefox with system proxy

我们两清 提交于 2019-12-10 11:27:07
问题 Ok so I got this code: ${SERVER} http://www.google.pt/ ${BROWSER} firefox ${DELAY} 0 *** Keywords *** Open Browser To Google Open Browser ${SERVER} ${BROWSER} Maximize Browser Window Set Selenium Speed ${DELAY} After I run the keywords "Open Browser To Google", firefox opens and can't even open the url. I figured I'm missing my work office's proxy to access the external network. How can i configure the firefox webdriver to open with a proxy (being system-default)? Ty 回答1: Assuming you are

Robot Frame work in Linux

女生的网名这么多〃 提交于 2019-12-10 10:48:44
问题 How to get the status of the command which is executed in linux with the help of robot frame work. For example If use this: SSHLibrary open Connection (server) SSHLibrary login xxxxx xxxxx ${1111}= Write ${command} ${2222}= Read delay=5s In the above script how to get the status of the command I have executed and stored in the ${1111} var, Eg; If command executed pass the I have to get a status with 0 otherwise 1 回答1: You need to use Execute command instead of Write The SSHLibrary

How to Upload file from windows directory using selenium2library and Robot Framework

纵饮孤独 提交于 2019-12-10 10:01:56
问题 Can someone help me How to Upload file from windows directory using selenium2library and Robot Framework.I have tried using Choose File command in selenium2library but I am getting error as File doesn't exist in local file system.I am not sure whether directory path is not considered or any other issue. Please give me valid code or any alternate solution.Any help would be appreciated.Following is the command I have tried Choose file xpath = //input[@firmware-upgrade='firmware'] /Downloads

Import custom library from a different path in Robot Framework

ε祈祈猫儿з 提交于 2019-12-10 09:28:00
问题 I have several test files in different folders (for different issues) and I want to use a separate folder that will contain all the Custom Libraries I use. All of the sub folders, including the custom libraries, will be in one master folder. How do I import the test library from the separated folder? Here is the folder hierarchy: Test Library -Test Suite1 -test1.txt -test2.txt -Test Suite2 -test3.txt -Custom Libraries -customlibrary.py Thank you. 回答1: There are many ways. For one, just use