Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Peter Tesler
    @vptes1
    What's in your test? What browser is this happening in? Are you using a --test-server? (if not, did you set the SELENIUM_SERVER_JAR as per https://smashtest.io/getting-started/setup ?)
    Also, it's a good idea to upgrade smashtest to the latest version
    Peter Tesler
    @vptes1
    The whole SIGTERM thing is an error internal to selenium
    Craig Waite
    @craigvl
    Needing to catch the UnexpectedAlertOpenError exception that gets thrown in selenium-webdriver error.js (592) , just wondering where this should be caught to make sure that I am doing this correctly, Thanks.
    Peter Tesler
    @vptes1
    I assume you're getting that because an alert is open and you're trying to do something else? Is the alert supposed to be there in the first place?
    Craig Waite
    @craigvl
    Yes the application that I am testing is using alerts for user actions "Are you sure you want to delete this" etc..
    Peter Tesler
    @vptes1
    Then you have to close the alert first, then do stuff
    there are a few steps that do that
    i.e., click one of the buttons in the alert
    or alternatively you can use js in a code block
    Craig Waite
    @craigvl
    ok yes but the test just fails as soon as the alert is shown
    image.png
    Peter Tesler
    @vptes1
    Is clicking deleteButton what triggers the alert to open?
    And if so, what's the whole stack trace on that?
    Craig Waite
    @craigvl
    yes when you click on deleteButton and stack is:
      (Session info: chrome=78.0.3904.108)
      (Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.18362 x86_64)
        at Object.checkLegacyResponse (smashtest\node_modules\selenium-webdriver\lib\error.js:593:13)
        at parseHttpResponse (smashtest\node_modules\selenium-webdriver\lib\http.js:554:13)
        at Executor.execute (smashtest\node_modules\selenium-webdriver\lib\http.js:489:26)
        at process._tickCallback (internal/process/next_tick.js:68:7)
    Peter Tesler
    @vptes1
    Did a google and in the first result they say how there's a bug in selenium where it throws that error if an alert is open and a screenshot is taken. Do you have screenshots on? If so, does disabling them (temporarily) fix this?
    Peter Tesler
    @vptes1
    Also, according to http://garajeando.blogspot.com/2014/06/protractor-how-to-avoid.html if you immediately dismiss the alert right after the click, it should make the problem go away. Not sure why this would work but they say it does haha
    Try using built-in steps Accept alert or Dismiss alert
    DWTUTS
    @dwtuts
    Hey is there a way to set return responses from API tests as a variable to use in another API test?
    Peter Tesler
    @vptes1
    You can return anything in a code block and then use the js variable prev to access it in a subsequent code block
    Hope that answers your ques!
    Or you can just set a variable with g('varname', value) and access it as js variable with varname in subsequent code blocks
    DWTUTS
    @dwtuts
    So say I have an API test like so await post({ url: 'https://api.com/endpoint', headers: { 'content-type': 'text/plain' }, body: `body goes here`, timeout: 1500 }); would I just need to call the response.verify inside of that with the body set to a variable?
    Peter Tesler
    @vptes1
    Oh you have to call response.verify() in any subsequent step's code block, just like in the documentation. No need to set variables, it handles passing the response to the next step.
    Craig Waite
    @craigvl
    Peter, thanks for the ideas, same with screenshots off and errors on click so unable to use Accept alert, don't waste any more time on this, I will let you know if I figure something out.
    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