Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It seems to be a not very common task but very interesting one. I do not think that there's some standard way so something has to be implemented.</p> <p>I do not know Perl much and I use Java, so this is just a heads up:</p> <p>I would extend the <code>DefaultSelenium</code> class for my tests that will use extended <code>HttpCommandProcessor</code> that will logs all commands performed:</p> <pre><code>import com.thoughtworks.selenium.HttpCommandProcessor; public class ExtHttpCommandProcessor extends HttpCommandProcessor { public ExtHttpCommandProcessor(String serverHost, int serverPort, String browserStartCommand, String browserURL) { super(serverHost, serverPort, browserStartCommand, browserURL); } public String doCommand(String commandName, String[] args) { StringBuffer sb = new StringBuffer(); sb.append("|" + commandName + "|"); if (args!=null) { for (String arg : args) { sb.append(arg + "|"); } if (args.length&lt;2) { sb.append(" |"); } } else { sb.append(" | |"); } System.out.println(sb.toString()); // or log it where you want return super.doCommand(commandName, args); } } </code></pre> <p>And</p> <pre><code>import com.thoughtworks.selenium.DefaultSelenium; public class ExtSelenium extends DefaultSelenium { public ExtSelenium(String serverHost, int serverPort, String browserStartCommand, String browserURL) { super(new ExtHttpCommandProcessor(serverHost, serverPort, browserStartCommand, browserURL)); } } </code></pre> <p>Then I would extend <code>SeleneseTestCase</code> for use as the base in my tests:</p> <p>import com.thoughtworks.selenium.SeleneseTestCase;</p> <pre><code>public class ExSeleneseTestCase extends SeleneseTestCase { public void setUp(String url, String browserString) throws Exception { int port = 4444; if (url==null) { url = "http://localhost:" + port; } selenium = new ExtSelenium("localhost", port, browserString, url); selenium.start(); selenium.setContext(this.getClass().getSimpleName() + "." + getName()); } } </code></pre> <p>The output of such test will look like:</p> <blockquote> <p>|getNewBrowserSession|*iexplore|<a href="http://localhost:8080/|" rel="nofollow noreferrer">http://localhost:8080/|</a><br> |setContext|SimpleTest.testNew| |<br> |open|/webapp/test.html| |<br> |isTextPresent|Sample text| |<br> |click|sampleLink| |<br> |waitForPageToLoad|10000| |<br> |testComplete| | | </p> </blockquote> <p>This solution will not log <code>verify</code>s and <code>assert</code>s so they may also be overrided in ExSeleneseTestCase to produce some trace.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload