robotframework

Is there a way to keep the browser window open after the test execution in RobotFramework? [closed]

巧了我就是萌 提交于 2019-12-02 13:00:15
I am looking to keep the browser window open even after test execution. I would like to keep it open indefinitely. As of now , as a work around I am just using "Sleep" to keep the window from closing. Any help would be much appreciated. Thank you ! Simple - do not call Close Browser at the end. Ideally, the WebDriver service should stop once your script ends due to this code . However if you want Chrome and ChromeDriver to stay open afterwards, you can add the experimental option detach when initializing the chromedriver. Through Selenium-Python client you can: from selenium import webdriver

How to run a single test case using mvn robotframework?

允我心安 提交于 2019-12-02 11:57:10
I am trying to run a test case in robot framework using mvn robotframework. But when i do it runs all the testcases in the suite rather than a single testcase. I also tried to user robot testcase -testcase.robot. It is also giving error. Can anyone help regarding this ? You can assign run a test case by this command Lets say we have a directory called Tests inside that directory we have Test.robot which contains 5 different test cases "Login" "Register" "Delete User" "Update User" "Random Test" Tests | |_ Test.robot You can use the following command the execute a single test cases robot Tests

Accessing elements located by custom locator strategy with Javascript

心已入冬 提交于 2019-12-02 10:12:39
I have following issue: I have a checkbox which is hidden and there is another layer used to make it nice and shiny I can easily change its value by accessing its ID however I also need to access this element using my custom locator which uses xpath (that has to stay variable) So, here's my script: Custom Select Checkbox id=my_checkbox #that works fine Custom Select Checkbox customLocatorStrat #that doesn't work at all *** Keywords *** Custom Select Checkbox [Arguments] ${locator} ${timeout}=${global_timeout} Execute Javascript document.getElementById("${resultLocator}").checked = true; OR $

Xpath with combination of Preceding-sibling and following-sibling

限于喜欢 提交于 2019-12-02 09:44:26
I am trying to read the values from this screen( Sections appears dynamically it can be more than one). We have to read each field like Local Radios, MAC Address, Version from General Application Statistic and Default Geo Code from Legacy Configuration.. i got xapth to identify how many sections displayed. But unable to read the content under each section. i have to read them like key/value pair.. Due to the structure of html(Below) I am having tough time to write xpath between two section like ...General Application Statistics and Legacy Configuration <table class="tabletext"> <tbody> <tr>

Failed to compare images with Imagemagick with robot framework on Windows environment

岁酱吖の 提交于 2019-12-02 09:27:35
I am using Imagemagick to compare two screenshots in windows environment. https://blog.codecentric.de/en/2017/09/robot-framework-compare-images-screenshots/ *** Settings *** Library String Library OperatingSystem *** Variables *** ${IMAGE_COMPARATOR_COMMAND} C:\\"Program Files"\\ImageMagick-7.0.7-Q16\\convert.exe *** Test Cases *** Image Comparison Ok Compare Images C:/Users/user/imagecompare/Test/src/reference-screenshots/reference-1.png C:/Users/user/imagecompare/Test/src/test-screenshots/test-1.png 0.1 Image Comparison NOk Compare Images C:/Users/user/imagecompare/Test/src/reference

How to access microphone(camera) in robot framework?

帅比萌擦擦* 提交于 2019-12-02 07:32:48
I am working on robot framework where in i am not able to allow chrome camera allow popup from the browser. Please help on this or code will help a lot. Need to create webdriver with preferences which allows microphone (--use-fake-ui-for-media-stream) Similar question solution is explained here how to handle web based alert or pop ups in robot framework? Java or python related solution explained here How do i allow Chrome to use my microphone programatically? Snippet: Chrome With Preferences ${chrome_options} = Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver

How to get the css style of text-overflow in robot framework

你离开我真会死。 提交于 2019-12-02 07:08:19
How to get the css style of text-overflow in robot framework. For validating the ellipsis text. <td _ngcontent-c5="" class="fontStyle" data-placement="top" title="123456789123456789qwertyuiasdfghjklzxcvbnmasdfghjkqwertyuiasdfghjkzxcvbnmertyui"> 123456789123456789qwertyuiasdfghjklzxcvbnmasdfghjkqwertyuiasdfghjkzxcvbnmertyui </td> Getting a value of a CSS property is not supported in the SeleniumLibrary for Robot Framework. However, there is a method called value_of_css_property in the Selenium Python module that does exactly that. In order to call a method on an element the standard keyword

Robot Framework: Generating Unique Random number

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 20:28:32
I have to generate unique random numbers in robot framework. I have used "Generate Random String" to get random numbers. Command: ${random} Generate Random String 1 [NUMBERS]) I gave the above statement in a for loop. Now I am able to get 'n' random numbers. But they are not unique. How do I make them unique? Whats my case exactly: I want four unique random numbers ranging from 1 to 10. I am trying to give the generate random number command in for loop and in the second loop i am trying to compare it with first random value and so on. But this is not working. Is there any simple logic to get 4

How do you remove seconds and milliseconds from a date time string in python

泪湿孤枕 提交于 2019-12-01 17:53:37
How I can convert a date in format "2013-03-15 05:14:51.327" to "2013-03-15 05:14" , i.e. removing the seconds and milliseconds. I don't think there is way in Robot frame work. Please let me know if any one have a solution for this in python. Try this (Thanks Blender!) >>> date = "2013-03-15 05:14:51.327" >>> newdate = date.rpartition(':')[0] >>> print newdate 2013-03-15 05:14 In Robotframework the most straightforward way would be to user Split String From Right from the String library library: ${datestring}= Set Variable 2019-03-15 05:14:51.327 ${parts}= Split String From Right ${datestring}

How do you remove seconds and milliseconds from a date time string in python

守給你的承諾、 提交于 2019-12-01 17:48:26
问题 How I can convert a date in format "2013-03-15 05:14:51.327" to "2013-03-15 05:14" , i.e. removing the seconds and milliseconds. I don't think there is way in Robot frame work. Please let me know if any one have a solution for this in python. 回答1: Try this (Thanks Blender!) >>> date = "2013-03-15 05:14:51.327" >>> newdate = date.rpartition(':')[0] >>> print newdate 2013-03-15 05:14 回答2: In Robotframework the most straightforward way would be to user Split String From Right from the String