Scripted browser advanced examples

Hello,

i’d like to setup a synthetic scripted browser that would load one by one a list of pages and perform some operations on them:

  • Check if some elements are in place
  • Follow some links
  • Check if in these pages there are some elements
  • Go to the next page to be loaded, rinse and repeat.

I haven’t found any advanced examples for the scripted browser and haven’t understood what is the correct way of logging and throwing errors from these scripts. Also the “going through a list of pages” is not a topic touched by any examples, so i’m shooting in the dark.

Along with this: i’d like to run these tests locally before i’d put them to New Relic, just so that following what happens in the scripts is way easier on my machine.
From what i see, the only way to get through all the promises in scripts is chaining a set of .then functions… is there any other way of doing things?

Hi, @federico.prato: For advanced examples, you might take a look at the Synthetics Quickstarts Library: https://github.com/newrelic/quickstarts-synthetics-library.

As for testing scripts locally, you may find this topic helpful:

Thanks, this is a great start.

i was going through the guidelines from selenium: On test automation | Selenium and was wondering would it be possible to create libraries and classes that i could import in my scripts.

thanks for your help!

1 Like