omenia / robotframework-whitelibrary Goto Github PK
View Code? Open in Web Editor NEWLibrary for automating Windows GUI technologies with Robot Framework. WhiteLibrary wraps the White automation framework.
License: Apache License 2.0
Library for automating Windows GUI technologies with Robot Framework. WhiteLibrary wraps the White automation framework.
License: Apache License 2.0
Hi,
My code is as below:
Start Application
Launch Application ${TEST APPLICATION}
Sleep 20s
Attach Application By Name ssd
log done
${btoonOK}= Get Item text:OK
Input Text To Textbox ${btoonOK} nd
Instead of entering in the text box, m getting error as below:
AttributeError: 'NoneType' object has no attribute 'Get'
Pls advise.
Source distribution e.g https://files.pythonhosted.org/packages/f7/5e/d5cf3efdc50ee0f50c2ee211479f865db0dc941c4e42d94b5d36aca9e019/robotframework-whitelibrary-1.4.0.zip available from https://pypi.org/project/robotframework-whitelibrary does not include LICENSE file from the repository.
I assume, this could be fixed simply by adding LICENSE into MANIFEST.in before the next release.
Including LICENSE would help downstream vendoring.
The example on the keyword document like this:
@{my_buttons}= | Get Items | class_name:MyButtonClass
Click Button | ${my_buttons[2]}
I just use the same way like this:
@{my_edittext}= | Get Items | class_name:TEdit
Input Text To Textbox | ${my_edittext[1]} | 123
the log of execute
@{my_edittext}= | Get Items | class_name:TEdit",
is like this:
INFO : @{my_edittext} = [ Panel. AutomationId:6554104, Name:, ControlType:pane, FrameworkId:Win32 | Panel. AutomationId:2557884, Name:, ControlType:pane, FrameworkId:Win32 ]
So it means we got tow object of edit object.
But after execute
Input Text To Textbox | ${my_edittext[1]} | 123
It give me log:
FAIL : TypeError: Item object was not of the expected type
It should means that the object of index[1] is not the expected type.
python package information:
robotframework-whitelibrary 1.4.0
pythonnet 2.4.0.dev0 (may be the root cause?)
Needed keywords:
Listbox Should_contain
Listbox Should Not Contain
Combobox Should Contain
Combobox Should Not Contain
Describe the bug
Take Deskstop Screenshot
succeed but there is no img/link in the output.html when execute a test using Remote Server to a Windows VM
Not sure if it is a bug or a feature ?
To Reproduce
Execute below test agains a Windows 8.1
Expected behavior
Works as described
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Currently, screenshots taken by WhiteLibrary are stored in the Robot Framework output folder.
But I would like to be able to change this location when loading the library or via a new keyword Set Screenshot Directory
When loading:
Library WhiteLibrary screenshot_directory=${OUTPUT_DIR}/Screens
Via keyword:
Set Screenshot Directory ${OUTPUT_DIR}/Screens
This possibility is available in most other Robot framework libraries like the built-in Screenshot
library and SeleniumLibrary
.
Keyword for setting log level for White's console log. Argument level
, should accept values "info", "warn" and "debug" (case insensitive).
Instead of a separate keyword for setting log level, White's log level is automatically set according to the current log level of Robot:
Info
, Warn
and Error
messages logged at Robot's Info
levelDebug
messages logged at Robot's Debug
levelHi,
does this library depend on Python 3.x or am I missing some module(s)?
File "[...]\python-2.7.15\lib\site-packages\WhiteLibrary\WhiteLibrary.py", line 454, in _log_directory
return os.getcwdu() if PY2 else os.getcwd()
NameError: global name 'PY2' is not defined
Thank you and kind regards
Holger
I need keywords to check whether item is currently enabled or not like:
Item Should Be Enabled
Item Should Be Disabled
WhiteLibrary currently allows a window to be attached only by its exact title, it would be useful to have other strategies available as well.
Add missing keyword documentation for Launch application
.
The Keyword "Launch Application" fails with
TypeError: run_keyword() takes exactly 4 arguments (3 given)
This happens with versions 1.0.0 or 1.0.0.20181217.3.pre, with 0.0.0.20181204.3.pre everything was ok.
My setup is a bit complicated (White Library wrapped in PythonRemoteServer, tests run with Robot Framework Maven Plugin), but I believe the error also shows in a "normal" robot setup.
Robot Test file:
*** Settings ***
Library Remote http://127.0.0.1:8270
Suite Setup Starte Editor
Suite Teardown Beende Editor
*** Variables ***
${Nicht_speichern} CommandButton_7
*** Keywords ***
Starte Editor
Launch Application C:\\Windows\\System32\\notepad.exe
Attach Window Unbenannt - Editor
Beende Editor
#Close Application
# bei Close Application geht anscheinend die Verbindung zur Anwendung verloren, so dass man keine Aktionen mehr ausführen kann
Hold Special Key ALT
Press Special Key F4
Leave Special Key ALT
Sleep 1s
Click Button ${Nicht_speichern}
*** Test Cases ***
Hallo Welt
[Documentation] "Hallo Welt" in den Notepad-Editor schreiben
Input Text To Textbox 15 Hallo Welt
Verify Text In Textbox 15 Hallo Welt
Sleep 3s
I use the fix in run_keyword() takes 4 argument (3 given)
My code in Python:
from WhiteLibrary import WhiteLibrary
lib = WhiteLibrary()
w = lib.run_keyword('attach_window', ['XXX'])
Error:
File "C:\Python27\lib\site-packages\WhiteLibrary\keywords\robotlibcore.py", line 103, in run_keyword
return self.keywords[name](*args, **(kwargs or {}))
File "C:\Python27\lib\site-packages\WhiteLibrary\keywords\window.py", line 17, in attach_window
self.state.window = self.state.app.GetWindow(window_title)
File "C:\Python27\lib\site-packages\WhiteLibrary\keywords\robotlibcore.py", line 86, in getattr
.format(type(self).name, name))
AttributeError: 'WhiteLibrary' object has no attribute 'app'
Describe the bug
Install Whitelibrary
build step in azure pipeline emits following warning
2018-12-19T19:13:09.8057225Z C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'install_requires'
Now, setup.py explicitly imports setup from distutils here:
robotframework-whitelibrary/setup.py
Line 3 in 1a51307
Is your feature request related to a problem? Please describe.
Currently Left Mouse Button Down and Up keywords exist, but no similar functionality for the right mouse button exists.
Describe the solution you'd like
2 new keywords: Right Mouse Button Down and Right Mouse Button Up
Describe alternatives you've considered
Additional context
I need to be able to simulate a right click-and-drag
Describe the bug
Documentation is missing for the following keywords:
Item Should Be Enabled
Item Should Be Disabled
To Reproduce
see documentation
Expected behavior
N/A
Screenshots
N/A
This would allow clicking items at specified coordinates, currently items are clicked at their center.
I'd like to refer to tabs with index and/or get all tabs as a list.
Describe the bug
Normally the keyword input text to textbox
works fine, but I found a 'special' case in which it doesn't.
To Reproduce
Take the following test suite (you will need to change the locators to your local language):
*** Settings ***
Library WhiteLibrary
*** Test Cases ***
Open Notepad with WhiteLibrary
launch application C:/Windows/System32/notepad.exe
attach window Naamloos - Kladblok
sleep 3s # During this time, manually click twice on the start menu button so that it has the focus
# Now you will see that the next keyword fails (doesn't input the text) because it cannot 'grab' the focus
input text to textbox text:Teksteditor Hello World!
${text} get text from textbox text:Teksteditor
should be equal as strings ${text} Hello World!
click menu button text:Bestand
click menu button text:Afsluiten
click button text:Niet opslaan
If you execute this 'as is' it works fine. However, if you click twice on the Windows 10 start menu button so that it keeps the focus, you will find that the input text to textbox
doesn't enter any text.
Apparently this is because the keyword enters text by sending keystrokes to whatever element currently has the focus and when the start menu button has the focus, then for some obscure reason it cannot 'grab' the focus, but also doesn't fail because it simply sends keystrokes into the void.
Expected behavior
The text is entered into the control given by the locator, regardless of where the current focus is at.
Workaround
I can 'solve' this by explicitly setting the focus to the Notepad window. There isn't a set focus keyword (yet?), so I now do this by using mouse click 10 10
on the window.
Desktop
Windows 10 Enterprise 1703
Describe the bug
Excel crash when using close application
after opening a new empty workbook.
To Reproduce
Run the following test case:
Excel crash
launch application C:/Program Files (x86)/Microsoft Office/Office16/EXCEL.EXE
attach window Excel
click item AIOStartDocument
[Teardown] close application
Screenshots
This is what happens while executing the close application
keyword. Excel still closes, but this messagebox remains.
It says "Microsoft Excel has stopped working".
Desktop (please complete the following information):
Additional context
The same problem also happens on Word.
Describe the bug
Keyword call: Input Text To Textbox text=Auto-login username, text=riikka
Error: FAIL Keyword 'WhiteLibrary.Input Text To Textbox' expected 2 arguments, got 1.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No 'expected 2 arguments, got 1.' error
Screenshots
None
Desktop (please complete the following information):
Smartphone (please complete the following information):
None
Additional context
This call will PASS
WhiteLibrary . Input Text To Textbox id=1044, text=riikka
When e.g. keyword Window Should Be Minimized
keyword fails, the error message is: "Expected window state to be minimized, but found 0". The found state should either be removed or replaced with a better description.
Describe the bug
Scrollbars can't be found using WhiteLibrary so I can't use keyword set scroll position
.
To Reproduce
While I found this issue in our enterprise application, I used Notepad++ for this bug report because you should be able to reproduce it with that.
Open a file in Notepad++ so that you have a scrollbar and run the following script.
Test
attach application by name notepad++
${windows} get application windows
attach window ${windows}[0]
${scrolls} get items NonClientVerticalScrollBar
log list ${scrolls}
You will see that the list ${scrolls}
is empty, even though I got the AutomationID of the scrollbar directly from the Inspect.exe tool.
I also tried with all other locator strategies, but all of these yield an empty list when run using Robot Framework.
Describe the bug
Keyword press keys
doesn't work
To Reproduce
When I try to use the keyword press keys to simply send a string to the focus
Press keys Test string
I get the following error
AttributeError: 'NoneType' object has no attribute 'Keyboard'
Describe the bug
I have a code to uninstall the product. after uninstall is done, click on finish button. But white is not clicking always finish button.
To Reproduce
I am adding wait to view whether Finish button is enabled during the installation.
after it is enable i have used below code to click on Finish button
yeti.Click Object With Mouse xpath=//button[@name='Finish Enter']**
Expected behavior
It has to click on Finish button.
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Focus in going on to Finish button, but white is not clicking on the Finish button
Versatile Mouse handling like:
This probably needs to take mouse type into accout i.e. lefthand mouse / righthand mouse.
Add capability for Launch Application
keyword to accept (optional) arguments to start the process with.
Application consisting of more than one window requires this keyword when handling application close etc.
Describe the bug
I installed Robot framework - white library and it successfully installed but when i am trying to access white library in robot script , i am not able to use any keyword .I am using pycharm as my development environment.I tried with launch application and it threw me error:
No keyword with name 'LAUNCH APPLICATION' found.
Expected behavior
It should call the keyword after installing whitelibrary
Desktop (please complete the following information):
Additional context
Please acknowledge as i am not able to call even single keyword in whitelibrary
Describe the bug
Attached to Window is not working if keyword 'Launch Application' is not used. Should be able to use the keyword if the specific window is already open and no need to execute the script from the start.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should be able to execute the script without using keyword 'Launch Application'
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: Windows
Browser: None
Version: Windows 10
Additional context
This keyword will PASS without the dependency to 'Launch Application'
Describe the bug
When setting the timeout with keyword "set white find window timeout" the new value is used but not logged.
To Reproduce
Use the following keywords in a test:
set white find window timeout 10s
attach application by id <id>
attach window <non-existing window name>
Expected behavior
I expect to see the value that I had set in the report
Actual behaviour
Instead I see the default value of 30 seconds. See also the screenshot below.
Screenshots
In the screenshot you can also see that the logging of "set white find window timeout" is also off.
Current CI uses https://github.com/Omenia/robotframework-whitelibrary/blob/master/deploy.cmd to make build artifacts that are then released via release task in azure.
Build artifacts should be made via "setup.py" .. for example calling python setup.py sdist
and the collecting the zip file from dist/ folder ..
Hi,
I started to use the robotframework-whitelibrary.
Will the group support for the open issues.
How to get the details about the team who are actively using the library.
Is your feature request related to a problem? Please describe.
The problem is while trying to identify an object with two or multiple locators
Ex: I want to check the application for a button with text: Button1 and class_name: WinButton
Describe the solution you'd like
Ex1: Click Button text:Button1 && class_name:WinButton
Ex2: Click Button text:Button1 AND class_name:WinButton
Describe the bug
I am trying to automate outlook using robot white library. when i click new Mail , I am unble to attach to new mail winowd
To Reproduce
Steps to reproduce the behavior:
Launch application outlook
attach outlook windows
open new mail windows
try to attach to new mail
outlook test
Launch Application outlook.exe
sleep 15
attach window *******************
Click item text=New Email
#Attach Application By Name OUTLOOK
attach window Untitled - Message (HTML)
Click item text=To...
AutomationException: Couldn't find window with title Untitled - Message (HTML) in process 19264, after waiting for 30 seconds
at TestStack.White.Factory.ChildWindowFactory.WaitTillFound(Func`1 find, String message)
at TestStack.White.Factory.WindowFactory.CreateWindow(String title, Process process, InitializeOption option, WindowSession windowSession)
at TestStack.White.Application.GetWindow(String title, InitializeOption option)
at TestStack.White.Application.GetWindow(String title)
Using log levels as described in #121
WhiteLibrary seems to support syntax like type=value
with its locators similarly as SeleniumLibrary. The syntax is problematic, though, because it clashes with Robot's named only argument syntax as issue #48 demonstrates. The syntax was also considered problematic with SeleniumLibrary, and it has supported type:value
syntax since SL 3.0. For more details see robotframework/SeleniumLibrary#908.
In my opinion it would be good for WhiteLibrary to support the type:value
syntax as well. Because the library is still pretty young, I'd actually recommend deprecating the old syntax in the future to have only one syntax in the end.
Quite often user want's to start with maximal window. In addition resizing, move, minimize need to be tested as well. These options are now missing in white-library.
Hi,
I started to use robotframework-whitelibrary. But i have the performance issue while execute the below steps from the Robot framework.
I have grid control/Table with minimum of 200 Records. I have to iterate all the records each and every iteration.
Reproduce Steps:
Step 1 : I attach my existing application
Step 2: I used to find the table from the Automation Root element from separate project (Using UIAComWrapper). I haven't used the Teststack White API (It's not using the UIAComWrapper).
ISSUE:
Time Taken to findAll 200 Records ~40Sec. If i execute the Step 1 and Step 2 from Robot framework.
Time Taken to findAll 200 Records ~1Sec. If i execute the Step 2 at first and then Step 1 from Robot framework
Note: The issue is not only to the attach the existing application. Even at the launch of the new application.
Add new keyword get_item(locator) that returns the first matching item object.
Describe the bug
Attempting to install via pip
getting the following error about requirements.txt not existing
pip install -U robotframework-whitelibrary
Collecting robotframework-whitelibrary
Using cached https://files.pythonhosted.org/packages/ad/b5/cadcac69224c6b4c89144f850e22a5dbef81e12dcb731635788c46b6dce4/robotframework-whitelibrary-1.1.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "c:\users\jschne~1\appdata\local\temp\pip-install-fehdrm\robotframework-whitelibrary\setup.py", line 9, in
with open("requirements.txt", "r") as f:
IOError: [Errno 2] No such file or directory: 'requirements.txt'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\jschne~1\appdata\local\temp\pip-install-fehdrm\robotframework-whitelibrary\
Using python 2.7.14
RF 3.0.4
Windows 10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.