SWD Page Recorder – records WebElements and generates PageObject classes (Announcement)

4,267 views
Skip to first unread message

Dmytro Zharii

unread,
Jan 7, 2014, 9:38:22 AM1/7/14
to seleniu...@googlegroups.com
Dear Selenium Users, 

I am glad to announce my open source pet project – SWD Page Recorder

The utility aims to: 
  • collect the WebElements in runtime
  • debug XPath/CSS locator even with Internet Explorer (as well as in any other supported web-browser) 
  • generate PageObject-classes on several languages: C#, Java, Ruby, Python. 

Major SWD Page Recorder features: 
=============================

1. WebElement Explorer allows searching and recording web elements inside the browser window. 
WebElement Explorer automatically generates XPath locators for WebElements. 

2. Locators Testing/debugging: If you are not happy with automatically generated XPath, you  can always optimize, test and debug locators manually. Locators tab on main Page Recorder form, allows debugging and testing locators. You can also change the locator type, from XPath to CSS, for instance.

3. PageObject code generation. Page Recorder can generate the PageObject classes code on several programming languages. 
C#, Java, Python, Ruby and Perl are supported out of the box. Page Recorder allows creating user-defined templates: just create a new template in the folder “CodeTemplates”.
The templates use .NET Razor template engine which allows using C# as templating language without  whole product recompilation. 

4. Custom Code Generators (experimental). The template  “[ZZZ] Experimental Run External Tool.cshtml” allows to save PageObject definition to a separate JSON file and run external tool in order to parse and generate page objects with any language of your chose. The sample in JavaScript is included.

6. SWD Page Recorder allows recording inside frames and iframes and Browser Pop-up windows.

7. Page Recorder built with Selenium WebDriver inside. It uses Selenium WebDriver methods for testing and debugging the locators. If locators work from Page Recorder – you can be sure, it will also work from your automated tests.

8. The acronym SWD stands for Selenium WebDriver ;)


Documentation: 
============
Well... the documentation is a big problem for me. But, there is something... 

In English: 
-----------------
There is a great blog post from Unmesh, the author of several popular books on Selenium: 

The project downloads page has a short video in English: 

In Russian:
----------------
SWD Page Recorder: Записывает PageObject-классы для Selenium WebDriver

I am also working on the project's web-site:
But, it is on a very early development stage

Issues and feedback: 
-----------------------------
The best place to report bugs and propose enhancements is here:

I am tracking the selenium-users group mailing list and will read and reply to any comments, proposals and bug-reports. 


I wish you happy New Year,
Dmytro Zharii 

Krishnan Mahadevan

unread,
Jan 7, 2014, 12:18:01 PM1/7/14
to seleniu...@googlegroups.com
I went through the video. This looks "cool"!! Awesome work Dmytro :)
Will fiddle around more and come back with more inputs !!

Thanks and Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/54d34901-c982-421f-a8cf-ef8c904f30e4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Shawn McCarthy

unread,
Jan 8, 2014, 10:59:43 AM1/8/14
to seleniu...@googlegroups.com
Lets say I have a LoginPage, will this tool create a method to signIn (which takes username, password, and clicks sign in button for example)? Or does this tool just take all the elements on the page, and create a method to interact with it individually ? 

Thank you!

Dmitry Zhariy

unread,
Jan 8, 2014, 4:37:37 PM1/8/14
to seleniu...@googlegroups.com

Hi Shawn,

The tools aims to record only the PageObject WebElements (locators). The output will be a PageObject skeleton with the list of web elements and other boilerplate code (including some generic methods).

At the moment, the tool does not generate PageObject methods (actions) which require a human intelligence to be created. On the other hand, tool can generate some actions which require only mechanic actions.

On the picture below, there is a method inside PageObject “VerifyExpectedElementsAreDisplayed”, which just make a method call for each declared WebElement and checks wherever the element is displayed. Such code can be generated.



Inline image 1

Note: the code highlight is not available at the current release (22 Dec 2013) and will be avaialbe in future releases. 

=======
~ Dmytro



On Wed, Jan 8, 2014 at 5:59 PM, Shawn McCarthy <shawn.m...@gmail.com> wrote:
Lets say I have a LoginPage, will this tool create a method to signIn (which takes username, password, and clicks sign in button for example)? Or does this tool just take all the elements on the page, and create a method to interact with it individually ? 

Thank you!


On Tuesday, January 7, 2014 7:38:22 AM UTC-7, Dmytro Zharii wrote:
Dear Selenium Users, 

I am glad to announce my open source pet project – SWD Page Recorder

The utility aims to: 
  • collect the WebElements in runtime
  • debug XPath/CSS locator even with Internet Explorer (as well as in any other supported web-browser) 
  • generate PageObject-classes on several languages: C#, Java, Ruby, Python. 


--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Best Regards,
Dmytro Zharii / Дима Жарий 
image.png

David

unread,
Jan 8, 2014, 4:58:06 PM1/8/14
to seleniu...@googlegroups.com
Looks promising. I'll try it out sometime. And I was just thinking of building something similar with similar and yet different feature set.

Now I may not have to, or I can build upon your work.

Shawn McCarthy

unread,
Jan 9, 2014, 9:49:35 AM1/9/14
to seleniu...@googlegroups.com
Awesome ! Thank you ! Looks cool.

David

unread,
Jan 24, 2014, 2:23:20 AM1/24/14
to seleniu...@googlegroups.com
Well I've tried it out briefly and this is a great tool with great potential. Thought I'd share some thoughts about what I had originally envisioned for a similar tool and how we may extend SWD Recorder to include features I envisioned (whether as part of official project or a fork). I probably do plan on working on that some time (maybe with pull requests if I get far) but in case I don't get to it yet:


Consider my blog post as my suggested enhancements to the tool.

David

unread,
Jan 24, 2014, 2:34:26 AM1/24/14
to seleniu...@googlegroups.com
Also, I see that the tool has option to start up a connection to RemoteWebDriver with specification for iPhone, iPad, Android. Any thoughts to expanding this tool like support of WebElement explorer for both web views/apps in iOS/Android as well as hybrid/native apps too? And thus page object generator for mobile apps too.


On Tuesday, January 7, 2014 6:38:22 AM UTC-8, Dmytro Zharii wrote:

Dmitry Zhariy

unread,
Jan 24, 2014, 7:43:43 AM1/24/14
to seleniu...@googlegroups.com
David, that's amazing. 

Just yesterday I've thought how can add Appium support for Page Recorder. 
I've did some experiments and realized that adding such requires a lot of work and partially changing the application architecture. 

On the other hand, mobile automation  is so hot nowadays. And Appium provides same interface for Android and iOS... So, I think I will try to add Appium support. That will require a time and lots of experiments and I think that would be a great feature. 

Now I am working on 2 new features which may come sooner. 
JavaScript Snippets – will allow to inject JavaScript code from Page Recorder to the running browser. 
I think I'll add the feature you've described “Inject Script by URL”.

WebElement Playground: will send Click/SendKeys and other commands to the located element from PageRecorder form. 

It has brilliant ideas I will consider for next features. 

~ Dmytro


--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

David

unread,
Apr 14, 2014, 9:06:58 PM4/14/14
to seleniu...@googlegroups.com
FYI, I just came across a similar tool recently, haven't evaluated it yet though. Thought I'd mention it

Dmitry Zhariy

unread,
Apr 15, 2014, 4:58:13 AM4/15/14
to seleniu...@googlegroups.com
Hi David, 

Thank you for sharing new information about the hot new tool ;)

I have tried the tool already... and what I would say: 

* It is well crafted. I was able to start it on Windows without any issues. It just works.
* The interactive element search looks much better than my implementation 
* It allows executing Groovy code inside the app

I think we are still a lot of not solved problems in the process of creating test automation scripts. But those tools which are being developed is a great step forward. 





Horst Waldorff

unread,
Jan 2, 2015, 10:37:27 AM1/2/15
to seleniu...@googlegroups.com
Hi,
your Tool looks very promising and we'd like to use it for our projects. However, a typical problem we face is that the iframes have to be switched for each element (search context), to be found correctly. The Page recorder does support this inside its GUI, but we'd need this functionality inside the templates - i.e. saving the iframe the Gui-Element is inside in with the element, for example as a field in your WebElementDefinition class. I think it would suffice to store the iframe that is currently selected as search context - very little extra work.

Another problem are frames inside frames. We always had to switch through the whole iframe hierarchy to find the element and it seems your code directly switches to the frame, currently. But i had no opportunity to test it yet. In this case, it would be most desirable to store the hierarchy of iframes.

Do you think this is possible? Would you like to implement this? Otherwise i'll try it on my own ;)

Best Wishes,
Horst


Dear Selenium Users, 

I am glad to announce my open source pet project – SWD Page Recorder
...

Dmytro Zharii

unread,
Jan 5, 2015, 11:21:08 AM1/5/15
to seleniu...@googlegroups.com
Hi Horst, 

Thank you for your request!
I haven't added the frame hierarchy path into the WebElementDefinition class. Still trying to figure out the best way to store this data. 
But... I've made the first steps for this feature. 

Now, using the button { }, it is possible to generate and copy a "SwitchTo..." code for the given selected frame. 
Please, check out new release when you would have a free time. Let me know what do you think. 





Kind regards, 
Dmytro


--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

sunny sachdeva

unread,
Jan 5, 2015, 10:44:50 PM1/5/15
to seleniu...@googlegroups.com
Dmytro,

I have started using your tool but land up in a small trouble.

I opened seleniumhq.org and tried to capture few elements. After right Click to capture the locator , when I hit Highlight button , the application threw error (attached in this mail).

Probably since its xpath I cant see correct xpath syntax.

Please help and let me know if i m missing anyting

Thanks
Sunny
Capture.JPG

Dmytro Zharii

unread,
Jan 5, 2015, 11:38:45 PM1/5/15
to seleniu...@googlegroups.com
Hi Sunny, 

You are the real Tester! 
I am working and testing Page Recorder for more than 1.5 years...
And I have never went through this (now obvious) scenario. And no one had reported about such issue. 

You have found a bug, which exists from the beginning of this project.
I have just added it to the bug tracker: https://github.com/dzharii/swd-recorder/issues/28

Before Highlighting or Testing an element, you need to select any element from the PageObject pane first (double click).

Video:

I will add an empty form validation for next release. 

Thank you, 
Dmytro



sunny sachdeva

unread,
Jan 6, 2015, 6:15:58 AM1/6/15
to seleniu...@googlegroups.com
Thanks Dmytro for the kind words.

I am clear now with the highlight and Test and is working as expected.[ This tool is awesome].

My other question is , by default this tool will capture xpath as a locator, If I wish to see their equivalents in other types. for example xpath --> CSS,  then could you please tell how can I do so. [ I tried to explore but could not get the solution]

Thanks
Sunny S

Horst Waldorff

unread,
Jan 6, 2015, 6:57:39 AM1/6/15
to seleniu...@googlegroups.com
Thank you for your response and effort :)

However, this modification does not really help me. I started doing a modification myself and added the Frame to the WebElementDefinition class (i had to use a new class, because i ran into a cycle at serialization). When an element is created, i simply fill the frame with that one, that is selected in the tool as search context. This should work in general, because you can only detect elements in the frame that you have selected anyway.
The reason i do this is because i need to access the frame in my template for code generation. I'm going for a class in my test code, that gets a locator and the containing frame (as string) - this way, the element will be able to switch into that frame automatically when an action is called, so that i can ignore the whole frame issue (i'll add a decorator that does the switching).

I tested the functionality with iframes inside iframes and it works well, great job! :)

Greetings,
Horst

sunny sachdeva

unread,
Jan 7, 2015, 10:48:06 AM1/7/15
to seleniu...@googlegroups.com
Dmytro,

How do I convert Xpaths to other locators in this tool?

Thanks
S

Dmytro Zharii

unread,
Jan 7, 2015, 11:43:14 AM1/7/15
to seleniu...@googlegroups.com
Hi Sunny,

In order to change the locator from XPath to CSS, you need to: 

1. Load the recorded element from the Page Object pane
2. Optionally: Test the locator using the tools at the bottom
3. Switch radio-button on the right from XPath to CSS on the left side
4. Enter new value into the CSS Selector field. Then you can use Testing tools to check if the new locator works.
5. Press the button "Update >>" in order to update the Page Object definition 

Here is the video:

In regard to your previous question about CSS selectors when you record the element with 
Web Element Explorer (inside the browser), now only XPath is supported. 
I am planning to add the feature "Suggested locators" into the Web Element Explorer, which would include CSS and other locators, 
in to the next release. That may take a several months. 

Thank you, 
Dmytro


Dmytro Zharii

unread,
Jan 7, 2015, 11:48:37 AM1/7/15
to seleniu...@googlegroups.com
Hi Horst,

I am glad you have solved the problem! 
You can submit a Pull Request at github, if you will. 
So that, the next releases of the Page Recorder will be compatible with your patches.

Thank you, 
Dmytro


Nikesh Jauhari

unread,
Jan 7, 2015, 3:05:50 PM1/7/15
to seleniu...@googlegroups.com
This is really good tool
I have started using this tool.

Good job !!!

Thanks,
Nikesh

sunny sachdeva

unread,
Jan 7, 2015, 10:40:52 PM1/7/15
to seleniu...@googlegroups.com
Thanks Dmytro for the video. This tool is really incredible and I can help you with the documentation.

Well I have one enhancement. Initially when we started we were blindly using Xpath, then when we started IE we could feel the pain and hence we had to do re-work of converting xpaths to CSS .

Can we add a kind of converter in this tool, something like

Thanks
Sunny

Dmytro Zharii

unread,
Jan 8, 2015, 1:48:32 AM1/8/15
to seleniu...@googlegroups.com
Hi Sunny 

Thank you for sharing the link to cssify. I've added it into my list ;)

Let me share back two of my favourite. Both work as a bookmarklets, so you can use it in any browser, includiong "old" IEs. 

SuperSelector
(The project page is at the bottom of the article)

- Generates optimized CSS selectors. Works inside IE. When activated, allows to use function $$( ... ) for debugging CSS selectors. 

MRI 
Comparable "old" tool, with pretty interface ;)
Works in IE6+ and has CSS Selectors suggestions.

Regarding to your request about adding XPath to CSS converter. 
Well, I had such idea earlier and I still did not rejected it, just postponed :D

The main reason why I am using XPath as a primary (and the single option for the browser recorder) is that I can uniquely identify any element inside any web page and pass it into the desktop recorder. 
It does not always work with CSS Selectors. Well... it works in most of the cases, but not always ;)


Thank you, I will think how I can implement your request. But, I cannot grantee that it will be done soon ;)

Regards, 
Dmytro 


sunny sachdeva

unread,
Jan 8, 2015, 11:17:01 PM1/8/15
to seleniu...@googlegroups.com
Thanks Dmytro. I have also bookmarked superselector.

Your tool looks very promising and may be one day it would take a shape of 1-stop solution, thats why suggested xpath-->css enhancements.

I am liking this tool and letting every one know about this in my company.

Will follow this thread to get more updates and thanks for your help

Also let me know if you want any kind of help in documentation(english only).

Regards
Sunny

David

unread,
Jan 9, 2015, 3:46:59 PM1/9/15
to seleniu...@googlegroups.com
I agree with Dmytro's comment about XPath over CSS as default location method to identify locators uniquely. You'll see/experience the same issue if you try with Firefox tools like FirePath and Firefinder. The CSS selector option of those tools will return a result that quite often (half the time or more, depending on the complexity of the app you are testing) matches multiple elements. Try locating same element using XPath and you will get a unique identifier. I would assume you would get similar result with SuperSelector and other bookmarklet based CSS tools. CSS, as of version 3, just isn't designed as well as XPath syntax to uniquely identify elements despite it's speed advantage over XPath.

And for those that use the locator values, whether XPath or (converted to) CSS, from SWD Recorder "as is", that's just bad practice. No element finder tool ever (or rarely) returns the optimal locator value, except for simple locators (that have IDs, unique names or classes). So regardless of SWD Recorder or Firebug tools, etc. one should always use the element finder as a starting point, then use the tool to "test" modifying/optimizing the locator that you desire and see if it still works or not. As such, one can do the same for CSS. Start with find by XPath, then manually convert & test as CSS, using cssify or manually doing it with your head. If one can't do the conversion w/o cssify or another tool, you have much to learn, and should learn to do it manually to be a good automation tester. Don't rely on tools solely to do your job.

Mike Norris

unread,
Jan 20, 2015, 10:45:24 AM1/20/15
to seleniu...@googlegroups.com
Dmytro

I love the concept behind SWD, as a new(ish) learner on Selenium, I find locating objects a big challenge
- especially on IE for some reason

I have downloaded SWD and put the IE Web Driver exe in the same SWD folder

I am testing a simple site for the UK called www.diy.com 

a. I can start IE Driver from SWD

b. I can get basic things to work 
- such as WebDriver playground

c. I can't the Switch To (Search Context) to work, and so I guess WebElement Explore won't work either?

- when I refresh the SWD tool I always get an error

- the SWD tool recognises the window (the title changes to say DIY at B&Q

- the Frame is unpopulated, I never see DefaultContent or any iframe name (screenshot)
- I don't believe the site relies on iframes anyway

d. NB In my C# code very simple locators work fine in FireFox and Chrome, the same locators are not found when running IE web driver

hence ... I am trying to use SWD to test what locators do work for that browser

I've attached the screenshot of the error I get in SWD when accessing http://www.diy.com 

Can you tell me what I did wrong?
SWD Error.png

Dmytro Zharii

unread,
Jan 20, 2015, 10:30:06 PM1/20/15
to seleniu...@googlegroups.com
Hi Mike, 

I am sure you were faced with the "Internet Explorer 11 Update issue" which globally affects the Selenium Webdriver in that configuration. 

Please read more how to solve this issue here:

>>>>>>>>>>>>>>>>
@Timofey's fix worked for me.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_DISABLE_INTERNAL_SECURITY_MANAGER]
"iexplore.exe"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_DISABLE_INTERNAL_SECURITY_MANAGER]
"iexplore.exe"=dword:00000001
<<<<<<<<<<<<<<<<<<<<

The proposed Windows registry workaround will solve the issues with Page Recorder and also (possible) with your tests.

Here is a short video how to alter your Windows Registry: 


Kind regards,
Dmytro

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Jim Evans

unread,
Jan 21, 2015, 1:02:41 AM1/21/15
to seleniu...@googlegroups.com
Please realize, and I cannot stress this enough, if you hack your registry this way, you are leaving your computer open to potential security vulnerabilities with IE. The IE team at Microsoft has asked me to actively discourage this workaround.

Sridhar Easwaran

unread,
Mar 6, 2015, 7:25:12 AM3/6/15
to seleniu...@googlegroups.com
So COOL :) :) thanks a lot :)

vbs kumar

unread,
Nov 10, 2015, 10:23:39 PM11/10/15
to Selenium Users
HI Zharii,

Its really great work achievement, this is the opportunity for selenium learners to find element locators in an easy way.

in my organization when i tried to download SWD pagerecorder from GITHUB,due to security concerns it failing to download the swdpagerecorder.exe.

but i can able to download source code , is there any to build to get swdpage recorder using source code?


Just For Automation

unread,
Nov 14, 2015, 11:45:02 AM11/14/15
to Selenium Users

Hello,

i gone through videos and GIT hub, what i understood it needs .Net Framework 4 and above to run this page recorder tool.

please help me to get clarifications,

1. My machine having .net framework 4(client profile) but in the c drive it is showing only framework 3.5 , how will i configure in the config file?
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

2. we are using few systems are windows XP and NDG machines. so where and all i need to change if i want use this tool

3.will it support .net framework 3.5 or not?

4.when i try to launch SwdPageRecorder.exe, nothing is appearing...

5. finally, what is the required environment to support this tool? and where and all need to change if required.

Dmytro Zharii

unread,
Nov 14, 2015, 4:36:13 PM11/14/15
to seleniu...@googlegroups.com
Hi Ravi, 

Thank you for your interest in PageRecorder. 
For now, Windows 7 + .Net Framework 4 (Full) and versions above are supported (https://www.microsoft.com/en-us/download/details.aspx?id=17851

If your current environment does not match to minimal system requirements, you can always run SWD PageRecorder inside free virtual machines, provided by Microsoft:

Thank you, 
Dmytro

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Just For Automation

unread,
Nov 25, 2015, 12:07:17 PM11/25/15
to Selenium Users
Thank you Dmytro,

Due to security reasons, am not able to download the "SwdPageRecorder_v2.46.2015.06.05.zip" file, because this zip file contains '.exe' file ,so blocking to download.

but 'Source Code,ZIP' was got downloaded , is there any approach to make it work using this source code. if yes ,please guide me to do.

Thanks,
Ravi

Dmytro Zharii

unread,
Nov 25, 2015, 11:29:31 PM11/25/15
to seleniu...@googlegroups.com
Hi Ravi, 

The build process will require you to download even more exe-files and dll files from the internet, such as Visual Studio 2015 and Nuget packages. 
You will spend the time, but the result might worth the effort. 
If you organization restricts the employees to download exe-files from the internet, maybe that would be better not to do so. 

Thank you, 
Dmytro 



David

unread,
Nov 25, 2015, 11:49:50 PM11/25/15
to Selenium Users
Ravi, I don't suppose your organization also blocks such files if you try to transfer them to your computer from say a USB drive, etc.? Or you can't even use USB flash drives? Perhaps you should download at home and transfer the file over at work using USB drive.

Just For Automation

unread,
Nov 28, 2015, 12:13:33 PM11/28/15
to Selenium Users
Thank you,

i have done setup in my home system, and tried to get CSS path but it always showing xpath. is it possible to get CSS locator ?

what is '<<Read Prop' button ? what it does exactly..i dont see any response from the action.

will it capture element property other than xpath ?

Serguei Kouzmine

unread,
Nov 28, 2015, 3:56:16 PM11/28/15
to Selenium Users
Hello

In my fork of
https://github.com/sergueik/swd-recorder
I added

getCssSelectorOF and the necessary c# code.
Dmytro merged my pull request, it will appear in the master branch.
-  see change 

2b9230a

Let me know if it works for you

Thanks
Serguei Kouzmine

Just For Automation

unread,
Dec 24, 2015, 9:20:06 PM12/24/15
to Selenium Users
Thank you Serguei, yes i see css locator.

i am facing one more issue with Firefox binary ,i set the path of it in PATH system variable.

however, still swd tool throwing error to set path of mozilla binary , am i missing anything here?

Thanks,
Ravi

Serguei Kouzmine

unread,
Dec 25, 2015, 2:42:05 PM12/25/15
to Selenium Users
Hello Ravi,
Check if ./SwdPageRecorder/SwdPageRecorder.WebDriver/start_selenium_server.bat is able to run standalone , patch if needed and rebuild the project if changed,

Thanks

Serguei Kouzmine

Just For Automation

unread,
Dec 28, 2015, 11:25:41 AM12/28/15
to Selenium Users
Hello Serguei,

i have tried with start_selenium_server.bat and no luck , what patch i can apply for it?

how selenium will identify whether it is FF is binary or installed in the system?

by defining the binary file path of FF and verified but nothing was happened.

waiting for your valuable solution.

Thanks,
Ravi

Keshav Ramteerth

unread,
Dec 28, 2015, 12:04:39 PM12/28/15
to Selenium Users
HI Dmytro,
                     Do we need to do any configuration before for SWD page recorder , as i hav downloaded the SWD , extracted zip folder and installed on my system  , but clicking on Start button for the browser is throwing me error like below screen shot.
Kindly look into it , help if i am doing anything wrong.
,
Auto Generated Inline Image 1

Dmytro Zharii

unread,
Dec 29, 2015, 12:45:17 AM12/29/15
to seleniu...@googlegroups.com
Hi Keshav, 

Thank you for reporting this issue. The problem was fixed in the recent and latest release. 
Please, download and try the latest version (28 DEC 2015 v2.48):


Kind Regards, 
Dmytro




--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Just For Automation

unread,
Dec 30, 2015, 8:27:17 AM12/30/15
to Selenium Users
Can anyone help me to sort out this problem?

Peter Gale

unread,
Dec 30, 2015, 9:56:55 AM12/30/15
to seleniu...@googlegroups.com
SWD Page Record is not part of the official Selenium group of products, for which this group exists, so you might have more response contacting the SWD developers direct ... perhaps through the issues option on their Github page.


Date: Wed, 30 Dec 2015 05:27:16 -0800
From: chinnu...@gmail.com
To: seleniu...@googlegroups.com
Subject: [selenium-users] Re: SWD Page Recorder – records WebElements and generates PageObject classes (Announcement)
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

Serguei Kouzmine

unread,
Dec 30, 2015, 10:24:12 PM12/30/15
to Selenium Users
Hello Ravi,

I infer You have  installed Firefox under custom location on your system
Does the error also show if
Firefox is installed to one of standard locations like "C:\Program Files\Mozilla Firefox\firefox.exe"/ "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"?

I did reproduce the error with the release https://github.com/dzharii/swd-recorder/releases/tag/v2.48-2015.12.28 in Vagrant box.

the start_selenium_server.bat begins to successfully launch Firefox after modifying it like below:
```
@set IE=-Dwebdriver.ie.driver="%cd%\IEDriverServer.exe"
@set CHROME=-Dwebdriver.chrome.driver="%cd%\chromedriver.exe"
@set PHANTOM=-Dphantomjs.binary.path="%cd%\phantomjs.exe"

@set SELENIUM_SERVER_EXE=selenium-server-standalone-2.48.2
@set SELENIUM_FIREFOX_OPTION=-Dwebdriver.firefox.bin="C:\\users\\vagrant\\Desktop\\Firefox\\firefox.exe"
start "%SELENIUM_SERVER_EXE%" java %PHANTOM% %CHROME% %IE% %SELENIUM_FIREFOX_OPTION% -jar %SELENIUM_SERVER_EXE%
```
(edit the SELENIUM_FIREFOX_OPTION= line  with your custom location, following the syntax)

However SWD still ends up with the dialog. I am looking at the issue,

If you need switch between different versions frequently there is a code we can merge into SWD
```
FirefoxProfile profile = new FirefoxProfile();
 profile.SetPreference("webdriver.firefox.bin", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
 IWebDriver driver = new FirefoxDriver(profile);
```

When I add this i will update this mail thread.


Happy New Year and holidays,

Serguei Kouzmine
Screenshot from 2015-12-30 22:23:09.png

Serguei Kouzmine

unread,
Dec 30, 2015, 10:32:10 PM12/30/15
to Selenium Users
Hello again Ravi

By modifying start_selenium_server.bat a little further I was able to  enable SWD launch it :


```
@set IE=-Dwebdriver.ie.driver="%cd%\IEDriverServer.exe"
@set CHROME=-Dwebdriver.chrome.driver="%cd%\chromedriver.exe"
@set PHANTOM=-Dphantomjs.binary.path="%cd%\phantomjs.exe"

@set SELENIUM_SERVER_EXE=selenium-server-standalone-2.48.2
@set SELENIUM_FIREFOX_OPTION=-Dwebdriver.firefox.bin="C:\\users\\vagrant\\Desktop\\Firefox\\firefox.exe"
java %PHANTOM% %CHROME% %IE% %SELENIUM_FIREFOX_OPTION% -jar %SELENIUM_SERVER_EXE%

```
basically in addition to providng the webdriver.firefox.bin setting to java, I  removed the call to launch a separate cmd window, and as the screenshot from my vagrant box illustrates, it get things done. We will still need to address the custom location limitation, so please stay tuned

Serguei Kouzmine
Screenshot from 2015-12-30 22:28:32.png

Serguei Kouzmine

unread,
Dec 30, 2015, 10:46:12 PM12/30/15
to Selenium Users

Hello Ravi

By modifying the start_selenium_server.bat a little further I made it able to run with Firefox server,

1. added jar extension to the line @set SELENIUM_SERVER_EXE=selenium-server-standalone-2.48.2.jar
2. removed the prefix start %% from the java command to avoid argument list is too long limitation
leaving simple

java %PHANTOM% %CHROME% %IE% %SELENIUM_FIREFOX_OPTION% -jar %SELENIUM_SERVER_EXE%


I also downloaded the selenium-server-standalone-2.48.2.jar and put it locally into SWD folder,

This works - see the screen shot

```
@set IE=-Dwebdriver.ie.driver="%cd%\IEDriverServer.exe"
@set CHROME=-Dwebdriver.chrome.driver="%cd%\chromedriver.exe"
@set PHANTOM=-Dphantomjs.binary.path="%cd%\phantomjs.exe"

@set SELENIUM_SERVER_EXE=selenium-server-standalone-2.48.2.jar

@set SELENIUM_FIREFOX_OPTION=-Dwebdriver.firefox.bin="C:\\users\\vagrant\\Desktop\\Firefox\\firefox.exe"
java %PHANTOM% %CHROME% %IE% %SELENIUM_FIREFOX_OPTION% -jar %SELENIUM_SERVER_EXE%
```

The error with launching Selenium binary directly and providing input and code  for custom locations is underway  - please stay tuned

Serguei Kouzmine

Just For Automation

unread,
Dec 30, 2015, 11:37:23 PM12/30/15
to Selenium Users
Thank you,Serguei .

i did the same way ,what you mentioned in the below...but i did mistake i used single '\' instead of double '\\'. thanks for your information any how i will check and let you know.

regarding switching different versions really help for any one. yesterday i went to firefoxprofile,binary on selenium.google and trying to understand to place in a better way.

Just For Automation

unread,
Jan 4, 2016, 11:36:01 AM1/4/16
to Selenium Users
Yes, you are correct...working with stand alone server.

am keen to see your updates on firefox profile option feature...

vbs kumar

unread,
Mar 21, 2016, 11:27:40 AM3/21/16
to Selenium Users
Hello Mythro,

Happy to work with SWD tool,

i have an issue while locating and adding the elements on IFRAME,the popup window is displaying within the IFRAME,so that we are not able to add that located element

and not able to provide any descriptive name,you can see the attachment.

When i focus on a link, it displays login window which is IFRAME,here we have this issue.

may be we need to modify co-ordinates of popup by picking IFRAME co-ordinates,instead of webpage.


<iframe
id="clientCoFrame
PopupInFrame.png

Dmytro Zharii

unread,
Mar 24, 2016, 11:29:25 PM3/24/16
to seleniu...@googlegroups.com
Hello, 

I doubt I will be ever able to solve this issue with frames. 
For such blocking edge cases, Page Recorder has a manual workaround: 

When you press Ctrl + RightClick on the element in frame Page Recorder will extract its XPath and put into the field highlighted in orange: 


Inline image 1


So that you can manually create a pageobject element using the form above. It is not as convenient as adding elements from the browser-side form, but it should work. 


-Dmytro

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

vbs kumar

unread,
Jun 8, 2016, 12:48:58 PM6/8/16
to Selenium Users
Hello Dmytro,

Will it support GWT application this tool? 

i started to capturing login window,but after poping the window(popup window) i didn't able to enter element description and the xpath and css not captured username instead it shows all div tags with different nodes.

after i did refresh in the tool, it was not loaded the new page and not response from the tool.

is there any alternative solution while working with GWT application?

Dmytro Zharii

unread,
Jun 9, 2016, 1:05:56 AM6/9/16
to seleniu...@googlegroups.com
Hi Vbs, 

GWT applications are tricky to automate and I need more context to reproduce the issue, such as screenshots, html snippets and logs (located in the swd-recorder logs folder). 
You might either create a new public issue here:


or send this information in private: 
dzhariy _at_sign gmail_dot_com

Kind regards, 
Dmytro

 

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

vbs kumar

unread,
Jun 9, 2016, 10:02:53 PM6/9/16
to Selenium Users
Thank you,

I am afraid of sharing the source code or screen shot because i dont have permissions to share anything.

but after observations,
1.when i focused on GWT application(1st time) it captured html source and at the same time it seems lost wedriver secession or not able to continue the same Cookie  session

2.i manually loaded google page in the same browser window and i did refresh in the tool but no response means not loaded google source into the tool.after this i came to know webdriver session is ended.

3. if i want to continue with the tool, i have to close and reopen ,then its possible to capture normal web pages.

4.When i used F12 on the GWT,application allowing me to  see all properties of element, username and password comes under a frame but where as when i use tool it captured absolute path of the element without taking any class or some other properties.

5.If possible, please,share tips how i can use this tool to capture elements from GWT, yes definitely this helping me to capture properties on other applications.

Regards,
VBS

Dharshini Damodaran

unread,
Aug 4, 2016, 1:27:28 PM8/4/16
to Selenium Users
Hi Dmytro..

Its glad that I have figured this tool, it sounds interesting. 

I have downloaded the zip file and tried to start PsExec Application(from swd-recorder-master\testing); Getting an error 'Windows cannot access the device, file. You may not have appropriate permission..' even though I tried running as Administrator too.

Could you please help on proceeding further. Thanks



Dmytro Zharii

unread,
Aug 4, 2016, 8:44:47 PM8/4/16
to seleniu...@googlegroups.com
Hi Dharshini, 

Please use release distributive (SwdPageRecorder_v2.53.1.2016.07.02.zip): 

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/78c31677-4ceb-429a-a2b4-bcaef2728705%40googlegroups.com.

Dharshini Damodaran

unread,
Aug 5, 2016, 12:35:56 PM8/5/16
to seleniu...@googlegroups.com
Thank you..It works!

To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

Amit

unread,
Nov 3, 2016, 11:36:53 AM11/3/16
to Selenium Users
This is great tool!!
Thank you..It works!

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/epneoHaOymk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

Selenium Hiker

unread,
Sep 29, 2017, 2:28:48 AM9/29/17
to Selenium Users
Hi Dmytro,

First of all great thanks for this tool ,I am usinf Winodws 10 and Firefox version as 55.0.3 ,today i downloaded your software ,but 1 issue i am facing in your tool...thats is

This tool able to identify frames but unable to find Red color play button of youtube video,How can i do that.Please let me know

Url i am testing is http://utubehits.com/ 

pwd:- Tapan@321

I have created a short video with the issue i am facing ,if you can suggest me solution and also  implement this feature in Your tool ,will be highly grateful

Johannes Hoelzl

unread,
Sep 29, 2017, 6:57:00 AM9/29/17
to Selenium Users
Hi Selenium Hiker´

I used our own free tool Silk WebDriver to reproduce your scenario.

This is the script I got. The script might still need better sync and stabilization, but should help you going forward. So the code element for the play button you are missing is probably:

        driver.findElement(By.className("ytp-large-play-button")).click();

Btw: It works after a hackish sleep of 3000ms, but not with an explicit wait for me. So seems that the button is there from the start but changes while after parts of the video are loaded.

Regards



import java.util.concurrent.TimeUnit;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class SilkWebDriverRecordingFF {

    private WebDriver driver;

    @Before
    public void setup() {
        //TODO: Replace property with path to your geckodriver.exe
        System.setProperty("webdriver.gecko.driver", "C:\\Program Files (x86)\\Silk\\Silk WebDriver\\ng\\WebDriversSWD\\Windows\\Gecko\\0.18.0\\geckodriver.exe");
        driver = new FirefoxDriver();
        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    }

    @Test
    public void myTestCaseName() throws InterruptedException {
        driver.get("http://utubehits.com/");
        driver.findElement(By.name("login")).sendKeys("wealthy..."); // removed full email
        driver.findElement(By.name("pass")).sendKeys("Tapan@321");
        driver.findElement(By.name("connect")).click();
        driver.findElement(By.xpath("(//a[text()=\"YouTube Views\"])[2]")).click();
        driver.findElement(By.id("title_39206")).click();
        driver.findElement(By.id("btn_39206")).click();
        driver.switchTo().frame(driver.findElement(By.id("iframe")));
        WebElement skip0 = driver.findElement(By.linkText("skip"));
        Assert.assertEquals("skip", skip0.getText());
        driver.switchTo().parentFrame();
        driver.switchTo().frame(driver.findElement(By.id("iframe")));
        driver.switchTo().frame(driver.findElement(By.id("ytPlayer")));
        // manual sync needed
        Thread.sleep(3000);
        //new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.className("ytp-large-play-button")));
        driver.findElement(By.className("ytp-large-play-button")).click();
        driver.switchTo().parentFrame();
        driver.switchTo().parentFrame();
        Thread.sleep(5000); // play duration of video
    }

    @After
    public void tearDown() {
        if (driver != null) {
            driver.quit();
Message has been deleted
Message has been deleted

Selenium Hiker

unread,
Sep 29, 2017, 6:42:26 PM9/29/17
to Selenium Users
Hi Johannes,

Thanks a ton for your reply ..Highly appreciated,now the problem is trivial,if you can help,Below code pasted working fine in Debug mode of eclipse,but when i try Normal mode,I get below error,I even increased thread.sleep from 3000 to 12000 but still fails at Normal mode.

In debug mode i put breakpoint at line 45 and 46 and when i do step over at eclipse,Video plays :(

package basic.basic;


import java.util.Iterator;

import java.util.List;

import java.util.Set;

import java.util.concurrent.TimeUnit;


import org.openqa.selenium.By;

import org.openqa.selenium.JavascriptExecutor;

import org.openqa.selenium.Keys;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

import org.openqa.selenium.interactions.Actions;

import org.openqa.selenium.support.CacheLookup;


import junit.framework.Test;

import junit.framework.TestCase;

import junit.framework.TestSuite;


/**

 * Unit test for simple App.

 */


public class AppTest 

    extends TestCase

{

public static void main(String[] args) throws InterruptedException {

            

            System.setProperty("webdriver.chrome.driver","C://Sprints//chromedriver_win32//chromedriver.exe");

        //System.setProperty("webdriver.gecko.driver","C://Sprints//geckodriver-v0.19.0-win64//geckodriver.exe");

            WebDriver driver = new ChromeDriver();

       // WebDriver driver = new FirefoxDriver();

        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);

            driver.get("http://utubehits.com/");

            driver.findElement(By.name("login")).sendKeys("wealthyta...@gmail.com");

            driver.findElement(By.name("pass")).sendKeys("Tapan@321");

            driver.findElement(By.name("connect")).click();

            driver.findElement(By.linkText("YouTube Views")).click();

            driver.findElement(By.linkText("Watch Video")).click();

            System.out.println(driver.getTitle());

            //driver.switchTo().parentFrame();

            List<WebElement> frameElements = driver.findElements(By.cssSelector("iframe[id='iframe']"));

            System.out.println(frameElements.size());  //HERE I PUT BREAK POINT

            driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[id='ytPlayer']")));//HERE I PUT BREAK POINT

            Thread.sleep(3000);

            driver.findElement(By.cssSelector("button[class='ytp-large-play-button ytp-button']")).click();

Message has been deleted
Message has been deleted

Selenium Hiker

unread,
Oct 2, 2017, 3:17:09 PM10/2/17
to Selenium Users
Just Updating -- This has been solved,using below code change,Thanks 

 Thread.sleep(4000);

        driver.switchTo().frame("iframe").switchTo().frame("ytPlayer");

        driver.findElement(By.cssSelector("button[class='ytp-large-play-button ytp-button']")).click();
        
        Thread.sleep(34000);

Baskar chinnakonda

unread,
Mar 8, 2019, 3:11:32 AM3/8/19
to Selenium Users
I am facing issue in highlight the checkbox controls.... anyone is facing the similar issue with swd recorder 3.13 version?
Reply all
Reply to author
Forward
0 new messages