简体   繁体   中英

How to execute local javascript file using selenium webdriver in C#

I am developing an application where i want to execute a java script file using selenium web driver in C#. I am keeping the file as a part of application so whenever application launch, i want that js file executed.I already tried placing that js file on server but I don't want that. I want that js as a part of application.

Use the JavascriptExecutor:

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("[INSER JS HERE]");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM