Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing Webdriver script from HTML

I am creating a frame work for my AUT. I plan to use Webdriver/Java. I am relatively new to Selenium, Java and html programming. I want to implement the framework in following manner.

  1. There will be an HTML interface where user can select check boxes for the test cases he wants to run.
  2. He can submit after making his selection.
  3. On submitting the script will be executed.
  4. Execution will consist of only selected cases.

My questions are:

  • Is anything better than html for point 1? I don't want to use Excel as I want this interface to be interactive so that anyone can use the interface, without any knowledge of domain or the script running behind it.
  • How should I go about point 3? I would need to start my main function and pass the selected 'cases' as an array or something.
like image 600
MHH Avatar asked Feb 20 '14 12:02

MHH


People also ask

Which Selenium code can execute JavaScript directly?

a) executeScript This method executes JavaScript in the context of the currently selected window or frame in Selenium.

What should you do to directly execute JavaScript on Selenium WebDriver?

We can run Javascript in Selenium webdriver with Python. The Document Object Model communicates with the elements on the page with the help of Javascript. Selenium executes the Javascript commands by taking the help of the execute_script method. The commands to be executed are passed as arguments to the method.

Can we execute JavaScript on browser with Selenium?

You an use selenium to do automated testing of web apps or websites, or just automate the web browser. It can automate both the desktop browser and the mobile browser. Selenium webdriver can execute Javascript. After loading a page, you can execute any javascript you want.


1 Answers

Have you looked at Selinium IDE? It's a basic front end for Selinium. You can record and playback test cases and you are able to select which test case to run from a test suite.

Since recently this could be used to run tests in browsers other than just firefox using Selenium IDE.

PS You should also look into Huxley-Selenium for regression testing. We found the node version is much easier to install.

Hope this helps. Good luck!

enter image description hereenter image description here

like image 59
Chris Gunawardena Avatar answered Sep 29 '22 02:09

Chris Gunawardena