How to do changes in the source code of selenium

732 views
Skip to first unread message

hemshankar sahu

unread,
May 20, 2012, 4:59:45 AM5/20/12
to Selenium Developers
Hi all,

I want to modify the source code of selenium so that it produces code
(that I want in Perl or java) for each event (like click or type)
instead of what if normally produces (when we export it in Perl or
Java).


Please help me regarding this as this will help me to a great extent
in developing my selenium scripts.

Also please mention at least the steps which I need to follow to start
working in this direction.

What I feel is the following:

1. Download the source code of the Selenium.
2. Find the code which performs some action when we do something in
the Web page (like click).
3. Modify those codes as per the reimbursement of logs, codes etc to
be developed.


Out of the above 3 steps I am able to do the first (Only down loading
the source code of the selenium) but I am not able to figure out which
part of the code is responsible for the step 2 (above) as that I can
perform the step 3.

Please help me regarding this.

Thanks
Hemshankar Sahu

Paul Grandjean

unread,
May 24, 2012, 2:12:19 PM5/24/12
to selenium-...@googlegroups.com
Hi,

I think you just need to use a debugger to step into the code and do it.  If you have specific code questions I'm sure one of the committers would be willing to answer, if someone knows the answer.  But your questions right now are of a very general nature.  Just start stepping into the code and studying it.

Hemshankar Sahu

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.


darrell

unread,
May 25, 2012, 8:14:08 AM5/25/12
to Selenium Developers
I would look at it as follows:

I am a software developer. I have just joined a new company. Someone
points me to a wiki (http://code.google.com/p/selenium/w/list) and
says the information I need should be in there. I figure out how to
setup my development environment to work with Subversion (because that
is what the company is using). I check out the source code.

What would any software developer, new to a company, do at this point?
Some will read design documents (if they can find any). Some will
start looking for patterns in the code and coding conventions the team
are using. If your tools allow it, run the application in debug mode
and set things to 'break on main'. Then start stepping into and out of
code. Otherwise, look at the code and see if there are things which
are obvious. If you are using Java and instantiating a RemoteWebDriver
then find the RemoteWebDriver class and set a breakpoint on the
constructor. If you want to find the code for a click() method. Search
for all click() methods and set breakpoints on them all or set a
breakpoint on the findElement() method in RemoteWebDriver and step
forward from there until you find the click() method. Write simple
test stubs so you can see what code gets called rather than stepping
through huge test suites.

The modifying of the code should be straight forward. If you don't
know how to change code (fix bugs, add features, etc.) then that is
beyond the scope of WebDriver and really is about general software
development.

Darrell

P.S. since you'll only have read access to the source, if you want to
version control your changes you might want to save them into a
different source control system like GIT. Checkout SVN from the
selenium repository, merge, make changes as needed, check in to GIT.

Ross Patterson

unread,
May 25, 2012, 8:26:50 AM5/25/12
to selenium-...@googlegroups.com, hemshankar sahu

There's actually a well-structured system for adding or customizing language support in Selenium IDE.  What you need to do is to build a new formatting module, and load it when you build your tests.  Here's what I wrote the last time someone asked about how to do this:

 

·         The IDE release notes have a little bit of info on formatter plugins: http://code.google.com/p/selenium/wiki/SeIDEReleaseNotes.

·         Adam Goucher did a great series of blog posts a few years ago about writing IDE plugins:

o    The Selenium-IDE 1.x plugin API (Part 1) – Build and Preferences: http://adam.goucher.ca/?p=1331

o    The Selenium-IDE 1.x plugin API (Part 2) – The Toolbar: http://adam.goucher.ca/?p=1341

o    The Selenium-IDE 1.x plugin API (Part 3) – The Sidebar: http://adam.goucher.ca/?p=1343

o    The Selenium-IDE 1.x plugin API (Part 4) – Extending the Selenium API: http://adam.goucher.ca/?p=1348

o    The Selenium-IDE 1.x plugin API (Part 5) – Publishing Updates: http://adam.goucher.ca/?p=1351

o    The Selenium-IDE 1.x plugin API (Part 6) – Formatters: http://adam.goucher.ca/?p=1352

o    The Selenium-IDE 1.x plugin API (Part 7) – Packaging Nuances: http://adam.goucher.ca/?p=1362

o    The Selenium-IDE 1.x plugin API (Part 8) – Localization: http://adam.goucher.ca/?p=1376

o    The Selenium-IDE 1.x plugin API (Part 9) – Secure Password Storage: http://adam.goucher.ca/?p=1377

o    The Selenium-IDE 1.x plugin API (Part 10) – Registering your plugin: http://adam.goucher.ca/?p=1387

·         The old Wiki has a page that describes how to write a formatter (be forewarned, it’s O-L-D): http://wiki.openqa.org/display/SIDE/Adding+Custom+Format

 

Ross

raghavendra karteek

unread,
May 25, 2012, 8:57:36 AM5/25/12
to selenium-...@googlegroups.com
It's really helpful . Thanks

--

hemshankar sahu

unread,
May 25, 2012, 5:22:59 AM5/25/12
to selenium-...@googlegroups.com

Thank you very much  Paul. 

Can you just ping me the site where I can get the Selenium Source Code. It will be really help full for me. 

Thanks 
Hemshankar Sahu

Paul Grandjean

unread,
May 29, 2012, 12:57:30 PM5/29/12
to selenium-...@googlegroups.com
It's on the Selenium Hq website.  Or just Google it.

Paul

Kamlesh Shah

unread,
May 29, 2012, 1:50:44 PM5/29/12
to selenium-...@googlegroups.com
I am having problem to locate dynamic generated ext-genXXX in selenium Webdriver any suggestion.

Regards
Kamlesh

hemshankar sahu

unread,
May 28, 2012, 10:58:53 AM5/28/12
to selenium-...@googlegroups.com
Thanks a lot Ross and Darrell. It helped me a lot in finding where to start from.

Thanks 
Hemshankar Sahu
Reply all
Reply to author
Forward
0 new messages