2

I need my program to run and execute a few lines of Java code, then access and execute commands from an external file (e.g. located on the desktop) and then continue with the code inside the program.

Is that even possible? I'm using Selenium. The program starts the browser, and I want users to edit the script file in order to meet their needs. The basic program behavior should stay the same though.

For Example:

  • Start browser (program) -->
  • getURL (script) -->
  • findElement.By.id (script), click() (script) -->
  • close broser (program)
Moshe Slavin
  • 5,127
  • 5
  • 23
  • 38
Patrick
  • 31
  • 2
  • Use "keyword driven Testing Framework." that will surely help. – Sandeep Sep 20 '17 at 07:22
  • Yes. selenium is capable of doing that. – Kushal Bhalaik Sep 20 '17 at 09:09
  • This has not much to do with selenium. You have some input and you want to take action based on that input. If you want someone to be able to write complete scripts then you are looking for embedding a scripting language inside code. You can look at projects like https://github.com/ninia/jep, https://stackoverflow.com/questions/15089593/embedding-groovy-in-java-binding, https://www.packtpub.com/mapt/book/application_development/9781849519366/2/ch02lvl1sec24/embedding-groovy-into-java – Tarun Lalwani Sep 20 '17 at 15:54

0 Answers0