I am trying to execute a JS file through python, selenium but I think I miss something.
I tried to call the checking variable from safari console, but it shows the following error Can't find the checking variable.
I also tried to execute the following code line driver.execute_script('var checking=0;') but I got the same result when I tried to call the checking variable from Safari Console.
PYTHON CODE
driver.execute_script(open("/Users/Paul/Downloads/pythonProject/Social media/javascripts/Initializing Variables.js").read())
JS FILE
var checking;
function Checking(item) {
if (item) {
checking = true;
}
else {
checking = false;
}
}
Any ideas?