Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not taking screenshots on failure when setting custom name #206

Closed
Abuturku opened this issue Sep 25, 2024 · 3 comments · Fixed by #207
Closed

Not taking screenshots on failure when setting custom name #206

Abuturku opened this issue Sep 25, 2024 · 3 comments · Fixed by #207
Assignees
Labels
bug Something isn't working

Comments

@Abuturku
Copy link

According to https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#toc-entry-314 you can set a custom name for libraries when importing them, for example:

Library FlaUILibrary screenshot_on_failure=True screenshot_dir=${FAILURE_IMG_DIR} AS FLA

Now I think the issue is caused by this check in _end_keyword in src/FlaUILibrary/__init.py__ in line 165

attrs['libname'] == "FlaUILibrary"

It seems as if Robot Framework is overwriting the libname attribute with the custom name. When debugging I added a line to print out the attrs variable and it showed:

'libname': 'FLA'

@Nepitwin Nepitwin added the bug Something isn't working label Sep 26, 2024
@Nepitwin Nepitwin self-assigned this Sep 26, 2024
@Nepitwin
Copy link
Member

Intresting behavior i will look into this next week how to fix custom libray names. Expected behavior should be that of cours libname comparsion should FLA not FlaUILibrary

@Nepitwin
Copy link
Member

Alias usage can not be obtained directly from python code. So i will create a new parameter alias which can be set

For example

Library FlaUILibrary screenshot_on_failure=True screenshot_dir=${FAILURE_IMG_DIR} alias=FLA AS FLA

afterwards i will use this alias. By default it will be FlaUILibrary

Nepitwin added a commit that referenced this issue Sep 26, 2024
Nepitwin added a commit that referenced this issue Sep 26, 2024
Nepitwin added a commit that referenced this issue Sep 27, 2024
Nepitwin added a commit that referenced this issue Sep 27, 2024
Nepitwin added a commit that referenced this issue Sep 27, 2024
@Nepitwin Nepitwin linked a pull request Sep 27, 2024 that will close this issue
Nepitwin added a commit that referenced this issue Sep 27, 2024
@noubar
Copy link
Contributor

noubar commented Sep 28, 2024

I was using this feature to be honest even before this last merge and it was functioning well.

*** Settings ***
Library  FlaUILibrary  AS  fla

*** Test Cases ***
test
    fla.click  <xpath>

@Abuturku what was the robot version you were testing with
I am using robot 7
And make sure that the AS is both capital

with the code i will provid is totally fine and working well.
@Nepitwin I think the last merge the alias as variable is unnecessary.
See my PR

noubar pushed a commit to noubar/robotframework-flaui that referenced this issue Oct 3, 2024
Nepitwin added a commit that referenced this issue Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants