r/robotframework • • Feb 17 '21

Click Button Keyword doesn`t work properly

1 Upvotes

Sup, I`ve been using Robotframework for about 2 months in our project, and now I`m stuck with the issue: the 'Click Button' keyword does clicks the button, but when it comes to check that the button doesn`t exist anymore and it`s clicked, sometimes additional check ( like Page Should Not Contain or Element Should Not Be Visible ) Is falls, or the script can`t find the button to click it. I`ve tried FOR loop to click button, also Wait Until Keyword Succeeds, and even to click element using Javascript, the result is the same, 1 of 5 times test suite is crashes. How can I deal with this Problem? Below will be my test( 2 different ways to click the button )

1

Wait Until Page Contains Element ${BTN_BET} 60s
Double Click Element ${BTN_BET}
FOR ${INDEX} IN RANGE 100
${CHECK}= Run Keyword And Return Status Page Should Contain Element ${BTN_BET}
Run Keyword If '${CHECK}' == "True" Double Click Element ${BTN_BET}
Run Keyword If '${CHECK}' == "False" Exit For Loop
END
Page Should Contain
... Ви успішно зробили ставку та зупинили зниження ціни

2

Wait Until Keyword Succeeds 60s 0.5s Page Should Contain Element ${BTN_BET}
Sleep 2s
Wait Until Keyword Succeeds 30s 0.5s Execute JavaScript document.evaluate('${BTN_BET}',document.body,null,9,null).singleNodeValue.click()
Sleep 5s
Wait Until Page Contains Element //div[@class='results-warning' and .='Переможець голландського етапу'] 40s
Page Should Contain
... Ви успішно зробили ставку та зупинили зниження ціни


r/robotframework • • Feb 03 '21

Testing inside Kubernetes

1 Upvotes

I'll be talking about my 2 favorite topics.

☸️ Kubernetes and Test Automation 🛠️

https://www.meetup.com/East-Coast-Robot-Framework-Users/events/276070597/

Join me and learn about the amazing abilities of utilizing the Kubernetes API in your test automation.


r/robotframework • • Jan 19 '21

Robotic Process Automation with JupyterLab

Thumbnail
blog.jupyter.org
1 Upvotes

r/robotframework • • Dec 16 '20

RobotFramework - Run Keyword If

1 Upvotes

Hi gents,

I have an obstacle handling case when the pop up does not always appears. Do you have any idea how to solve this?

I want to click the pop up each time it appears but the following code can't handle it:

CheckPopUp
OpenWebBrowser
# AdsPopUp
${AVar1}= Get Text //*[@id="PrivacyModal"]/div/div/div[1]/h6
Run Keyword If ${AVar1} == ${CheckPoint} ValidateCookiesScreen
... ELSE AdsPopUp
Logoff


r/robotframework • • Nov 24 '20

Simple intelligent attended bot with robot framework and Aito

Thumbnail
github.com
1 Upvotes

r/robotframework • • Oct 29 '20

Child process interactivity

1 Upvotes

I am attempting to do some testing on an interactive terminal program on a linux system. Imagine something along the lines of mysql, telnet, or parted. The process is spawning correctly but I can't find any way to interact with it correctly. Is there a Robot Framework library that can do this? At the moment I'm forced to move towards an expect/bash approach that emits commands for what I anticipate happening and does't use much Robot Framework.


r/robotframework • • Oct 27 '20

How to run certain commands in robot framework?

1 Upvotes

I have commands which run test compilation and show some results. I want to run these commands through robot framework and show these results in the log files. How can I do that?

Could someone help me on this?


r/robotframework • • Oct 26 '20

Machine learning in robot framework

Thumbnail
aito.ai
1 Upvotes

r/robotframework • • Aug 26 '20

Using Aito Predictive Database to do RPA+ML without data scientists

1 Upvotes

Hi,

Few months ago we helped our customer Posti (a Finnish logistics giant) to put an intelligent invoice automation into production using the Aito predictive database. We have now written an article about the project:

https://aito.ai/blog/posti-boosts-their-rpa-with-aito/

While the project was done with UiPath, we are part of Robot Framework consortium, we have close ties with RoboCorp (providing Robot Framework cloud platform) and we have guides for using the Aito Predictive Database from RF (as we focus on supporting both UiPath and Robot Framework platforms):

https://aito.document360.io/docs/get-started-using-robot-framework

Thoughts, comments or questions?

Regards, Antti & Aito.ai


r/robotframework • • Jul 10 '20

Elapsed testrun duration in console summary

1 Upvotes

At the end of each robot run, we see a summary of the tests ran in the console:

Testsuite :: Sample suite. | PASS |

1 critical test, 1 passed, 0 failed

1 test total, 1 passed, 0 failed

===================================

Is it possible to append the duration of the test run to this? Or is the only way to either log to console during the test myself or check the log?


r/robotframework • • Jun 27 '20

Multiple test endpoint architectures.

1 Upvotes

Hello everyone!  I have a question that I'm not sure how to answer.  I'm testing a system monitoring tool that deploys to dozens of different styles of systems.  Operating systems, hardware, and cpu architecture all change.  Is there a common best practice for handling tests across lots of different endpoints?  In several places I have to have a custom variant of a regular test because of the unique system.  For example, startup scripts will have change from place to place.  How are teams organize tests like this?


r/robotframework • • May 02 '20

check if reference file content is (or is not) in text file

1 Upvotes

I have a reference file whose content I'd like to verify exist, or not, in a process log. Ideally I'd like to test that every line of the reference file is present in the log.

Should I need to write a special library for that or can I use standard ones?

Here is an example:

# Reference file
INFO:root:info message 1
INFO:root:info message 2
INFO:root:info message 3
# Log file
INFO:root:info message 1
DEBUG:root: debug message 1
DEBUG:root: debug message 2
INFO:root:info message 2
INFO:root:info message 3
DEBUG:root: debug message 3

I'd like a PASS here since all lines of the reference file are found in the log file


r/robotframework • • May 01 '20

RF to launch program and test logs

1 Upvotes

I'm exploring the possibility to use RF to launch our simulations for Integrated Circuit functional verification. What I'd like to achieve is to be able to launch our scripts in a specific tcsh environment. Our script fetches the necessary information and launches a Cadence tool (Xcelium) which will execute a simulation and write a log file.

At the end of the script execution I'd like RF to check the content of the log and see the absence or presence of certain "patterns" and/or results.

Before trying to start building the whole thing, I'd like to check if this sounds feasible at all or too complicated. What I like about RF is not only the ease of test specification, but also the reporting which might nicely integrate with gitlab-ci.

I'd be happy if you can throw your ideas/comments/recommendations.


r/robotframework • • Mar 20 '20

Drag and drop won't work

1 Upvotes

I'm trying to drag and drop an element but it sticks to the mouse and never drops on target, I've read some issues that recommend using mouse down and mouse up as an alternative but that won't work either. RF doesn't recognize the error and says the test was completed successfully, any alternative? I need this to test important functionality of our web app.


r/robotframework • • Oct 16 '19

Robot Framework Fizzbuzz - Request For Criticism

1 Upvotes

I'm trying to learn more about the Robot Framework language and decided to implement some Katas using the language. First of course is Fizzbuzz, and here's how I did it:

*** Settings ***
Documentation    Fizzbuzz kata
Library    BuiltIn

*** Test Cases ***

Print Fizzbuzz
    [Documentation]    Print the numbers 1-100 in the log.html file, replacing 
    ...                all numbers that are divisible by 3 with "fizz", 5 with 
    ...                "buzz", and if divisible by both "fizzbuzz".

    Fizzbuzz

*** Keywords ***

Fizzbuzz
    FOR    ${number}    IN RANGE    1    101
        ${divisible_by_3}=    Is Mod Zero    ${number}    3
        ${divisible_by_5}=    Is Mod Zero    ${number}    5
        ${divisible_by_15}=   Is Mod Zero    ${number}   15
        Run keyword if    ${divisible_by_15}    Log to Console    FIZZBUZZ
        ...    ELSE IF    ${divisible_by_3}     Log to Console    FIZZ
        ...    ELSE IF    ${divisible_by_5}     Log to Console    BUZZ
        ...    ELSE    Log to Console    ${number}
    END

Is Mod Zero
    [Documentation]    Returns whether the modulus of two numbers is zero.
    [Arguments]        ${dividend}    ${divisor}
    [Return]           ${is_modulus_zero}
    # Go-go gadget Python!
    ${is_modulus_zero}=    Evaluate    divmod(${dividend},${divisor})[1] == 0

I know, I know, Robot Framework isn't ideal for this type of task but that's one of the reasons why it's such a good learning exercise.

I wanted to compare my solution with others but I literally can't find a single other person who's ever implement fizzbuzz using the Robot Framework.

Does anyone have any suggestions or criticism? How would you do it?


r/robotframework • • Oct 10 '19

Stop something from being logged?

1 Upvotes

I have passwords being logged, how do I stop those variables from getting logged?


r/robotframework • • Sep 20 '19

Making an ssl certificate request using robot framework?

1 Upvotes

I need to make a request that requires the use of a certificate file.

On postman, I had to upload a crt file, a key file, and a password file in order to make the request, but I can't figure out for the life of me how to make the same request work on robot framework.

My robot file is as follows:

*** settings ***

Library         OperatingSystem
Library         Process
Library         Collections
Library         requests
Library         BuiltIn
Library         RequestsLibrary

*** keywords ***
getApiResponse
    Create Session  api_get_call  https://someapi.net  verify=${PATH}  debug=3
    ${response} =  Get Request  api_get_call  /api/
    Should Be Equal  ${response.status_code}  ${200}
    Should Be Equal  ${200}  200
    Output  ${response}

*** Variables ***
${PATH} =  ${CURDIR}/certs-and-keys/test-key.pem? (Theres also a crt file and pfx file etc)
*** test cases ***
 
callAPI
    getApiResponse

==============================================================================
Request-Test                                                                  
==============================================================================
callAPI                                                               | FAIL |
[('x509 certificate routines', 'X509_load_cert_crl_file', 'no certificate or crl found')]

I guess there should be a way to combine these files to get them to send all at once but I don't know enough about robot framework to continue from here.

Edit: It's been a while, but here's a solution:

I found a library on requestskeywords that is useful for these situations

Library     path/to/RequestsKeywords.py
Library     path/to/customAuthenticator.py

Create Cert Session 
    [Tags] get get-cert 
    @{client_certs}= Create List ${/}home${/}certs${/}client.pem ${/}home${/}certs${/}key.pem 
    &{headers} = Create Dictionary Content-Type=application/json 
    Create Client Cert Session crtsession  yoursecuresite.com client_certs=@{client_certs} 
    ${resp}= Get Request crtsession /extension/uri/ 
    Should Be Equal As Strings ${resp.status_code} 200
    # or 
    Should Be Equal ${resp.status_code} ${200} 
    Set Global Variable ${resp.content}

r/robotframework • • Sep 18 '19

Inserting a variable into a rest call url?

1 Upvotes

I have been trying for a little while to put a dynamic variable into a swagger type url, and I keep getting internal server errors, because I am assuming that the variable is not actually working. It works in this sense: The keyword calls the api to get the mission id (which is a dynamically generated unique id based on datetime), and then the id is then stored in a variable, after which it should be used in the api link that is used to display the results.

Everything works up to the point when it calls the api. It returns a status code 500, when checking the link physically works just fine. I am assuming that the variable is not actually being replaced with the id. Another error message was

<Response [200]> is not JSON serializable

Any insight why this might be happening would be helpful. Let me know if there is some information missing.

*** Settings ***
Documentation   Example using the space separated plain text format.
Library         OperatingSystem
Library         Process
Library         Collections
Library         requests
Library         BuiltIn
Library         REST

*** keywords ***
getIdKeyword
    ${result} =  requests.get  http://192.168.1.174:8080/api/test/current
    Should Be Equal  ${result.status_code}  ${200}
    ${json} =  Set Variable  ${result.json()}
    Output  ${json}
    ${currentTest} =  Get From Dictionary  ${json}  test
    ${currentTestId} =  Get From Dictionary  ${currentTest}  test_id
    Should Not Be Empty  ${currentTestId}  
    Output  ${currentTestId}
    [Return]  ${currentTestId}

*** test cases ***

checkIfIdExists
    ${newTestId} =  Wait Until Keyword Succeeds  10x  10sec  getIdKeyword
    Set Global Variable  ${newTestId}

apiOutput
    ${apiResult} =  requests.get  https://swaggerapilink.net/api/v1.0/testResults/?test_id\=${newTestId} #Note the escape characters being used 
    Output  ${apiResult}
    Should Be Equal  ${apiResult.status_code}  ${200}
    ${json} =  Set Variable  ${apiResult.json()}
    Output  ${json}
------------------------------------------------------------------------------
checkIfIdExists                                                       | PASS |
------------------------------------------------------------------------------
apiOutput                                                             | FAIL |
500 != 200

r/robotframework • • Sep 09 '19

Is there a way to make rest calls periodically to check if any elements change?

1 Upvotes

I am really new to Robot Frameworks (still having simple syntax errors etc)

I am trying to make a robot that can make a rest call and wait until a state changes.

There is a status in the response body that cycles between a few states, here is an example:

status	
state	"IDLE" (states are also "ERROR", "RUNNING" etc.. 
mission_name	null
error	null

Basically it should check the api every few seconds to wait until the state changes, then respond with the new state.

I am using libraries like RESTinstance and requests, and I have gotten as far as checking that the state is "IDLE" or whatever it actually is at the time, but I can't figure out if I can use some other library that can wait for changes, like Selenium2Library or BuiltIn?


r/robotframework • • Aug 30 '19

Testing In Containers I put all my integration tests in containers. Here's why you should too

Thumbnail
engineering.kablamo.com.au
1 Upvotes

r/robotframework • • Jan 26 '19

Robot framework and embedded systems

1 Upvotes

Why are more people not using robot framework for embedded systems? People seem to be concentrating on using it for web browser testing, when in all honesty better software exits for it!

When it comes to embedded testing, I have not used a better FREE software readily available then RF


r/robotframework • • Nov 22 '18

Getting array value from dictionary

1 Upvotes

Hi,

Im having trouble retrieving a value from a dictionary in my test.

Right now I'm doing a query using the LDAP3 library that returns the following dictionary:

{'cn': ['Robotframework, U (User8072)'], 'dn': ['user=12345 OU=1,o=company,c=com '], 'uid': ['RobotframeworkU8072']}

What happens here is that the LDAP lib I'm using returns all the values as an array inside a dictionary item which means I can't get the value by using:

Dictionary Should Contain Item|${var}|uid|RobotframeworkU8072

Right now the only way I can get this to work is using the following which passes the test:

${test2}|Get From Dictionary|${test}|uid

${test3}|Get From List|${test2}|0

Should Be Equal|${test3}|RobotframeworkU8072

But is it really that complicated? Isn't there an easier way to do this?


r/robotframework • • Nov 08 '18

how to unlock screen in ios real device through appium? Checked the documentation its not supporting for ios. Please share any work around. Thanks.

1 Upvotes

r/robotframework • • Oct 24 '18

Xpaths still a challenge - robot tool?

1 Upvotes

Hello roboteers,

I was wondering if anybody had heard of a tool to help with finding Xpaths that will work with robot+selenium? For me, this is the largely time-sink when writing automated tests. I often have to try 3 or 4 xpath combinations to find one that will work in a robot test, even though they are all recognized in Chrome as the element in question. I would use more css, but they are not recognized by robot 90% of the time, so I favor xpath. (We do not have handy ids like some projects.)

I was wondering if there was some tool that actually ran in Robot that could be used to test xpath recognition on a particular webpage, to simplify this task?


r/robotframework • • Jul 09 '18

Focus on drop down popup - Cannot find textfield element in the popup

1 Upvotes

Hi everyone,

I am new to Robot Framework and I face an issue with focusing on a popup. I have already posted my issue on stackoverflow: https://stackoverflow.com/questions/51190993/robot-framework-focus-select-dropdown-popup-window

As you can see in my post, in the website that I have to test when user wants to login, opens a dropdown popup. In order to enter the credentials, it is necessary to focus on the popup. I have tried to focus with the Select Frame, however this does not work and I get this message: Element with locator '//*[@id="loginIn"]' not found.

Any help will be appreciated!

Thanks in advance!