robotframework

How to run headless REMOTE chrome using robot framework

随声附和 提交于 2019-12-18 11:44:31
问题 I'm trying to run chrome headless with my robot framework tests suites. I managed to do it independtly with python using selenium as follows: options = webdriver.ChromeOptions() options.add_argument('--headless') my_driver = webdriver.Remote(command_executer=my_remote_address, desired_capabilities=options.to_capabilities) The following code is what I did in robot but didn't work: ${options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver ${options.add

Centralizing XPath in resource file, how to pass arguement from robot file?

☆樱花仙子☆ 提交于 2019-12-18 09:35:10
问题 I am centralizing all particular XPath strings to a resource file and importing the variables in that resource file in my test suite (robot framework). This way, they can be maintained in one place and I can use variable names that make the robot file readable. Is that something that is good practice? Sometimes I want to pass an argument to the variable, to make it more dynamic. However, the value of the variable contains and XPath, which sometimes has //div[path...etc][text()='MyString'].

Selenium and Headless Environment

送分小仙女□ 提交于 2019-12-17 23:21:38
问题 I recently installed Python 2.7, Robot Framework and the Selenium Library (I still don't know if I succeeded though...) on a Red Hat Server to run some test on a web application. So I tried a simple test case using Robot Framework to see if Selenium Library is functional, just to Open a web page, nothing more... Selenium Server is up and running according to the result of ps, and Firefox binaries are in the PATH... Running the test case from the Robot Framework (with the pybot testcasename

Running tests on PyCharm using Robot Framework

烂漫一生 提交于 2019-12-17 15:52:26
问题 I started using PyCharm with the robot framework, but I'm facing an issue. How can I run my tests? All the time I right click on my tests folder, I get an Empty test suit message from the console log. Is there any way to run each test separately like right click on the test case and hit the test runner? This is my code: *** Settings *** Library Selenium2Library Resource /steps/keywords.txt *** Variables *** ${URL} http://www.google.com *** Keywords *** Open browser with URL [arguments] ${url}

Robot Framework File Upload getting element not reachable error

谁都会走 提交于 2019-12-16 18:04:26
问题 I know this has been answered previously. But I could not find any answer how do I get the locator for the pop up window. I am still getting error while uploading a file from local system to GUI. In my GUI I clicked on Upload arrow button by giving xpath Now File upload window pops up and I need to give a file name in the input field either from my desktop or any local path. - *****I am not sure how do I give locator for the input***** I used Choose File name:File name: C:/Users/xxxx/Desktop

How to perform Multi Device Tests on Android using the Robot Framework

谁说我不能喝 提交于 2019-12-14 03:08:23
问题 I am trying to launch my app on multiple mobile devices (emulators) using Robot Framework with Appium. I am using below keyword in different test cases.But still its launching app on one device only which comes first in the connected list : ${appium1}= Open Application ... http://localhost:4723/wd/hub ... platformName=${PLATFORM_NAME} ... platformVersion=${PLATFORM_VERSION} ... deviceName= emulator-5556 ... appPackage=${appPackage} ... appActivity=${appActivity} ${appium2}= Open Application .

List output are not getting recognize for custom library in robotframework when json library is used and list is mix with unicode character

橙三吉。 提交于 2019-12-13 23:11:26
问题 Here three file list.robot , code.json is input file , Library file compareLib.py when i run this program, it always return False , i am expecting true since 30 is present in list all file are present in same folder list.robot file *** Settings *** Library SudsLibrary Library JSONLibrary Library OperatingSystem Library compareLib.py *** Test Cases *** test json data1 # load file in json object ${json_obj}= Get file code.json ${obj}= evaluate json.loads('''${json_obj}''') json log ${obj} $

How can I open excel file through ride in robot framework

送分小仙女□ 提交于 2019-12-13 23:06:30
问题 How can I open excel file through ride in robot framework. I am trying to Open Excel keyword but I am keep getting error "No such file or directory". 回答1: You can follow my sample code below : *** Settings *** Library Selenium2Library Library ExcelLibrary *** Variables *** ${path_excel} res/my_excel_file.xls *** Test Cases *** Test1 Open Excel ${path_excel} 回答2: Also, another option if you prefer not to use a variable for the excel file -> Just store the excel file in the same folder as your

How to resolve “NameError: global name 'x' is not defined” error while running Robot Framework testcase using custom Library?

人走茶凉 提交于 2019-12-13 18:25:00
问题 I am seeing "NameError: global name 'x' is not defined" error while running Testcase in Robot Framework. Following is my custom Library file (Modified as per Bryan Oakley comments): import re def pass_fail_criteria(): if int(re.findall(r"NUM_FLOWS\n-+[\s\S]*?(\d+)\s*-+",x)[0]): return "pass" else: return "fail" Following is the "pass_fail.robot" file contents: *** Settings *** Library Selenium2Library Library SSHLibrary Library regexp_def.py Suite Setup Go to gmail page Suite Teardown Close

Import Java library in RIDE

痞子三分冷 提交于 2019-12-13 14:14:22
问题 I'm trying to use a java library in RIDE. I found a good tutorial( https://blog.codecentric.de/en/2012/06/robot-framework-tutorial-writing-keyword-libraries-in-java/) I follow it, but when the time comes to import and use the java library ( Database Library)in RIDE. It fails. When I look the page with my different imports, the java library is written in red and not in black as the others. And when I try to run with Jybot, I have the well-known message : [ ERROR ] Error in file 'C:\Users