robotframework

Elapsed time and result of a test in variables

不羁岁月 提交于 2019-12-25 16:25:33
问题 Is it possible to determine the elapsed time and the result of the current test in a variable? I'd like some tests to log their results external systems, and so ideally in [Teardown] I'd like to know: Elapsed Time of current test Result of the test Is that possible? 回答1: The listener interface provides an elapsed time in milliseconds, at the end of execution of each keyword, test, and suite. See the section titled Taking listeners into use in the user guide. Starting with robot framework 2.8

How access to 2 Web services with 1 Session? Robot Framework

99封情书 提交于 2019-12-25 16:10:45
问题 I have 2 Web Services from same web site, I have to access both with 1 Session Example: Create Soap Client ${CURDIR}\\SecurityServiceService.wsdl Set Proxies http ${PROXY} ${result}= Call Soap Method authenticateUserInternalSecurity ${USERNAME} ${PASSWORD} 1 #SecurityServiceService Create Soap Client ${CURDIR}\\DelinquentServiceService.wsdl Set Proxies http ${PROXY} ${result}= Call Soap Method getMultipleLovBei010 #DelinquentServiceService log ${result} delete all sessions With the Security

How to download a pdf file automatically in chrome browser using Robot Framework

风流意气都作罢 提交于 2019-12-25 16:08:55
问题 As a part of my test , i want to download a pdf file from browser automatically as soon as it loads on browser. Can someone guide me how this can be achieved.Following is the way that i have tried.I have tried clicking the download button but it didn't work for me. Following is the screenshot that appears on browser . *** Test Cases *** Download and deploy content package ${output}= Run keyword job history Log to console ${output} # create unique folder ${now} Get Time epoch ${download

Python Robot Framework Pass arguments to a function

不羁岁月 提交于 2019-12-25 10:01:06
问题 I try to use this method def my_click(self, locator, info="click on button error", timeout=5): element = self.wait_for_visibility(locator, info, timeout) element.click() def wait_for_visibility(self, locator, info="no error", timeout=10): return WebDriverWait(self.get_driver(), timeout).until( expected_conditions.visibility_of_element_located(locator), info) inside robot framework file Register Proper Data [Setup] Open Browser ${web-page} browser=${browser} my click (By.PARTIAL_LINK_TEXT,

Python Robot Framework Pass arguments to a function

若如初见. 提交于 2019-12-25 10:00:43
问题 I try to use this method def my_click(self, locator, info="click on button error", timeout=5): element = self.wait_for_visibility(locator, info, timeout) element.click() def wait_for_visibility(self, locator, info="no error", timeout=10): return WebDriverWait(self.get_driver(), timeout).until( expected_conditions.visibility_of_element_located(locator), info) inside robot framework file Register Proper Data [Setup] Open Browser ${web-page} browser=${browser} my click (By.PARTIAL_LINK_TEXT,

edit a JSON file in Robot Framework

喜夏-厌秋 提交于 2019-12-25 00:14:33
问题 I want to add driver=1 to my sample_json.json file but can't figure out a way to write these changes permanently. This code saves the key-value to the object ${json_obj} but does not make any changes to the file sample_json.json sample_json.json { "Phones": { "debug": "on", "phone1": { "key":"value" }, "phone2": { "key":"value" } } } Robot file *** Settings *** Library JSONLibrary *** Variables *** ${SUBSCRIBER_A} phone1 *** Test Cases *** testcase test ${SUBSCRIBER_A} *** Keywords *** test

Verify text in Robotframework

邮差的信 提交于 2019-12-24 20:27:05
问题 I am want to verify text of an element. How to verify text is one of many strings: Such as: "Login fail" , "Error login", "Attempt fail"... ? *** Keywords *** Assert Warning Message Element Should Contain id=session_key-login-error "Login fail" 回答1: So I would create a list with the element that are accepted and then make a command list should contain; Example: @{expected_results} Create List your_1_acceptance_criteria_element your_2_acceptance_criteria_element your_3_acceptance_criteria

Publish Robot Framework test results option is not available after successful installation of Robot Framework plugin in Jenkins

故事扮演 提交于 2019-12-24 19:15:52
问题 I've successfully installed Robot Framework plugin in Jenkins. I restarted the server. While configuring my project, Publish Robot Framework test results should be visible in Post-build Actions menu. But this is not the case. There is no such option exists to publish robot framework test results. Am I missing something here? 回答1: Jenkins assume that you have installed suggested plugins , before you go for Robot framework plugin . The definition of suggested plugins is not much clear and very

Using robotframework python libraries in mvn projects

六月ゝ 毕业季﹏ 提交于 2019-12-24 11:35:09
问题 I'm starting a new RobotFramework project, but I'm using the mvn plugin to manage the project. I want to add some python libraries (I have python installed on my computer), but when I try to run the project using the mvn run command, there are several errors related with the lack of python libraries installed. [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building robot-framework 1.0.0 [INFO] ---------------------

How to get the current URL in Robot framework?

自闭症网瘾萝莉.ら 提交于 2019-12-24 03:41:23
问题 When the 'apply' link is clicked, it opens a new browser in Robot framework. How to get current url of that page? Here is the code: Open Server Set Browser Implicit Wait 60 Go To ${server}/jobs Element Should Be Visible xpath=.//*[@id='txtjobsearch'] Input Text xpath=.//*[@id='txtjobsearch'] ${job Title search} Element Should Contain xpath=(.//*[@class='clearfix tit-job']/div)[1] ${Job title} Element Should Be Visible xpath=(.//*[@class='btn btn-sm btn-primary btnApply'])[1] Click Element