You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this feasible? We use jQuery a lot. Add Location Strategy was very useful to us in the front. But can the jQuery support be brought back to Selenium2?
The removal of jquery or actually just sizzle. Is a design decision by the webdriver team. As such it's upstream from S2L. I'm not against shoe horning it back in from s2l but it will be just that, a shoe horn. Because this really needs to be implemented in the webdriver (server).
If we do it from s2l I think the main issue you would have is the implicit wait functionality would probably not work at all. And we would either require the user to write the JavaScript (not good) or agree on what we want to expose ie just sizzle selectors? What about jquery filters etc...
If the above is acceptable then I would be happy to implement it. (should
Be fun :)
Of course if anybody else has other ideas feel free chime in. :)
Yes Jeremy, I agree that this is something that webdriver should have a support for. Add Location Strategy was actually contributed by my colleague Radek in Selenium1Lib which is like super duper helpful as we use jQuery a lot in our app and these tests.
I just opened a ticket with webdriver folks and see if there is any possiblity of support JQuery in the webdriver as I know there is definitely groups of people who could benefit from this.
I don't know if this request will be considered but anyways knowing you can help bringing it back to Sel2Lib is helpful.
Also like you mentioned , if anyone has better suggestions on getting jQuery into Sel2Lib, please chime in..
ok well I can look into developing something. It might take a couple of weeks as I'm pretty slammed with projects right now. I can however give you some quick and dirty code sample that may help you get started / code something up in the mean time.
Here is a very simplistic execute jQuery style function.
def _execute_jquery(self, script, *args):
'''basically just executes a script, and if it fails, loads jquery and
tries the script again'''
from selenium.common.exceptions import WebDriverException
browser = self._current_browser()
logger.info ("execute jquery with script %s" % script)
try:
logger.info("executing script %s" % (script))
retval = browser.execute_script(script, *args)
except WebDriverException:
self._load_jquery()
retval = browser.execute_script(script, *args)
if retval:
logger.info( "got retval of %s" % (retval))
break
logger.info("returning value")
return retval
So basically you just pass in the jquery function that you want to call, like:
$(.some_class).filter('visible').get(1);
or whatever. The _execute_jquery function above, if it receives and error will attempt to load jQuery and then re-execute the script.... no need to load jQuery if you application already supports it. But to load jQuery from a local file the function would look like:
Hope that is enough to get you started... like I said I can take this up...I'll look to fully reproduce the add location strategy keyword, but do to my current workload it may take a while.
Thank you so much !!!
will look into the interim solution you provided.
Thank you
Hema
On Jul 24, 2012 10:40 PM, "Jeremy Johnson" < reply@reply.github.com>
wrote:
ok well I can look into developing something. It might take a couple of
weeks as I'm pretty slammed with projects right now. I can however give
you some quick and dirty code sample that may help you get started / code
something up in the mean time.
Here is a very simplistic execute jQuery style function.
def _execute_jquery(self, script, *args):
'''basically just executes a script, and if it fails, loads jquery
and
tries the script again'''
from selenium.common.exceptions import WebDriverException
browser = self._current_browser()
logger.info ("execute jquery with script %s" % script)
try:
logger.info("executing script %s" % (script))
retval = browser.execute_script(script, *args)
except WebDriverException:
self._load_jquery()
retval = browser.execute_script(script, *args)
if retval:
logger.info( "got retval of %s" % (retval))
break
logger.info("returning value")
return retval
So basically you just pass in the jquery function that you want to call,
like:
$(.some_class).filter('visible').get(1);
or whatever. The _execute_jquery function above, if it receives and error
will attempt to load jQuery and then re-execute the script.... no need to
load jQuery if you application already supports it. But to load jQuery
from a local file the function would look like:
Hope that is enough to get you started... like I said I can take this
up...I'll look to fully reproduce the add location strategy keyword, but do
to my current workload it may take a while.
Cheers,
Jeremy
Reply to this email directly or view it on GitHub:
HI Jeremy,
Hope you are doing great. So we did not have time to try this out at our end. But I just wanted to check with you on if you would have time soon to look into putting back location strategy back into Sel2Lib. Please advice.
Yeah I plan on doing it. However I'm not sure when I will get the chance. :( I'm pushing hard for another deadline next week at work. Hopefully after that I'll have some time. I'll keep you posted it may be a few weeks.
Jeremy
On Aug 23, 2012, at 11:10 AM, hemakannan wrote:
HI Jeremy,
Hope you are doing great. So we did not have time to try this out at our end. But I just wanted to check with you on if you would have time soon to look into putting back location strategy back into Sel2Lib. Please advice.
Thank You
Hema
—
Reply to this email directly or view it on GitHub.
Yeah I plan on doing it. However I'm not sure when I will get the chance.
:( I'm pushing hard for another deadline next week at work. Hopefully after
that I'll have some time. I'll keep you posted it may be a few weeks.
Jeremy
On Aug 23, 2012, at 11:10 AM, hemakannan wrote:
HI Jeremy,
Hope you are doing great. So we did not have time to try this out at our
end. But I just wanted to check with you on if you would have time soon to
look into putting back location strategy back into Sel2Lib. Please advice.
Thank You
Hema
—
Reply to this email directly or view it on GitHub.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/77#issuecomment-7960847.
My team just finished a library that wraps jquery functions for use with Selenium. We just finished our first release, but plan on wrapping ALL of jquery's functions. This library makes it easy to use jquery from your Selenium tests in C#. It makes for MUCH cleaner looking tests. Here's the source code: https://github.com/AcklenAvenue/JQSelenium
That looks really nice for java/c# but it would require binding your library to python (and other languages) and then again to robot framework (since it's written in python). A better approach would be to support the way it use to work in selenium1 by allowing jquery= selectors to be used throughout the existing selenium routines.. Which shouldn't require any binding changes at all?
I am not sure if this would work for my request. Jeremy, any updates on your end for this jquery support ?
My QA team also needs support for Sizzle (or jQuery), otherwise we will have to rewrite a substantial amount of our tests to use xpath (not-desired) or hope there is a static ID further up the tree we can reference. What is the status of this issue?
My QA team also needs support for Sizzle (or jQuery), otherwise we will
have to rewrite a substantial amount of our tests to use xpath
(not-desired) or hope there is a static ID further up the tree we can
reference. What is the status of this issue?
Thanks,
Rob
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/77#issuecomment-15420946
.
Activity
j1z0 commentedon Jul 19, 2012
The removal of jquery or actually just sizzle. Is a design decision by the webdriver team. As such it's upstream from S2L. I'm not against shoe horning it back in from s2l but it will be just that, a shoe horn. Because this really needs to be implemented in the webdriver (server).
If we do it from s2l I think the main issue you would have is the implicit wait functionality would probably not work at all. And we would either require the user to write the JavaScript (not good) or agree on what we want to expose ie just sizzle selectors? What about jquery filters etc...
If the above is acceptable then I would be happy to implement it. (should
Be fun :)
Of course if anybody else has other ideas feel free chime in. :)
hemakannan commentedon Jul 19, 2012
Yes Jeremy, I agree that this is something that webdriver should have a support for. Add Location Strategy was actually contributed by my colleague Radek in Selenium1Lib which is like super duper helpful as we use jQuery a lot in our app and these tests.
I just opened a ticket with webdriver folks and see if there is any possiblity of support JQuery in the webdriver as I know there is definitely groups of people who could benefit from this.
I don't know if this request will be considered but anyways knowing you can help bringing it back to Sel2Lib is helpful.
Also like you mentioned , if anyone has better suggestions on getting jQuery into Sel2Lib, please chime in..
Thank You so much Jeremy for getting back.
Hema
hemakannan commentedon Jul 19, 2012
Hi Jeremy, so here is the answer to supporting jQuery in webdriver: https://groups.google.com/forum/?fromgroups#!topic/selenium-users/RK0KqX_QPT4
Its not happening.
hemakannan commentedon Jul 25, 2012
Jeremy, any help on this please?
Hema
j1z0 commentedon Jul 25, 2012
ok well I can look into developing something. It might take a couple of weeks as I'm pretty slammed with projects right now. I can however give you some quick and dirty code sample that may help you get started / code something up in the mean time.
Here is a very simplistic execute jQuery style function.
So basically you just pass in the jquery function that you want to call, like:
or whatever. The _execute_jquery function above, if it receives and error will attempt to load jQuery and then re-execute the script.... no need to load jQuery if you application already supports it. But to load jQuery from a local file the function would look like:
Hope that is enough to get you started... like I said I can take this up...I'll look to fully reproduce the add location strategy keyword, but do to my current workload it may take a while.
Cheers,
Jeremy
hemakannan commentedon Jul 25, 2012
Thank you so much !!!
will look into the interim solution you provided.
Thank you
Hema
On Jul 24, 2012 10:40 PM, "Jeremy Johnson" <
reply@reply.github.com>
wrote:
hemakannan commentedon Aug 23, 2012
HI Jeremy,
Hope you are doing great. So we did not have time to try this out at our end. But I just wanted to check with you on if you would have time soon to look into putting back location strategy back into Sel2Lib. Please advice.
Thank You
Hema
j1z0 commentedon Aug 23, 2012
Yeah I plan on doing it. However I'm not sure when I will get the chance. :( I'm pushing hard for another deadline next week at work. Hopefully after that I'll have some time. I'll keep you posted it may be a few weeks.
Jeremy
On Aug 23, 2012, at 11:10 AM, hemakannan wrote:
hemakannan commentedon Aug 23, 2012
Thank you Jeremy for your support. When you implement this it going to be
so easy for us to move sel2lib and run tests without major refactoring.
Thank you so much once again
Hema
On Aug 23, 2012 2:06 AM, "Jeremy Johnson" notifications@github.com wrote:
hemakannan commentedon Sep 17, 2012
Hi Jeremy,
Hope all is well with you. Just wanted to check on this with you.
Thank You !
Hema
bsommardahl commentedon Sep 29, 2012
My team just finished a library that wraps jquery functions for use with Selenium. We just finished our first release, but plan on wrapping ALL of jquery's functions. This library makes it easy to use jquery from your Selenium tests in C#. It makes for MUCH cleaner looking tests. Here's the source code: https://github.com/AcklenAvenue/JQSelenium
hemakannan commentedon Sep 30, 2012
Hi,
Thanks ! I am going to give this a shot this week and will get back to you if I have any questions.
Hema
hemakannan commentedon Oct 11, 2012
Hi Byron
That looks really nice for java/c# but it would require binding your library to python (and other languages) and then again to robot framework (since it's written in python). A better approach would be to support the way it use to work in selenium1 by allowing jquery= selectors to be used throughout the existing selenium routines.. Which shouldn't require any binding changes at all?
I am not sure if this would work for my request. Jeremy, any updates on your end for this jquery support ?
hemakannan commentedon Dec 1, 2012
Hey j1z0 Jeremy,
Any updates on this ?
Thanks
Hema
rbovill commentedon Mar 25, 2013
My QA team also needs support for Sizzle (or jQuery), otherwise we will have to rewrite a substantial amount of our tests to use xpath (not-desired) or hope there is a static ID further up the tree we can reference. What is the status of this issue?
Thanks,
Rob
bsommardahl commentedon Mar 25, 2013
Check out https://github.com/AcklenAvenue/JQSelenium for a layer over
Selenium that uses jQuery internally and gives you a JQ-like syntax in your
c# tests.
Byron Sommardahl
Feed - http://sommardahl.com
Blog - http://awkwardcoder.com
Phone - 615-669-8239
On Mon, Mar 25, 2013 at 3:04 PM, rbovill notifications@github.com wrote:
emanlove commentedon May 25, 2013
jQuery and Sizzle support added and has been released within Selenium2Library version 1.2.
hemakannan commentedon May 25, 2013
Great news ! Thanks so much guys !
On May 25, 2013 4:33 PM, "Ed Manlove" notifications@github.com wrote: