Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ivikash opened this issue Dec 7, 2013 · 6 comments
Open

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

ivikash opened this issue Dec 7, 2013 · 6 comments

Comments

@ivikash
Copy link

ivikash commented Dec 7, 2013

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
Copy link
Owner

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
Copy link
Author

ivikash commented Dec 12, 2013

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 👍

@ebrehault
Copy link
Owner

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
Copy link
Author

ivikash commented Dec 12, 2013

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//issues/9#issuecomment-30404416
.

@thinkstylestudio
Copy link
Contributor

@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
Copy link

michelpa commented Oct 2, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants