tag:blogger.com,1999:blog-1691661231583466814.post1544991847933048713..comments2023-11-02T02:08:59.444-07:00Comments on Jian's Blog: How to use jQuery to create custom Selenium locate strategyJohn Fanghttp://www.blogger.com/profile/16815426931189918005noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-1691661231583466814.post-10782176592096752182017-12-20T00:21:02.219-08:002017-12-20T00:21:02.219-08:00This article is very interesting and helpful. Than...This article is very interesting and helpful. Thank you for sharing! <br /><br /><br /><a href="http://www.papdan.com/services/app-development/" rel="nofollow">Mobile App Developer</a>seravina danniellahttps://www.blogger.com/profile/17416651554211077082noreply@blogger.comtag:blogger.com,1999:blog-1691661231583466814.post-5408193675191877522011-04-25T02:39:12.920-07:002011-04-25T02:39:12.920-07:00hi Martin;
I am beginner in Selenium.
I use Selen...hi Martin;<br />I am beginner in Selenium. <br />I use Selenium 2.0 with Firefox WebDriver and I have an error with the LOCATOR_DETECTION. there is the generated Error:<br /><br />"Exception in thread "main" com.thoughtworks.selenium.SeleniumException: LOCATOR_DETECTION_FAILED not found" <br /><br />I try it your solution, but it does not work because Eclipse can't know the readFile method method.<br />Code: <br />" readFile(new URL(new URL(selenium.getLocation()), "/some/your/location/jquery.js"))"<br />Can you give more details about your solution or other advice <br /><br />Thx :)AYADI Akremhttps://www.blogger.com/profile/03566226191443478187noreply@blogger.comtag:blogger.com,1999:blog-1691661231583466814.post-65982156656385687402010-12-01T07:12:07.262-08:002010-12-01T07:12:07.262-08:00I tried this out and it was working GREAT... until...I tried this out and it was working GREAT... until we tried running our selenium scripts using a similar location strategy vs IE7. Now we get an error that reads: "ERROR: Error executing strategy function jquery: 'jQuery' is null or not an object."<br /><br />This to me reads like it's something failing WITHIN the location strategy code, but it ONLY fails when the test is run vs IE7. Any ideas here? <br /><br />Here's the location strategy we're using (it's not the one you describe, but another I found that supports the jQuery .parents call)<br />var loc = locator;<br />var attr = null;<br />var isattr = false;<br />var inx = locator.lastIndexOf('@');<br />if (inx != -1){<br /> loc = locator.substring(0, inx);<br /> attr = locator.substring(inx + 1);<br /> isattr = true; }<br />var selectors = loc.split('<');<br />var found = $(inDocument);<br />for (var i = 0; i 0) {<br /> found = $(found.parents()[0]); }<br /> if (jQuery.trim(selectors[i]) != '')<br /> found = found.find(selectors[i]); <br />}<br />if (found.length > 0) { <br /> if (isattr) { <br /> return found[0].getAttributeNode(attr); <br /> } <br /> else { <br /> return found[0]; <br /> } <br />} <br />else { <br /> return null; <br />}<br /><br />Coudl it be the use of jQuery. instead of $()? Or could it be something where when running in IE7 I've got the definition in the wrong file? I've got the jquery definition added to both TestRunner and RemoteRunner.html in the \core\ folder.<br /><br />Thanks for any ideas!<br />JDBjdbhttps://www.blogger.com/profile/08011832644439068638noreply@blogger.comtag:blogger.com,1999:blog-1691661231583466814.post-78315596469136269072010-11-05T11:40:16.902-07:002010-11-05T11:40:16.902-07:00Hi! thanks for your Blog :D I like it.
I would li...Hi! thanks for your Blog :D I like it.<br /><br />I would like to know if you already used jQuery with the Selenium remote control? and in this case wich ones where your steps.<br /><br />I have tried adding the jquery.js in core/scripts and modifiying the TestRunner.html, RemoteTestRunner.html, and the user-extensions.js file but i did not get it. When I run my test the Selenium Control Remote starts but it does not execute any command.<br /><br />Any idea?<br /><br />Thanks for your helpUnknownhttps://www.blogger.com/profile/03659337090448557240noreply@blogger.comtag:blogger.com,1999:blog-1691661231583466814.post-67832348478133648232010-08-04T10:33:13.082-07:002010-08-04T10:33:13.082-07:00to include jquery one can also run
selenium.add...to include jquery one can also run<br /><br /> selenium.addScript(readFile(new URL(new URL(selenium.getLocation()), "/some/your/location/jquery.js")), "");<br /><br />and then use<br /><br /> String text = selenium.getEval("jQuery('html anything', window.document).text().trim()");Martinhttps://www.blogger.com/profile/03732187627023407930noreply@blogger.comtag:blogger.com,1999:blog-1691661231583466814.post-43190351377036486202009-07-23T23:49:56.269-07:002009-07-23T23:49:56.269-07:00Can we use jquery selector for all browsers: IE, F...Can we use jquery selector for all browsers: IE, Firefox, Chrome, Safari??Pallavihttps://www.blogger.com/profile/15046163339965933249noreply@blogger.com