Google chrome console not remembering the script

#1

I’m working on a script in JavaScript that simulates mouse clicks of a user

When I put the script into Google chrome console

seems that when I am redirected to new website the script gets deleted

I need a way to preserve the script when we are redirected to another website.

Any ideas how we can perform such a script with out getting stopped by a redirect?

Here is a sample script that I am using

Blockquote

document.getElementsByClassName(‘example’).click();

window.location.href = ‘examplesite.com’;

document.getElementById(‘example’).click();

document.getElementById(‘example’).value = “No”;

document.getElementById(’ example).click();

After the " window.location.href" is performed the

document.getElementById(‘example’).click();

Blockquote

command will not be preformed.

Thank you for your help

#2

so your script doesn’t work on a site other than yours? that is supposed to happen for security.
i think that you are trying to use script1 from site1 on site2. corrct me if i’m wrong.

#3

The site I’m trying to use this script is not my site.

I need to make many manual clicks on the site to get to the end result.

I am trying to make this works shorter by creating a script that will preform tasks that clicking with them mouse would take a long time.

Similar to the task that you can find at the following link:

#4

You need to learn selenium and stop trying to do things in locations that are not designed for it.

#5

Seleniumhq,

sounds interesting.

Thank you.

From the little I read it seems that the program records scripts.

Would I be able to modify the recordings?

The programming languages I know are Java script and PHP not Python or Java

Will I still be able to modify the software?