Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    DWTUTS
    @dwtuts
    Does anyone have an example maybe of calling an api and then assigning the body value to a variable? I am still having some issues trying to figure it out.
    Peter Tesler
    @vptes1
    @craigvl Please upgrade to 1.6.15. The problem should be solved there.
    @dwtuts I think I understand what you mean. You can access the response body via response.response.body, or, if you upgrade to 1.6.15 you should be able to access it via response.body. The response object is available in any step following the step where the request was made from. It is also the return value of the request function call. So....
    Make a request {
        await get(`https://site.com/endpoint`);
    }
        Make another request {
            await get(`https://site.com/endpoint2/${response.body.value1}`);
        }
    or
    Make requests {
        let response = await get(`https://site.com/endpoint`);
        let response2 = await get(`https://site.com/endpoint2/${response.body.value1}`);
    }
    Craig Waite
    @craigvl
    Peter thanks, it now fails with the same error on the next step after the Click step:
    Click 'deleteButton' (was failing here)
            Accept alert (fails here now)
    Peter Tesler
    @vptes1
    Are you in debug mode or normal mode?
    Craig Waite
    @craigvl
    debug
    Peter Tesler
    @vptes1
    @craigvl ok try 1.6.16
    apparently you cannot inject js into the browser while an alert is open
    Craig Waite
    @craigvl
    Well done, it's working.
    so you updated to not write out the console logs if alert open as per the commit
    Peter Tesler
    @vptes1
    Yup. You got it
    id7digital
    @id7digital
    Hey Guys, I am running my smashtest using the firefox geckodriver.exe, I have multiple branches. Each time I run my tests there are lots of instances of firefox.exe in the taskmanager taking up memory and staying there, even after the tests are complete, is there any way to get rid of this?
    Peter Tesler
    @vptes1
    That's a selenium bug as far as I know.
    There are commands you can run to kill off all the zombie processes. For example, on windows taskkill /F /IM geckodriver.exe (https://stackoverflow.com/questions/40702478/how-to-kill-many-geckodriver-exe-processes/40704072#40704072)
    Peter Tesler
    @vptes1
    I wish I had a better answer for you, but selenium has to take care of its own bugs πŸ˜“
    Peter Tesler
    @vptes1

    Some of you were having trouble with sequential step blocks like these:

    ..
    Open Chrome
    Navigate to 'site.com'

    There was an issue that was fixed in the latest version, so please upgrade

    Also, hope everyone has a happy and healthy new year! πŸŽ‰πŸŽ‰Thank you for your continued support!
    id7digital
    @id7digital
    Hi guys, i;m experiencing problems with the recursive flag, whenever I run my smashtest using the recursive syntax I seem to get the following error when generating branches - FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory (Has anyone experienced this at all)?
    Peter Tesler
    @vptes1
    Make sure you aren't generating too many branches
    i.e., enough to max out your memory
    id7digital
    @id7digital
    ah I see, I have one branch but it keeps generating 4 for some reason. That is just with Open Chrome when ran recursive it generates 4 branches for some reason, this is when i navigate to the main.smash file folder and just run smashtest --recursive
    Peter Tesler
    @vptes1
    You may have other files hiding somewhere in there
    Or post exactly what you're trying to run, your smashtest version, OS, your exact command, etc. for help troubleshooting
    Peter Tesler
    @vptes1
    I threw together a bunch of lessons on Smashtest. Please let me know what you think!
    https://smashtest.io/lessons
    Craig Waite
    @craigvl
    Great videos thanks heaps! I wonder if on the 4th video at around the 20 minute mark if the prop for 'login box' should be shown along with the usage to reinforce the link between the prop definition and usage, does this make sense? not major though. Thanks again.
    Peter Tesler
    @vptes1
    I think I do show it at around 19:30 :)
    Craig Waite
    @craigvl
    Yes was thinking that they should be shown at the same time so that it is obvious how they relate, but thinking about this some more I think that someone who is watching the 4th video would already have this understanding.
    id7digital
    @id7digital
    Thanks @vptes1
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    I like that I can use REPL to .load and run a smash script but when the script is done it disconnects. How can I stay connected so that I can use the smashtest shell to run more commands and then .save them?
    Peter Tesler
    @vptes1
    @RoyceTheBiker_gitlab I'm having trouble reproducing the issue - it doesn't disconnect for me
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    Running this on a Mac Book Pro. This is the command I use smashtest --test-server=http://localhost:4444/wd/hub -r. It exits with a zero value and no errors. Each command shows as passed. webdriver has messages about session starting and ending but no errors.
    This is the script.
    Open Firefox
    
        Navigate to 'localhost:4200'
            {{username}} = 'admin'
            {{password}} = '12345'
            Type {{username}} into 'input[name=username]'
            Type '{{password}}[enter]' into 'input[name=password]'
    If I go into REPL and run each command manually one at a time it stays connected and Firefox stays open.
    Can the --debug option help here? It wants a hash but I don't know what to do with that.
    Peter Tesler
    @vptes1
    You should either indent each of the last 4 lines or put a .. on top of the {{username}} line. You're creating four different branches here.
    Open Firefox
    
        Navigate to 'localhost:4200'
            ..
            {{username}} = 'admin'
            {{password}} = '12345'
            Type {{username}} into 'input[name=username]'
            Type '{{password}}[enter]' into 'input[name=password]'
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    Righ. I forgot about that. I will change it and try again.
    Peter Tesler
    @vptes1
    Or, to make it cleaner...
    ..
    Open Firefox
    Navigate to 'localhost:4200'
    {{username}} = 'admin'
    {{password}} = '12345'
    Type {{username}} into 'input[name=username]'
    Type '{{password}}[enter]' into 'input[name=password]'
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    It did not like the .., complained about Error: You cannot have a .. line without anything directly below [:1]. The tab in worked but the shell still terminates.
    Peter Tesler
    @vptes1
    I'd just run the test normally (put it in a .smash file, and run it with smashtest --test-server=http://localhost:4444/wd/hub, no -r flag). If you want to debug a particular step using the REPL, put a ~ next to it.
    You wouldn't put .. or indents into the REPL directly...only single-line commands
    So when you're using .load it just regurgitates a bunch of previously-typed-in lines directly into the REPL, and that doesn't always work
    RoyceTheBiker
    @RoyceTheBiker_gitlab
    What is a good way to deal with CAPTCHA or MFA? I have control over the full stack. Is there a way to call an external command or API? I don't want to disable them or set them to fixed answers, I would like to call an API that will return what the input for these fields should be.
    Peter Tesler
    @vptes1
    Any nodejs code can go into a code block. You can do it from there.
    Peter Tesler
    @vptes1
    Version 1.7 is out!
    id7digital
    @id7digital
    Hi guys, do you know if there is a way of handling popups using smashtest, as in adding text to them using smashtest
    Peter Tesler
    @vptes1
    HTML popups or alerts?