robotframework

Convert string to seconds - Robot framework

萝らか妹 提交于 2019-12-23 04:58:18
问题 I am getting a time stamp from a page using: || ${value}= | Get Text | //span[@class='time'] it is returning a value in this format "Apr 28, 2015 03:03 AM AST". I want to convert it to seconds so that I can compare the time stamp with another event that has occurred previously in my test cases. For previous event I have used the following and I am getting results in seconds: || ${secs} = | Get Time | epoch Please let me know which info I am missing in above and I will edit my question. I

How to run test cases using robot framework jar file?

霸气de小男生 提交于 2019-12-23 04:38:23
问题 I tried running the testcases by using robotframework-2.8.6 jar like below java -jar robotframework-2.8.6.jar testcases But Its not recognizing the selenium2keywords. How do I use the selenium2library with robotframework jar ? 回答1: The easiest (and most robust/enhanceable) way to use the robot framework jar file is through the maven plugin. (I'm assuming here that you have a maven runtime) Just create a pom file that uses the plugin and run it using mvn install Adding selenium 2 becomes just

Customized Execution status in Robot Framework

拈花ヽ惹草 提交于 2019-12-23 03:16:15
问题 In Robot Framework, the execution status for each test case can be either PASS or FAIL. But I have a specific requirement to mark few tests as NOT EXECUTED when it fails due to dependencies. I'm not sure on how to achieve this. I need expert's advise for me to move ahead. 回答1: There is nothing you can do, robot only supports two values for the test status: pass and fail. You can mark a test as non-critical so it won't break the build, but it will still show up in logs and reports as having

How to add a python module which uses Sel2Lib without getting multiple keyword error?

喜夏-厌秋 提交于 2019-12-23 03:13:05
问题 I'm trying to import a python module to ride for more than 3 hours with no success. I went through the steps explained in fourth answer here where it suggests to create a python module Selenium2LibraryExt. How to get All Text in robot framework ? the problem that i observe is that since i use Selenim2Library in my other codes of the same test now i import Selenium2LibraryExt which inherits from Selenim2Library, my test doesn't know anymore that e.g. Click Element keyword comesfrom

How to pass credentials to RESTinstance POST Request in robot framework?

我怕爱的太早我们不能终老 提交于 2019-12-23 02:38:24
问题 Python Code (Working fine): credentials = ("key","token") verify = False if not verify: from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) response = requests.post(url, auth=credentials, data=json.dumps(payload), headers={'content-type': 'application/json'}, verify=verify) status = response.status_code Robot Framework Code: I would like to duplicate same API testing in robot framework but i am stuck how to

Test an application behind a proxy server using Robot Framework and Selenium2Library

泪湿孤枕 提交于 2019-12-23 02:00:54
问题 I'm testing a web application behind a proxy server using both Robot Framework and Selenium2Library. In fact when the proxy is enabled in browser connexion setting , the keywords "Open browser" failed when I disabled the Proxy server option , the browser windows is getting opened but i am not able to visit the application. This happen with both IE en ff driver. I want to know if there is any additional configuration to solve this problem? 回答1: The Selenium2Library documentation gives an

NUMPAD 5 for right click on mac is not working using robotframework

本秂侑毒 提交于 2019-12-23 01:57:15
问题 I am using robotframework for automation of desktop application. I'm trying to do a right click on Mac Sierra and then use send keys to select the items generated on the context menu. I have activated mouse keys settings from the accessibility setting so that NUMPAD 5 will behave as a right click on mouse pointer. The problem is when I use this command it actually does a right click but when I try to use the send keys command the context menu disappears. So, I'm not able to select items from

Creating Soap messages with objectTypes using SUDS library in Robot Framework

不想你离开。 提交于 2019-12-23 01:52:52
问题 i am struggling to create this part of the soap message using robot framework with SUDS library. <ns1:Request> <ns0:ID objectType="SomeType">Value</ns0:ID> </ns1:Request> If i do like this, then i get all i need but not the objectType. ${object}= Create Wsdl Object ns19:RequestTypeSingle Set Wsdl Object Attribute ${object} ID 1234 Output <ns1:Request> <ns0:ID>1234</ns0:ID> </ns1:Request> If i check what my ns19:RequestTypeSingle wants i get this: ${object} = (RequestTypeSingle){ ID = (ID){

How to import java class, to Robot Framework like library

最后都变了- 提交于 2019-12-23 01:37:12
问题 I can't understand how to import .jar file, in Robot Framework. Here is the code: *** Settings *** Library MyLibrary *** Test Cases *** My Test Do Nothing Hello world and Java: public class MyLibrary { public void hello(String name) { System.out.println("Hello, " + name + "!"); } public void doNothing() { } } After Extracting in .jar, I put in C:\Python27\Lib\site-packages\MyLibrary and I created empty __init__.py file. After I execute my Robot file with: pybot TestJavaLibrary.robot I get

accessing static class variables with robotframework?

二次信任 提交于 2019-12-23 00:51:22
问题 Is it possible to access static class variables from a library loaded into robot framework? For example, say I include the following python library in my .robot file: foo = 'value' class MyClass(self): bar = 'value' Is there a way in the .robot file that included it to refer to foo or bar? 回答1: You can get at these by getting a reference to the raw python module with Get Library Instance, and then use extended variable syntax to get the values. For example, consider a library named MyLibrary