ebrehault / resurrectio

CasperJS test recorder Chrome extension
GNU General Public License v2.0
721 stars 106 forks source link

Not recording all event like click, href for links etc #9

Open ivikash opened 10 years ago

ivikash commented 10 years ago

I am facing some problems in using the chrome extension. Firstly not all my events are getting recorded, like the clicks, hrefs for links, and many a times its shows me the few lines and it never reaches to a state to generate the run functions.

Secondly the other issue is, its has casper.start but with casperjs test, instantiating a new env is not required so I think, this can be removed.

Also, I plan to use this with SpookyJs so that I can drive with Node, and it generates codes with selectXpath, which I think isnt available yet in Spooky. bug filed in spooky, so is there any work around for that.

ebrehault commented 10 years ago

Regarding your recording problems, if yoy can provide an example (on http://jsfiddle.net/ or anywhere), I will be happy to have a look.

Regarding XPath, there is no workaround for now. Most part of time, we try to use CSS selectors instead of Xpath, but in some cases, XPath is just the best (or only) way to go.

ivikash commented 10 years ago

Thanks @ebrehault, I think instead of a jsfiddle it would be easier for me to explain through a 2-min screencast As you can see, I am recording quiet a bunch of events, like screenshots, text, location, clicks etc. but the code generated is not complete and also it never reached to a state to generate the casper.run statement.

Also, before the screencast, I made sure sure that the cache, cookies etc are clear so that its not the memory issues. Along with that, once it did record some clicks in the past, but small thing I could assume was, it doesnot understand the difference between clicks on div and buttons. Moreover how to work with input fields and their focus?

Adding to that, I am not able to drive it through node. I tried to work with SpookyJs but that doesnot support selectXPath and few others as of yet. So do you have any suggestions, how can I achieve a state to generate test conditions from resurrectio and run it from node.

Lastly, if everything works out well, this would be a super awesome chrome extension for front end testing. Awesome effort :+1:

ebrehault commented 10 years ago

well my advice is to first try with a simpler scenario that does work, and enrich it step by step to see when the problem occurs

ivikash commented 10 years ago

Well, I did try that, and I think it breaks when I start adding test cases for links.

On Thu, Dec 12, 2013 at 3:53 PM, Eric BREHAULT notifications@github.comwrote:

well my advice is to first try with a simpler scenario that does work, and enrich it step by step to see when the problem occurs

— Reply to this email directly or view it on GitHubhttps://github.com/ebrehault/resurrectio/issues/9#issuecomment-30404416 .

thinkstylestudio commented 9 years ago

@ivikash @ebrehault does the text within the link contain any html for example. <a href="http://google.com >Text to click <br> does it include any html like the br here?</a> I'm running into an issue regarding that. The xpath on anchor tags looks at the text inside the anchor tags and the is stripped out instead of escaped on output. I'm wondering if your scenario is similar?

michelpa commented 9 years ago

I think i've got the same issue:

here is the html code:

<a href="/sub/param/"><i class="fa fa-wrench"></i><span>Param</span></a>

and here the xpath that is recorded and does not work:

x("//a[normalize-space(text())='Param']")

If the a tag contains only text it's ok but not if it is html.

The correct xpath should be :

$x("//a/span[normalize-space(text())='Param']")

EDIT:

my bad, it works with the master branch as it use a css selector