Giter Site home page Giter Site logo

accruent / robotframework-zoomba Goto Github PK

View Code? Open in Web Editor NEW
138.0 18.0 32.0 15.63 MB

Extended Robot Framework libraries to make testing GUI, REST/SOAP API, Mobile, and Windows Desktop easier.

Home Page: https://accruent.github.io/robotframework-zoomba/

License: Apache License 2.0

Python 81.99% RobotFramework 17.93% Shell 0.08%
robot-framework automated-testing api-rest soap-api gui python zoomba-library appium-windows appiumlibrary soap

robotframework-zoomba's People

Contributors

adiralashiva8 avatar aljcalandra avatar dependabot-preview[bot] avatar dependabot[bot] avatar f0zz avatar hoangx avatar jmartinez1221 avatar keithsmoland avatar m-hintz-42 avatar mend-bolt-for-github[bot] avatar mengelskirchen avatar neiljhowell avatar pinkymajhi avatar rasjani avatar sourcery-ai[bot] avatar wolfe1 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  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

robotframework-zoomba's Issues

Wait For And Click Element with Image locator seems to locate the correct place, but clicks are not done with LMB

I installed openCV4NodeJS on top of Zoomba robot-framework library, so I could get the image locator into use.

However, even the image gets located, and "clicks" are done to the correct place of the application (close button), they seem to have no effect as they seem to not come from LMB, instead some kind of touch emulation?

Basically what happens, is that the test "clicks on air", never hitting the located spot

How to pass download directory path ?

How to pass download directory with options?

I tried the below code: But it did not work
${options}= Get Edge Options
${options.use_chromium}= Set Variable True
${options.add_experimental_option["download.default_directory"]} Set Variable C:\Downloads
Open Browser http://www.google.com browser=Edge options=${options}

Could you please help ?

Slow object interactions- lazy loading concept in Zoomba library

Hi,

I would like to get some help to get faster test runs.
We a have a big (and slow) executable to test.
After logging in we have a lots of different options - windows and child windows (...and sub sub.. windows) and we had very slow test case running in some complex test cases. ( like over 20 minutes!)

Evolution in test speed:
Great speed improvements happened when we :

  1. Stop using Switch Application | Desktop - (We need to use only in some cases: Switch Application By Name. )
  2. Start using Automation ID instead of relative XPath.
    With these -above two-, mostly we can do actions in 1-6 seconds - click on buttons type text to field, getting values of field etc.

But in some cases - when sub-sub windows is the actual,- this actions took 20-60 seconds.
I think this is because we have too many objects in hour application.

So here is Lazy Loading concepts comes in picture:

One of our colleagues used WAD with other language, C# or Java, and he used the Lazy Loading "concept"

https://github.com/RAM0803/WinAppDriver/tree/master/Java/CalculatorTest

Some references related to Lazy Loading :
https://www.geeksforgeeks.org/lazy-loading-design-pattern/
https://pypi.org/project/lazy-load/
https://stackoverflow.com/questions/36274/what-is-lazy-loading
https://www.infoworld.com/article/2077568/java-tip-67--lazy-instantiation.html

Can we use this Lazy Loading here in Zoomba Desktop Library?

Desktop Library | Clicking Webelement errors with object has no attribute 'startswith'

Using the 'Get Webelement' example from the Desktop Library documentation results in an error.

AttributeError: 'WebElement' object has no attribute 'startswith'

robotframework-zoomba version: 2.11.0

*** Settings ***
Library           Zoomba.DesktopLibrary
Suite Setup       Start App

*** Variables ***
${REMOTE_URL}           http://127.0.0.1:4723
${APP}                  Microsoft.WindowsCalculator_8wekyb3d8bbwe!App

*** Keywords ***
Start App
    Open Application    ${REMOTE_URL}     platformName=Windows    deviceName=Windows   app=${APP}    alias=Main

*** Test Cases ***
Click Webelement
    ${element}    Get Webelement    name=One
    Click Element    ${element}

image

DesktopLibrary | Better Error Messaging

Improve error messaging and error handling in the Desktop Library. This is mainly focused around keywords that utilize ActionChains (such as the mouse keywords) but is needed in other keywords that needed modification and the private methods (perhaps).

Desktop Library | Desktop session error in multi-file test execution

Brought up here: https://forum.robotframework.org/t/unable-to-run-multiple-testsuite-using-zoomba-desktop-library/1348/3

Essentially if we have two test files just like this in a directory:

*** Settings ***
Documentation     Zoomba Desktop Library Tests.
Library           Zoomba.DesktopLibrary
Suite Setup       Start App
Test Setup        Launch Application
Test Teardown     Quit Application
Suite Teardown    Driver Teardown
Force Tags        Windows

*** Variables ***
${REMOTE_URL}           http://127.0.0.1:4723
${APP}                  Microsoft.WindowsCalculator_8wekyb3d8bbwe!App

*** Keywords ***
Start App
    [Documentation]     Sets up the application for quick launching through 'Launch Application' and starts the winappdriver
    Driver Setup
    Open Application    ${REMOTE_URL}     platformName=Windows    deviceName=Windows   app=${APP}
    Maximize Window
    Quit Application

*** Test Cases ***
Switch To Desktop Test
    Close Application
    Switch Application      Desktop
    Wait For And Click Element           name=Start
    Wait For And Click Element           name=Start

And we run the whole directory (so file1, then file 2) and the 2nd file attempts to run 'Switch Application' it is referencing the old desktop session:
image

Need to investigate why the session data is being reused after the applications have been quit and the driver has been torn down.

[🐛 Bug]: Test issue

What happened?

testing 123

Relevant log output

// int waitingRequestsCount = 0;
        // Matcher matcher = pendingRequests.matcher(htmlContent);
        // if (matcher.find()) {
        //     String queueCount = matcher.group(1).replaceAll("[^0-9]", "");;
        //     waitingRequestsCount = Integer.parseInt(queueCount);
        // }

Operating System

Window 10

RobotFramework-Zoomba version (tag)

2.13.1

No application open ( when control moves to a different file

Hi,
We have a test script to Open and launch the application( desktop app )
The next file is to perform subsequent checks on the opened application.
The first file executes successfully ( means application is opened ), but when the control is moved to the second script "no open application " is thrown.

How can I resolve this ?

My setup includes ( DesktopLibrary - Zoomba )

Move Travis-Ci to GitHub Actions

Changes to Travis-ci have cut off our ability to test. Emails to support have not been answered to get an OSS credit allotment so we need to transition to Github Actions.

APILibrary | Broken Robot Tests (3)

After adding the robot tests to the travis-ci build it was revealed that a few of the APILibrary Robot tests were not functioning as intended.

Validate Response Negative Tests - Broken
Validate Response List Negative Tests - Broken
Key By Key Validator Negative Tests

These tests are all producing the correct error messages. The issue is that the compare done by 'Run Keyword And Expect Error' is saying that the error doesn't match the intended.

image

From a quick glance and test I cannot figure out the difference between the actual and expected.

Each has been tagged 'Broken' and some have been moved into their own test cases since they were part of a larger set. When they are fixed they should be untagged and moved back to the test case they came from (same test case name but without the '- Broken' part).

Remote_URL not working from Desktop Library Documentation

While trying to get the Desktop Library up and running, I ran into an issue with example remote_url in https://accruent.github.io/robotframework-zoomba/DesktopLibraryDocumentation.html
Most remote_url example is given as http://localhost:4723/wd/hub, but that didn't work for me. I had to use 'http://localhost:4723`.

TestZoomba.robot that worked for me:

*** Settings ***
Library     Zoomba.DesktopLibrary  run_on_failure=No Operation

*** Test Cases ***
Test Zoomba Desktop Library
    [Tags]  Zoomba
    [Setup]  Driver Setup
    Log to console  ...
    Switch Application By Name  http://localhost:4723  Untitled - Notepad
    [Teardown]  Driver Teardown

RunTestZoomba.bat:

CD /D "%~dp0"

robot -d Output/Zoomba -T ^
--include Zoomba ^
-s Suites.TestZoomba .

Does the documentation need to be updated?
Is my setup wrong?

C:\>pip show robotframework-zoomba
Name: robotframework-zoomba
Version: 2.13.1
Summary: Robot Framework mini-framework.
Home-page: https://github.com/Accruent/zoomba
Author:
Author-email:
License: GPL-3.0
Location: c:\program files\python37\lib\site-packages
Requires: msedge-selenium-tools, psutil, python-dateutil, requests, robotframework, robotframework-appiumlibrary, robotframework-requests, robotframework-seleniumlibrary, robotframework-sudslibrary-aljcalandra, selenium
Required-by:

C:\>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] on win32

WinAppDriver installed at: C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe

Windows 10

Using Python functions with Zoomba library in page objects

Hi @Wolfe1,

We have our automated tests using zoomba for GUI and Android.

We felt occasionally to write certain functions in Python instead of robotframework. The problem we see is that we do not know how to extend it using robotframework-zoomba.

For e.g., we can write the following and then call the keyword where required, but the issue would be that this does not know the current browser that is launched and so the error message would be No browser open. Could you help us with how to let the keyword know about the browser instance?

from Zoomba.GUILibrary import GUILibrary
web_browser = GUILibrary()
wait_time = 30

class LoginPage:
    login_email_textbox = "id=email"

    def login_with_enter_email_address(self, email_address):
        web_browser.wait_for_and_input_text(self.login_email_textbox, email_address, timeout=wait_time)

GUILibrary | Add 'Save Selenium Screenshot'

We need a way to create a more uniquely named screenshot. To do so we have implemented the following in Robot framework:

Save Selenium Screenshot
    ${screenshot_index}=    Get Variable Value    ${screenshot_index}    ${0}
    Set Global Variable    ${screenshot_index}    ${screenshot_index.__add__(1)}
    ${time}=    Evaluate    str(time.time())    time
    Capture Page Screenshot    selenium-screenshot-${time}-${screenshot_index}.png

We need to implement this in the library so that we don't need to copy this code to every repository we use.

Switch Application Desktop slow

Hi,

First of all this Zoomba library is amazing. thank you very much for this. :)

My task to test a windows Desktop application, and i stucked with two issues. (i will open a separate issue)

My issue is with slow running when starting Switch Application Desktop.

If our app started only with Open Application,
Login page opens and I was able to type username and pw. then click on login button. (this is fast)
After login was success, application loading and main form appears. (login disappears)
On this MAIN form i was not able to interact any of the elements!
I was hopeless for one week and searching the internet for help then i found an advise to open app=root.
and then i found Zoomba. :)

So I started using the Switch To Desktop Test example
Our app loaded after login and I was able to Click, Input, Send keys, etc.
But each command issue takes 5-15 seconds (robot framework waits to issue this to WAD driver.)

So this is very very long, almost unusable because lots of interaction needed for each test case.

Can you pls advise how to solve the slowness issue?

Calculator example is fast.
CPU usage less than 20% (mostly winappdriver ) with my app. Memory is 50%. So these should not be the reason.

image

test case
image

Do you have any advise?

Thanks in advance.

Best Regards,
Robert

Using Zoomba for webview2 component

Hi Team,

I have an application that is developed using Webview2 .net component. Basically, we have a desktop container for our Angular based app. This is run using the microsoft edge (chromium).
I tried using Zoomba library for writing to a text field but the test case would fail giving an exception
No such elementException.

Any help on this would be appreciated

I have written very basic test case as shown below. The app opens but the element is not recognized.

Open Application ${RemoteURL} platform=Windows deviceName=Windows app=${myapp} window_name=${mywindowname} exact_match=false

Input Text xpath=//[@id="myTextBoxID"] MysampleText

'Wait until Window Opens' does not contain a wait...

image
This keyword is supposed to check for the window title (up to the timeout) and report back that it is open.

Currently it only attempts this once and relies on other keywords to keep it in check. This is misleading and not how this keyword should function.

  • Add an actual wait and controllable timeout to this keyword
  • remove the waits built into other keywords that call this one. Simply call the keyword now that it will wait.

Dictionary containing non-string objects may not always pass - Key By Key Validator

For an actual and expected dictionary the following may happen:
{ "a" : [1] } - Actual
{ "a" : [1] } - Expected
This will break when it sends 1, 1 to the recursive call on line 286.

Changing the 1 to a string resolves this problem.

The primary issue is that instead of checking for equality we are checking if string, then checking for inequality.
After that we assume the inner object is a dictionary.
A Set or a Tuple would also break this.

Most of this is exceptions since this method is dependent on robot framework which deals nearly only with strings, dicts, and lists, but it is not impossible to encounter ints or floats or other objects with regard to custom robot keywords in other libraries.

Zoomba.APILibrary - is there a way to ignore warnings as in requests library?

Running my RF scripts with docker on internal servers I get lots of warnings:
/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host 'proxy'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings

In requests library, keyword Create Session there is a possibility to use the disable_warnings argument, see here.

There is no Create Session keyword in Zoomba.APILibrary.
And the Call Post Request has no disable_warnings argument.
So is there another way to suppress warnings?

Excel Application - Extract text from cells

Currently I need to automate an excel spreadsheet that contain macros, therefore i need to automate using the excel application. But I am unable to extract the text from a cell, I can find the text in attribute ValuePattern.Value.

image
image

Does anyone knows how to extract this data?

Zoomba delay

Zoomba has a big delay to process a act. I can't fix this problem. Can you help me?
I use locator to click on button or check if the button is enabled. But, these process it takes too long.

Checkbox Status/Value - solution to add to wiki page

Hi,

I figured out how to get Checkbox value/status, it takes a few hours, so i would like to share this with others :)

How to add it to Wikipage, or to zoomba/DesktopLibraryDocumentation ?

Attribute to evaluate should be Toggle.ToggleState (and not Value.Value as in your example)

${CBV}= Zoomba.DesktopLibrary.Get Element Attribute AutomationId_ofthechkbox Toggle.ToggleState
Zoomba.DesktopLibrary.Element Attribute Should Match AutomationId_ofthechkbox Toggle.ToggleState 1

Best Regards,
Robert

Two (subsequent) clicking needed for buttons and checkbox.

Hi,

Buttons and CheckBoxes needs to be clicking twice for working. (Manual tests needs to be pushed once)

  1. First clicks seen in WAD commands and is visually seen on the application - seems to be pushed. but no action happens.
  2. Second click also seen in WAD window and button seems to be pushed again, - and this time the action is doing.

The code in Robot Framework:
image

WAD API commands for the above two code:
`

POST /session/5166D5D3-27CE-41B7-BC31-9722D6388F42/elements HTTP/1.1
Accept: application/json
Accept-Encoding: identity
Connection: keep-alive
Content-Length: 115
Content-Type: application/json;charset=UTF-8
Host: 127.0.0.1:4723
User-Agent: appium/python 1.0.2 (selenium/3.141.0 (python windows))

{"using": "xpath", "value": "//Button[@AutomationId='btnOK']", "sessionId": "5166D5D3-27CE-41B7-BC31-9722D6388F42"}
HTTP/1.1 200 OK
Content-Length: 98
Content-Type: application/json

{"sessionId":"5166D5D3-27CE-41B7-BC31-9722D6388F42","status":0,"value":[{"ELEMENT":"42.5505976"}]}

==========================================
POST /session/5166D5D3-27CE-41B7-BC31-9722D6388F42/element HTTP/1.1
Accept: application/json
Accept-Encoding: identity
Connection: keep-alive
Content-Length: 115
Content-Type: application/json;charset=UTF-8
Host: 127.0.0.1:4723
User-Agent: appium/python 1.0.2 (selenium/3.141.0 (python windows))

{"using": "xpath", "value": "//Button[@AutomationId='btnOK']", "sessionId": "5166D5D3-27CE-41B7-BC31-9722D6388F42"}
HTTP/1.1 200 OK
Content-Length: 96
Content-Type: application/json

{"sessionId":"5166D5D3-27CE-41B7-BC31-9722D6388F42","status":0,"value":{"ELEMENT":"42.5505976"}}

==========================================
POST /session/5166D5D3-27CE-41B7-BC31-9722D6388F42/element/42.5505976/click HTTP/1.1
Accept: application/json
Accept-Encoding: identity
Connection: keep-alive
Content-Length: 73
Content-Type: application/json;charset=UTF-8
Host: 127.0.0.1:4723
User-Agent: appium/python 1.0.2 (selenium/3.141.0 (python windows))

{"id": "42.5505976", "sessionId": "5166D5D3-27CE-41B7-BC31-9722D6388F42"}
HTTP/1.1 200 OK
Content-Length: 63
Content-Type: application/json

==========================================
POST /session/5166D5D3-27CE-41B7-BC31-9722D6388F42/element HTTP/1.1
Accept: application/json
Accept-Encoding: identity
Connection: keep-alive
Content-Length: 115
Content-Type: application/json;charset=UTF-8
Host: 127.0.0.1:4723
User-Agent: appium/python 1.0.2 (selenium/3.141.0 (python windows))

{"using": "xpath", "value": "//Button[@AutomationId='btnOK']", "sessionId": "5166D5D3-27CE-41B7-BC31-9722D6388F42"}
HTTP/1.1 200 OK
Content-Length: 96
Content-Type: application/json

{"sessionId":"5166D5D3-27CE-41B7-BC31-9722D6388F42","status":0,"value":{"ELEMENT":"42.5505976"}}

==========================================
POST /session/5166D5D3-27CE-41B7-BC31-9722D6388F42/element/42.5505976/click HTTP/1.1
Accept: application/json
Accept-Encoding: identity
Connection: keep-alive
Content-Length: 73
Content-Type: application/json;charset=UTF-8
Host: 127.0.0.1:4723
User-Agent: appium/python 1.0.2 (selenium/3.141.0 (python windows))

{"id": "42.5505976", "sessionId": "5166D5D3-27CE-41B7-BC31-9722D6388F42"}
HTTP/1.1 200 OK
Content-Length: 63
Content-Type: application/json

{"sessionId":"5166D5D3-27CE-41B7-BC31-9722D6388F42","status":0}`

Any advise why we have this ?

"Switch Application By Name" is very slow if exact_match=false is used

Zoomba Version 2.8.0

If keyword "Switch Application By Name" is used in combination with exact_match=false it is much slower than using it with exact_match=true (by factor 2-4 if no other application is running but by factor 10-15 if some other applications are running).

You can test it by the follwing suite:

*** Settings ***
Library   Zoomba.DesktopLibrary

Suite Setup      Suite Initialization
Suite Teardown   Suite Finalization

*** Variables ***
${REMOTE_URL}   http://localhost:4723
${APP}          Microsoft.WindowsCalculator_8wekyb3d8bbwe!App

*** Test Cases ***
AppChange
    # ${calculator_handle}=  Open Application    ${REMOTE_URL}     platformName=Windows    deviceName=Windows   app=${APP}
    ${calculator_handle}=  Switch Application By Name  ${REMOTE_URL}  window_name=Rechner  exact_match=true  platformName=Windows    deviceName=Windows   app=${APP}
    Wait For And Click Element  accessibility_id=clearEntryButton
    Wait For And Click Element  accessibility_id=num1Button
    Wait Until Element Contains  accessibility_id=CalculatorResults      1

    # Switching to Word but don't know the name of the currently open word document (means I have to use exact_match=false)
    Switch Application By Name  ${REMOTE_URL}  window_name=Word  exact_match=false  platformName=Windows    deviceName=Windows
    Send Keys  Hello World 1  \ue007

    Switch Application  ${calculator_handle}
    Wait For And Click Element  accessibility_id=num2Button
    Wait Until Element Contains  accessibility_id=CalculatorResults      2

    # Switching to Word but using the exact document name
    Switch Application By Name  ${REMOTE_URL}  window_name=Dokument1 - Word  exact_match=true  platformName=Windows    deviceName=Windows
    Send Keys  Hello World 2  \ue007

    Switch Application By Name  ${REMOTE_URL}  window_name=Rech  exact_match=false
    Wait For And Click Element  accessibility_id=num3Button
    Wait Until Element Contains  accessibility_id=CalculatorResults      3

    # Switching to Word againg using exact_match=false to see whether there is some caching
    Switch Application By Name  ${REMOTE_URL}  window_name=Word  exact_match=false
    Send Keys  Hello World 3  \ue007

*** Keywords ***
Suite Initialization
    Driver Setup
    
Suite Finalization
    Driver Teardown

This results in the follwing log
grafik

What can be done to improve the performance?

Webdriverexception: Failed to locator opened application window with appID

Hello,

Greeting!!!

When i try to open a app, i'm getting "Webdriverexception: Failed to locator opened application window with appId" error and application is not getting launched.

I have the below start driver keyword in my suite setup,

Start Driver
driver setup
OPEN APPLICATION ${REMOTE_URL} platformName=Windows deviceName=Windows app=${APP}

REMOTE_URL = 'http://127.0.0.1:4723'

I have my in local storage (Plug and play app. not installable).

It was working fine couple of month before. I'm not sure what's going on.

Could you please help?

Wait Until Element Is Enabled/Disabled doesn't wait until element is enabled/disabled

Hi everyone,
I was trying to automate a windows app where button1 is visible from the start, but disabled. Button2, when pushed, starts an operation at the end of which button1 becomes enabled and thus clickable. The keyword Wait Until Element Is Enabled looked perfect for the job, but it kept failing. Looking at the Python code behind the library, the reason appeared clear:

self._wait_until_page_contains_element(locator, timeout, error)
self.element_should_be_enabled(self.current_element)

The keyword (like its sister Wait Until Element Is Disabled) doesn't actually wait for the element to switch to Enabled, rather it waits until the "page" contains the element and then summons the test-failing Should Be Enabled. So, in my case, the disabled button being already present from the start, Wait Until Page Contains Element passes, then Should Be Enabled instantly fails the test.
The keyword does not really do what it says it does, i.e. it doesn't wait for the button to become Enabled, it waits for it to be present and then fails if it's not enabled. I think this needs to be fixed, because if they worked as they should, they would be truly useful indeed.

Open_Application does not always start app with webdriver

Issue

DesktopLibrary#open_application does not start the app with webdriver#remote when the attribute window_name is given.

The result is that the application may be started with an other user than webdriver is running with and as it with other user rights than intended.

if window_name:
# If the app has a splash screen we need to supply the window_name of the final window.
# This code path will start the application and then attach to the correct window via
# the window_name.
self._info('Opening application "%s"' % desired_caps['app'])
subprocess.Popen(desired_caps['app'])
if splash_delay > 0:
self._info('Waiting %s seconds for splash screen' % splash_delay)
sleep(splash_delay)
return self.switch_application_by_name(remote_url, alias=alias, window_name=window_name,
exact_match=exact_match, desktop_alias=desktop_alias, **kwargs)
# global application
self._open_desktop_session(remote_url, desktop_alias)
if "platformName" not in desired_caps:
desired_caps["platformName"] = "Windows"
if "forceMjsonwp" not in desired_caps:
desired_caps["forceMjsonwp"] = True
application = webdriver.Remote(str(remote_url), desired_caps)
self._debug('Opened application with session id %s' % application.session_id)
return self._cache.register(application, alias)

Admin | Build out examples for new users

We need to provide more information for users first landing on the repository. Right now we just rely on user knowledge, the docs, and the example tests. However for a library aimed at helping not only existing teams, but new teams get set up we need a more comprehensive guide to importing and using the libraries.

Zoomba.APILibrary: Passing/Setting header values from another TestCase or Keyword

Hi

I have a usecase where I need to grab the auth token from webUI and then Pass it on to API test-cases as header.

I have implemented and get the auth-token from Keyword (Get AuthToken). But in Zoomba.APILibrary we set the headers in Variables section as

*** Variables ***
${endpoint}= "some url"
&{headers_dictionary}= Authorization=Bearer ${token} Content-Type=application/json charset=UTF-8
${query_string}= none

In the test case file I am using Set Variable to update the ${token} but it's not getting updated.

Get Basic API Test
${token1}= Run Keyword Get AuthToken #keyword to get auth-token and assign it
${token}= Set Variable ${token1}
Log ${token}
${response}= Call Get Request ${headers_dictionary} ${endpoint} ${query_string}
Log ${response}

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.