Code Monkey home page Code Monkey logo

robotframework-whitelibrary's People

Contributors

eeromakiesko avatar eeter avatar isnogood avatar jarmake avatar juhaalhonen avatar kompakti avatar mmokko avatar rasjani avatar tfrisk avatar tkortepo avatar vade5g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robotframework-whitelibrary's Issues

'NoneType' object has no attribute 'Get' error while input text.

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.

Can‘'t find the correct element in "Input Text To Textbox" keywordk

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?)

Take Desktop Screenshot not work on with Remote Server to a Windows VM

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
2019-01-31 16 03 49

Expected behavior
Works as described

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 8.1

Add possibility to set custom screenshot directory

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.

Set White log level according to Robot log level

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:

  • White's Info, Warn and Error messages logged at Robot's Info level
  • White's Debug messages logged at Robot's Debug level

NameError: global name 'PY2' is not defined

Hi,

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

TypeError: run_keyword() takes exactly 4 arguments (3 given)

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

'WhiteLibrary' object has no attribute 'app'

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'

setup.py uses setuptools feature "install_requires" which is not supported by distutils

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:

from distutils.core import setup
and not from setuptools and that causes the issue. Distutils might (i do not know) still resort back to requirements.txt so it doesnt cause any issues for the user but, but i dont really know for sure ..

@IsNoGood @eeter

Right Mouse Button Up and Down Key

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

Keyword Documentation for item enabled/disabled

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

`Input text to textbox` doesn't work in certain case: focus problem!

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

Excel crash during `close application` keyword

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".
image

Desktop (please complete the following information):

  • Windows 10 Enterprise 1703
  • Excel 2016 (32-bit)

Additional context
The same problem also happens on Word.

Keyword 'Input Text To Textbox' gives error, if locator prefix is 'text'

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:

  1. Launch putty.exe application
  2. Input Text To Textbox text=Auto-login username text=user

Expected behavior
No 'expected 2 arguments, got 1.' error

Screenshots
None

Desktop (please complete the following information):

  • OS: Windows
  • Browser: None
  • Version: Windows 10

Smartphone (please complete the following information):
None

Additional context
This call will PASS

WhiteLibrary . Input Text To Textbox id=1044, text=riikka

Scrollbars can't be found using WhiteLibrary

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.

Press keys doesn't work

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'

Finish button is not clicking always

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

image

Desktop (please complete the following information):

  • Windows 10

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Focus in going on to Finish button, but white is not clicking on the Finish button

MouseActionKeywords

Versatile Mouse handling like:

  • MoveMouse(position)
  • MouseLeftButtonDown()
  • MouseRightButtonDown()

This probably needs to take mouse type into accout i.e. lefthand mouse / righthand mouse.

Close Window keyword

Application consisting of more than one window requires this keyword when handling application close etc.

Not abe to access any keywords of whitelibrary after installing

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):

  • OS: Windows 10

Additional context
Please acknowledge as i am not able to call even single keyword in whitelibrary

Keyword 'Attached Window' gives error, if keyword 'Launch Application' is not in use. AttributeError: 'NoneType' object has no attribute 'GetWindow'

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:

  1. Execute the script with following keywords
  2. Attached to Window PuTTY Configuration
  3. Input Text To Textbox 1044 text=test12345
  4. See error: AttributeError: 'NoneType' object has no attribute 'GetWindow'

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'

Set timeout not correctly logged

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.

image

Support

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.

Unable to click on radio button inside a pane.

Hi,

I am unable to click on the radio button inside a pane using below statement

Attach Window title:New
Select Radio Button text:S1

If I inspect, the structure looks below:
S1(window)
|__tab
|__pane(p1)
|__S1(radio button)

Below path:
image

Could you pls help here.

Using multiple locators for identifying an object

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

unable to attach to "New Mail" window of outlook

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

code

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...

Below is the exception

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)

New `type:value` locator syntax in addition to (or instead of) `type=value` syntax

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.

Performance Issue

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.

Error installing via pip, no such file or directory: requirements.txt

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.