selenium2library

How do I use Click Element function with robot framework when the element does not have id or name?

青春壹個敷衍的年華 提交于 2021-02-18 12:46:09
问题 I'm currently using the Selenium2Library in robot framework to automate some web tests. Currently, I'm having problems automating the click of a login button with the Click Element function. This is the element I would like to use: <a class="transparentBtn loginLink ng-scope" ng-click="commonService.gigyaRaasLogin()" translate="BTN_ADMIN_LOGIN_WATCHLIST">LOGIN</a> and this is the xpath if I copy from the console: //*[@id="menu"]/div/div[5]/div/div/div[2]/ul/li[2]/a I have trouble finding

WebDriverException: Message: File not found - Close Upload FIle window in Robot Framework

时间秒杀一切 提交于 2020-01-07 03:53:24
问题 I need to close the File Upload window of a browser. I tried the following code to achieve this Press Key id=fileToUpload \\27 - I found the ascii character in the URL http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00000520.html My Complete code is *** Variables *** ${TVAURL} http://localhost:1500/ ${Browser} Firefox TC_01: Enter into the application [Documentation] Enter into the application to upload a file Open Browser ${TVAURL} ${Browser} Choose File id=fileToUpload C:/

Can't press enter in selenium2library

a 夏天 提交于 2020-01-03 06:37:59
问题 I'm trying to make a test that will open Facebook, log in and search something. However I'm having trouble getting Facebook to search. Selenium types whatever it needs in the search bar, but I can't find how to locate the search button or press the enter key. *** Settings *** Documentation Tell pui she bitch Library Selenium2Library *** Variables *** *** Test Cases *** User must tell pui she bitch open browser http://www.facebook.com set browser implicit wait 5 input text name=email *****

Can't press enter in selenium2library

自古美人都是妖i 提交于 2020-01-03 06:37:12
问题 I'm trying to make a test that will open Facebook, log in and search something. However I'm having trouble getting Facebook to search. Selenium types whatever it needs in the search bar, but I can't find how to locate the search button or press the enter key. *** Settings *** Documentation Tell pui she bitch Library Selenium2Library *** Variables *** *** Test Cases *** User must tell pui she bitch open browser http://www.facebook.com set browser implicit wait 5 input text name=email *****

How to reduce waiting time in Selenium2Library Robot Framework

谁说胖子不能爱 提交于 2020-01-01 16:49:09
问题 I have a test script in Robot Framework which I want to reduce its elapsed time. I have below command as a part of the test procedure: wait until element is enabled id=${elementId} In run time, it takes about 5 seconds to be done; I've set selenium implicit wait to 2 seconds using below line at the beginning of the test: set selenium implicit wait 2 seconds I get the applied selenium implicit wait afterwards with get selenium implicit wait and it returns 2 seconds , but the first command

How to use variable, which value should be set in keyword or test, in XPATH?

泪湿孤枕 提交于 2019-12-29 07:06:10
问题 I need to click on element based on what value it contains..but I want to set this value in test run or keyword definition (best option is in the test I guess) How should I do it? the variable containing xpath should look like that: ${DROPDOWN ITEMS} xpath=//*[contains(@class,'listitem-element')]/span[contains(text(),'${second_number}')] This locator works when I replace the variable with actual number like '002', but I want to have it more general.. In keyword definition I use it like:

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

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

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

Unhandled error “Cannot find context with specified id” using Robot framework

我们两清 提交于 2019-12-21 16:34:10
问题 I have a problem when working with iframe using Robot framework and Selenium2Library. It throws error: WebDriverException: Message: unknown error: unhandled inspector error: {"code":- 32000,"message":"Cannot find context with specified id"} (Session info: chrome=55.0.2883.87) (Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 6.1.7601 SP1 x86_64) My test code is: Fill In Description ${description} Wait Until Element Is Visible ${FRAME} 40