8000 Sharing a storeText variable between tests in a testsuite? · Issue #161 · xebia/Xebium · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Sharing a storeText variable between tests in a testsuite? #161

Open

Description

@pmmvr

i'm using | $VariableName= | is | storeText | on | //*[contains(@class, 'testPanel')]| to create a variable and later use this variable with | ensure | do | sendKeys | on | //*[contains(@id, 'textbox')]| with | $VariableName|

This works perfectly within a single test. However, Xebium/Fitnesse, seems to forget this variable when the next test in the suite opens.

How can I share variables between tests within a testsuite ?

Activity

  1. cwortel commented on Jun 8, 2016

    @cwortel
    Contributor

    Tests should not be dependent on each other, so FitNesse does not support
    it out of the box. Why is the value for the class not constant? What is the
    problem you try to solve, maybe there is an alternative way to reach the
    same goal.

    On Fri, Jun 3, 2016 at 8:44 AM, pmmvr notifications@github.com wrote:

    i'm using | $VariableName= | is | storeText | on | //[contains(Class,
    'testPanel')]| to create a variable and later use this variable with |
    ensure | do | sendKeys | on | //
    [contains(Ivan Dyachkov (@id), 'textbox')]| with |
    $VariableName|

    This works perfectly within a single test. However, Xebium/Fitnesse, seems
    to forget this variable when the next test in the suite opens.

    How can I share variables between tests within a testsuite ?

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #161, or mute the thread
    https://github.com/notifications/unsubscribe/AAq86XjnUVUiFFgESxBinOdKoChV2jM5ks5qH81SgaJpZM4ItP2X
    .

  2. pmmvr commented on Jun 8, 2016

    @pmmvr
    Author

    Thanks for your reply.
    Let's say my suite consists out of 5 test cases.

    • In the first test cases there is (1) a new product created and (2) a corresponding product-id is generated.
    • In third test case i want to (1) sell this exact product to a customer and (2) remove this product from the inventory.

    The only reliable way of ensuring the product from test case one is selected is by using the unique product ID. Due to heavy use on the test-environment it is almost impossible to predict this generated ID and testing this function is also not part of my testing scope.

    If I understand you correctly, you would advice me to group these tests within one Fitnesse-testPage instead of grouping them in a testSuite using individual test-pages for each test-case?

    Anyway, i did notice that within a suite, Xebium does reuse a earlier stored variable when using input commands such as typeand sendKeys but seems to "forget" the variable when using assertion commands such as waitForTextor assertValue. Would this be a bug?

  3. cwortel commented on Jun 8, 2016

    @cwortel
    Contributor

    Hmm that is strange behaviour. There is a differente between ‘fitnesse’ type variables and web driver internal variables. It might be something to do with that. But I would say that if one works the other should have the same behaviour. Unfortunately I don’t have time to dig into it right now. For now he quick workaround would be to store them in one page.

    If you really want to make solid tests and solve the problem, I would advise you run the tests in an isolated environment where you have a control over your data. In this setup you would have a fixture that allows to write data to my system, than run a focused tests using precisely that data, and start the next test. The next tests would start with cleaning the data of the first test, write new relevant data and again run a specifically focussed tests.

    Automation within a heavy used integrated environment is a bit an anti pattern, as is having depending tests, or combining different tests into one. If one test fails its practically impossible to trace what caused it and all following tests will fail as well. It’s not very fault tolerant or maintenance friendly.

    Hope this helps you somehow.

    On 08 Jun 2016, at 12:01, pmmvr notifications@github.com wrote:

    Thanks for your reply.
    Let's say my suite consists out of 5 test cases.

    In the first test cases there is (1) a new product created and (2) a corresponding product-id is generated.
    In third test case i want to (1) sell this exact product to a customer and (2) remove this product from the inventory.
    The only reliable way of ensuring the product from test case one is selected is by using the unique product ID. Due to heavy use on the test-environment it is almost impossible to predict this generated ID and testing this function is also not part of my testing scope.

    If I understand you correctly, you would advice me to group these tests within one Fitnesse-testPage instead of grouping them in a testSuite using individual test-pages for each test-case?

    Anyway, i did notice that within a suite, Xebium does reuse a earlier stored variable when using input commands such as typeand sendKeys but seems to "forget" the variable when using assertion commands such as waitForTextor assertValue. Would this be a bug?

    —
    You are receiving this because you commented.
    Reply to this email directly, view it on GitHub #161 (comment), or mute the thread https://github.com/notifications/unsubscribe/AAq86TOaVBJRRYjRIeaflJpJC2MGR8RIks5qJpMWgaJpZM4ItP2X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0