robotframework

Unable to scroll down the web page using the Robot Framework

六眼飞鱼酱① 提交于 2019-12-03 08:47:19
I am using Selenium 2 and Robot Framework to automate our application. I have used the below JavaScript code to scroll down the page but am not able to scroll. I want to enter text inside the text box after scrolling down, but I am receiving the exception: Element not visible The text box is partially visible on the screen by default, if we manually scroll down than its completely visible, But selenium robot framework unable to scroll down. I have tried: Execute JavaScript window.scrollTo(0,200) Execute JavaScript window.scrollBy(0,200) Execute JavaScript window.scrollTo(0, document.body

How to run specific test cases from a test suite using Robot Framework

最后都变了- 提交于 2019-12-03 08:27:42
问题 I am new to Robot and am learning to write logic and test cases. I have a test suite, "mytestsuite.robot", which has a lot of test cases. I have a couple of errors in one of my test cases. How do I run just that specific test case since I don't want to run the whole test suite again? File mytestsuite.robot testcase1 .... .... testcase2 .... .... testcase3 .... .... testcase4 .... .... Say test case 3 failed, and I want to just rerun test case 3. I tried to use: pybot mytestsuite.robot -t

Run a test case Multiple times and display the pass and fail count under test statistics

二次信任 提交于 2019-12-03 08:21:56
How to run a particular test case multiple times and display the pass and fail count under Test Statistics? Below is the current code I have to run a test case multiple times. (The test case is implemented in a keyword and called) *** Test Cases *** Testcase repeat keyword 5 Run Keyword And Continue On Failure Execute *** Keywords *** Execute log Hello world! The code is run from cmd using "pybot testcase.robot" This code runs the test multiple times but I'm not getting the final pass/fail count in the logs. I need to manually count the pass and fail test case repetitions. So what

How to disable loading external urls on seleniumlibrary/robotframework

最后都变了- 提交于 2019-12-03 08:14:20
I started playing with Seleniumlibrary tests (run with robotframework) and as our websites have ads and metrics and so on, every time I run a test those URLs get loaded. Is there a way to tell selenium/robotframework to not load certain types of URLs or prevent it to load external resources (i.e. everything that is not from localhost). You can do that with browsermob-proxy . Once you have that installed, you simply setup the proxy and set the blacklist. ProxyServer server = new ProxyServer(9000) server.start(); final DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities

Debugging robot framework python keyword libraries

别等时光非礼了梦想. 提交于 2019-12-03 07:07:43
问题 For learning purposes I want to follow the execution path in a robot framework python library. Actually the ssh library What is the best way to do this? I have looked at debug lib , which seems to provide me with the ability to set a breakpoint and spawn a new shell. However I want to examine the execution flow, the stack and the variable values set. Something like pudb but triggered via pybot. Is this possible? 回答1: You can use pdb with robot. How to do so is documented in the robot

IF ELSE in robot framework with variables assignment

无人久伴 提交于 2019-12-03 05:31:34
I need to execute some keywords conditionally in robot framework, but I dont know how to do it, it does not work. I tried many options, but I guess I have the "IF-ELSE" statement completely wrong.. Choose Particular Filter ${FILTER} And Uncheck All Values ${bool}= is filter opened ${AVAILABLE FILTERS} ${FILTER} ${uncheck_all_button}= run keyword if "${bool}" == "True" uncheck all in filter ${AVAILABLE FILTERS} ${FILTER} ... click element ${uncheck_all_button} ... ELSE ... Set variable ${particular_filter}: find particular filter ${AVAILABLE FILTERS} ${FILTER} ... click element ${particular

How to create a custom Python code library for the Robot Framework

╄→尐↘猪︶ㄣ 提交于 2019-12-03 04:52:35
问题 I already have Python source files for some custom tasks. Can I create a custom library of these tasks as keywords and use in the Robot Framework? 回答1: Yes, you can. This is all documented fairly extensively in the Robot Framework user guide, in the section titled Creating test libraries . You have a couple of choices. You can use your module directly, which makes every method in the module available as a keyword. This is probably not what you want since the library probably wasn't designed

Using Robot Framework for ATDD

只愿长相守 提交于 2019-12-03 03:17:35
问题 I would like to hear other people's experience with Robot Framework for automated acceptance testing. What are its major strengths and weaknesses as well as any comparison with other frameworks (mainly Fitnesse and Selenium)? The code that will be tested is real-time, legacy code, mainly in C++. 回答1: I have used Robot Framework at three different companies spanning about six years at the time that I write this, and all have been successful in one way or another. My experiences Company 1 The

Write to robot framework console from Python

浪尽此生 提交于 2019-12-03 00:44:35
I am a newbie using python and I wanted to ask for your help in showing me how can I print messages from Python into robot framework console. There are several ways for a python function to send information to the robot logs or to the console. These are all documented in the Robot framework user's guide, in the section titled Logging information . The cleanest way is to use the logging API , which gives specialized functions for various kinds of logging. For example, to send information to the console you would use logger.console(message) . Using the logging API Here is a library file that

How to make multi-lines test setup or teardown in RobotFramework without creating new keyword?

三世轮回 提交于 2019-12-02 23:22:19
I need to call two teardown keywords in test case but must not create new keyword for that. I am interesting if there is a such syntax for keywords as for documentation or loops for example: [Documentation] line1 ... line2 ... line3 Laurent Bristiel Use the " Run Keywords " keyword. From doc "This keyword is mainly useful in setups and teardowns when they need to take care of multiple actions and creating a new higher level user keyword would be an overkill" Would look like that: Test Case [Teardown] Run Keywords Teardown 1 Teardown 2 or also Test Case [Teardown] Run Keywords Teardown 1 ...