robotframework

Selecting Readonly Datepickers by using RobotFramework and input date into it

左心房为你撑大大i 提交于 2019-12-13 03:47:14
问题 Here is a working solution for choosing a date from a datepicker using robot framework. Datepickers are basically input tags but some of them have an extra attribute "readonly" due to which it becomes difficult to add date into it. 1)First Check if datepicker is readonly or not. -inspect the page , locate the tag and check. if it is not read only we can directly use the below code to under previous day date. ${Yeterday_Date} = Get Current Date result_format=%d/%m/%Y increment=-1 day Input

Robot Framework - TypeError: string indices must be integers When Parsing Json

梦想与她 提交于 2019-12-13 03:27:17
问题 I am trying to parse an array of json, But I am getting the following error TypeError: string indices must be integers Json: { 'locationId': 'location1', 'name': 'Name', 'type': 'Ward', 'patientId': None, 'children': [{ 'locationId': 'location2', 'name': 'Name', 'type': 'Bed', 'patientId': None, 'children': [{ 'locationId': 'location3', 'name': 'Name', 'type': 'HospitalGroup', 'patientId': None, 'children': None }] }, { 'locationId': 'location4', 'name': 'Name', 'type': 'Hospital', 'patientId

Robot framework split string and put in to sheet excel

筅森魡賤 提交于 2019-12-13 01:50:49
问题 I want to split Transaction ID:211444 , i want to get only value = '211444' and put it into sheet excel ? anyone please help 回答1: Use OperatingSystem.py and String.py libraries: ${string} = Convert to String Transaction ID:211444 ${id} = Fetch From Right ${string} ID: append to file ids.csv ID:${id}\n encoding=UTF-8 回答2: This might be useful to you . may sure you have xlsxwriter installed in your python packages . else do pip install xlsxwriter Below is robotfile content which will pass the

How to execute Robot testcase from eclipse which takes command line list arguments as input?

我的梦境 提交于 2019-12-13 00:54:22
问题 I have written a Robot test case which takes input list from command line. I ran the test case from command line and it executed successfully. All the issue comes when i run the same script from Eclipse, the test case fails and gives a console message - 'List variable '@{list_of_vars}' has no item in index 0.' Below is my code - [Tags] TestCLI @{list_of_vars} Split String ${my_vars} Log @{list_of_vars}[0] Log @{list_of_vars}[1] Syntax used for executing test case from command line: python -m

How to pass a list as command line argument in robot framework.?

穿精又带淫゛_ 提交于 2019-12-12 17:21:42
问题 I am trying to pass a list as a command line argument to a robot script using -v option. Since this is not directly supported i am trying some workaround like, robot -v list_arg:a__b__c -E space:_ sample.robot This partly does the job as i can see space separated values when i log them onto console. Like a b c . However i am unable to iterate over all the list members using FOR.I only see one item("a b c") being iterated. Is there any other elegant way to pass Lists via command line in robot

Robot Framework - using User Libraries

可紊 提交于 2019-12-12 16:28:31
问题 i am facing difficulty when trying to run my tests. Here is what i did : Create a java project with one class which has one method called hello(String name) Exported this as a jar and kept it in the same directory where i keep my test case file. my Test case looks like this. Setting * * Value * * Value * * Value * * Value * * Value * Library MyLibrary Variable * * Value * * Value * * Value * * Value * * Value * Test Case * * Action * * Argument * * Argument * * Argument * * Argument * MyTest

pybot and robot command line

泪湿孤枕 提交于 2019-12-12 11:32:54
问题 I tried my best but I am not able to get an answer where I can find what are the difference between pybot and robot command line. Is this two different options to achieve the same task i.e. executing robot test suites/cases? Or there is a special rule that says when to use pybot and when to use robot command line to run a robot test cases. Please help me to understand this concept, an example will be very helpful. Thanks 回答1: pybot was the old way to run robot. It was a simple shell script on

How to apply if else condition for SikuliLibrary with RobotFramework?

梦想与她 提交于 2019-12-12 10:29:09
问题 I'm using SikuliLibrary with RobotFramework for automating windows desktop application. One case is like: sometimes you need to put login credentials sometimes not, So I have to apply if else condition for SikuliLibrary with RobotFramework? I mean if login screen appear then will put credentials otherwise not. as it is image based So, I'm unable to apply if else condition. 回答1: You could have the login executed unconditionally, in a Run Keyword And Ignore Error block, and continue if it (the

Use of “If statement” in robot framework

﹥>﹥吖頭↗ 提交于 2019-12-12 09:44:21
问题 How can we use if statement in robot framework. I would like to execute keyword only if it satisfies certain condition else it execute other code. 回答1: This is described in the Robot Framework User Guide under the section Conditional Execution, where it mentions Run Keyword If and Run Keyword Unless among other solutions. Documentation for these can be found in the documentation for the BuiltIn keyword library. Here is a brief example: *** Test cases *** | Example | | ${result}= | Set

How to display/log which node ran Selenium test session?

ぃ、小莉子 提交于 2019-12-12 04:58:26
问题 I am building a test automation framework using a grid configuration of Windows machines. Without going into too much needless detail, I'm running the tests off a server running Robot Framework with Selenium2Library, which runs the test session through a hub that selects a node based on the browser & OS I selected. Standard stuff, and it all works fine; however on occasion a test hangs or something unexplainable happens, and I'll want to RDP to the node that ran the test to see what's what.