Load JS script from file system and execute it with selenium
I'm truing to execute a yui js script with js.executeScript Selenium's method. The script is being executed by selenium webdriver in order simulate a "click" on hybrid mobile app (the button is webview)
where the YUI_PATH is an url - https://cdnjs.cloudflare.com/ajax/libs/yui/3.18.0/yui/.....
The problem is that I do not have an access to the global network from the current site.
so I was thinking to save the script under the project and just to load it from FS. But this is a js , no access to the FS ...
Any ideas how to load the script ?
So, you're loading an html page somewhere, right? Conceptually you would load your JS file the same way: you make a request to your server to load the JS file, just like you did to load your html page.
That would look like this:
Also, I've never seen anyone loading a js file like you're doing in your code sample...I would most definitely just recommend putting a script tag in your html.
You may want to post your html code as well; we'll be able to provide better help. I'll update this answer accordingly if needed.
Finally , after many tries , some1 has suggested me to work with jquery. after some digging , I've used executeScript with jquery's tap , and it worked...
I was wondering all other methods with click and element's coordinates didn't work