hwoarang69 11 Newbie Poster

How can I use seleium test case in groovy? such as clinking on links.

test case

<html>
...
<body>
<table>
   <tr>
           <td>open</td>
           <td>https://url.web:8010/</td>
  </tr>

  <tr>
           <td>clickAndWait</td>
           <td>link=service=homeLink</td>
  </tr>

  <tr>
           <td>clickAndWait</td>
           <td>link=name=contentLink,service=Queue</td>
  </tr>

  <tr>
           <td>clickAndWait</td>
           <td>link=BackLink</td>
  </tr>

  ...

groovy script

// Setup credentials
def String[] credentials = new String[2]
credentials[0] = "username"
credentials[1] = "password"
def jmxEnv = [(JMXConnector.CREDENTIALS):credentials]

// Setup JMX connection with credentials
def serverUrl = 'service:jmx:rmi:///jndi/rmi://url.web:8010/jmxrmi'
def server = JmxFactory.connect(new JmxUrl(serverUrl), jmxEnv).MBeanServerConnection 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.