Can i invoke Selenium record and play feature directly from Webdriver

57 views
Skip to first unread message

SeleniumNewBee

unread,
Jul 28, 2015, 8:24:00 AM7/28/15
to Selenium Users
I have used the Selenium IDE record and play feature and then exported the test scripts as java file to be used with the webdriver in eclipse. It works and it is all fine.

Is it possible to get the recording directly in webdriver. I want to get the recording and inspect elements myself using xpath and what not.

What i am trying to do here is create an application which will have its own record and play button, and then i want to use the selenium webdriver functionality in the background. 

Mercious

unread,
Jul 28, 2015, 10:12:41 AM7/28/15
to Selenium Users, bhutan...@gmail.com
You mean you want a Selenium IDE that translates your clicks and actions onto the webpage into WebDriver-Code?

Like: 
Start recording
Go to www.google.com -> Your programm automatically writes "driver.get("www.google.com");

Or what?

What is the purpose of this? This has no advantage over what the Selenium IDE already offers. Keep in mind that it also only is a tool and you should not develop your tests using solely the IDE and it's translation.

SeleniumNewBee

unread,
Jul 29, 2015, 12:26:31 AM7/29/15
to Selenium Users, hart...@gmx.de

With selenium ide, when we use a webpage with dynamic ids, it shows errors when we play the recording. So then we export the testscripts in java format and correct the errors using webdriver.
This is all fine if i was writing test cases for myself.

However i am trying to create an app, where the user will just click, record and play. They do not need to export any test cases. That is why i am asking is it possible to access the recording directly from webdriver. I believe this recording is nothing but HTML page and information like sequence of events etc
So how can i acccess this recording directly?

Mercious

unread,
Jul 29, 2015, 4:45:51 AM7/29/15
to Selenium Users, bhutan...@gmail.com
Here is an example of a test-case, that typed "Hello" into google and selected the first link:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://www.google.de/" />
<title>example</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">example</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/?gws_rd=ssl</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=lst-ib</td>
<td>Hello</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=HELLO! Online: celebrity &amp; royal news, magazine, babies ...</td>
<td></td>
</tr>

</tbody></table>
</body>
</html>



This seems to be their format of saving test-cases.

You would have to parse and translate it into WebDriver-actions if you wanted to use it.

I still dont really understand what you are trying to achieve with your app. It makes no sense.

If your website uses dynamically generated URLs then Selenium IDE Is simply not suited to use for non-programmers. They will report numerous issues because they cant replay test-cases and you will only have issues with it.


If you want any advice or input, then please describe in detail what the usercase is that you are trying to achieve. Give an exact scenario that is supposed to work after you have finished your work. 
Reply all
Reply to author
Forward
0 new messages