tag:blogger.com,1999:blog-9238405.post114296752397666334..comments2024-03-18T02:04:50.380-07:00Comments on Agile Testing: Ajax testing with Selenium using waitForConditionGrig Gheorghiuhttp://www.blogger.com/profile/17863511617654196370noreply@blogger.comBlogger41125tag:blogger.com,1999:blog-9238405.post-1792221068657268622016-12-01T02:00:20.712-08:002016-12-01T02:00:20.712-08:00In the end, solving the problem arose addition of ...In the end, solving the problem arose addition of AJAX. I'm testing it for a few days - an ingenious solution. Appendix on that at every step made selenium automatically waits for the execution of AJAX.<br /><br />https://addons.mozilla.org/pl/firefox/addon/sideex/<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-6289880625513080252012-05-15T09:51:15.006-07:002012-05-15T09:51:15.006-07:00Someone who is using RichFaces and component can ...Someone who is using RichFaces and component can wait for this condition:<br /><br />String condition = "var display = selenium.browserbot.getCurrentWindow()";<br />condition += ".document.getElementById('ajaxLoadingModalBoxContainer').style.display;";<br />condition += "(display == 'none');";<br />selenium.waitForCondition(condition, 10000);Marcio Santosnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-44992773879647287932011-11-01T12:59:29.245-07:002011-11-01T12:59:29.245-07:00Hi All,
I download the user-extension and put it i...Hi All,<br />I download the user-extension and put it in right place, while executing a testing script including 'waitForCondition', throws an exception :"The error message is :'testLoop' is undefined"<br /><br />Thanks in aheadAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-74519593896842717482011-11-01T12:57:28.265-07:002011-11-01T12:57:28.265-07:00I download the user-extension and put it in right ...I download the user-extension and put it in right place, while executing a testing script including 'waitForCondition', throws an exception :"The error message is :'testLoop' is undefined"Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-16350532979836891372011-07-21T06:23:20.486-07:002011-07-21T06:23:20.486-07:00I had a problem with gotoIF statement.i created at...I had a problem with gotoIF statement.i created atest in IDE and its working correctly there.<br /> if i now export the code in C# RC server format, then the gotoIf line is commented out and also is label commented out.<br /><br />I had installed the plugin for Selenium IDE Flow Control<br />Extension.from: https://github.com/darrenderidder/sideflow<br /> and restarted the firefor version5.<br />then when i started IDE the gotoIF command was available for use. I<br />did used it also. but when I exported the Code as c#(Remotecontrol)<br />format.and opened it in Microsft visual studio 2010. All the gotoIF<br />statements are not recognized by the Microsft visual studio 2010. all<br />statements are commented out.<br />and<br />code looks like this when opened in studio:<br /><br />selenium.Click("css=input[type=submit]");<br /> Boolean TP = selenium.IsTextPresent("User name already exists");<br /> System.Threading.Thread.Sleep(sleeptime);<br /> // selenium.GotoIf("${TP}==false", "target1");<br /> System.Threading.Thread.Sleep(sleeptime);<br /> // selenium.Label("target1", "UseName");<br /> System.Threading.Thread.Sleep(sleeptime);<br /><br />How can i fix this issue?If i remove the comments// then it says: you<br />are missing a directive or assembly reference.<br /><br />And if i try to add reference to the sideflow.js file it is not<br />detected.because it is not a .DLL file.<br />Anyone knows how to fix this?<br /><br />Thanks in Advance!! :)<br /><br />Rahul.Rahul Agnihotrihttps://www.blogger.com/profile/02238928753125247088noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-79168618870250107002011-07-05T13:42:52.052-07:002011-07-05T13:42:52.052-07:00Hi there,
There are loads of useful information b...Hi there,<br /><br />There are loads of useful information but my question is why a timeout must be set when using the waitForCondition command ?? If we get back to the initial problem when using a pause command to wait for some action requiring AJAX to take place, then isn't it the same approach when using the waitForCondition??Dave747noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-15655017288810274172011-05-14T05:51:28.755-07:002011-05-14T05:51:28.755-07:00A very good post.A very good post.Bantyhttps://www.blogger.com/profile/17810096823725736680noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-46744501733692629832011-05-14T05:51:00.075-07:002011-05-14T05:51:00.075-07:00A good post.A good post.Bantyhttps://www.blogger.com/profile/17810096823725736680noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-1683313433192361542010-11-22T11:50:00.668-08:002010-11-22T11:50:00.668-08:00This post is going in my file of things to send pe...This post is going in my file of things to send people who insist that Selenium is "broken" whenever this scenario occurs. Thank you for this.Romulushttps://www.blogger.com/profile/15065782851995490502noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-47623717166542953832010-06-22T17:47:57.106-07:002010-06-22T17:47:57.106-07:00selenium is a piece of shit. the IDE exports test...selenium is a piece of shit. the IDE exports tests that are completely useless in Java. I get timeout errors all the time and there is no documentation. Google needs to fire the lead developer on this. waitForElementPresent apparently is part of the api but somehow it's not listed in the intellisense that eclipse has. Stupid software = I won't use it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-7252497008290579362009-10-26T08:40:37.895-07:002009-10-26T08:40:37.895-07:00I have a simple login page written in extension JS...I have a simple login page written in extension JS in following way:<br />Ext.onReady(function()<br />{<br />Ext.QuickTips.init();<br />Ext.form.Field.prototype.msgTarget = 'side';<br />new Ext.Button({<br />renderTo:'login',<br />text: 'Login',<br />width: 800<br />}).on('click',function()<br />{<br />document.forms[0].submit();<br /><br />});<br />});<br /><br />Now when I use selenium testing via browser I get a randomly generated id which when hard coded can very well be used in following way:<br />selenium.click("ext-gen26");<br /><br />My concern is how to get reference of this generated id, so my selenium test case in JUnit is not dependent on randomly generated ids from Extension JS?<br /><br />Your suggestions appreciated.<br /><br />Regards,<br />PrashantPrashant Dathwalhttps://www.blogger.com/profile/18320623440271823736noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-67336026287485580292009-08-28T13:13:53.418-07:002009-08-28T13:13:53.418-07:00When I recorded an script with alerts the Selenium...When I recorded an script with alerts the Selenium IDE save the command assertAlert with the message <br />of that alert in target. <br /><br />When I play this script this command fails and the button ok isn't pressed?<br /><br />How I can replace assertAlert with another command that works?<br /><br />Thanks so much<br /><br />BrunoNaTeiahttps://www.blogger.com/profile/06734576277652643319noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-88436366496392094222009-07-21T02:49:12.452-07:002009-07-21T02:49:12.452-07:00hey grig,
thank you for responding! :)
I think ...hey grig, <br /><br />thank you for responding! :)<br /><br /><i>I think it's better to use waitForElement, since it doesn't force you to use that much custom JavaScript in your tests.</i><br /><br />i was thinking along exact those lines! :D <br /><br />- f -falcyhttps://www.blogger.com/profile/01544217462014752360noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-69447924181873879332009-07-20T09:59:18.619-07:002009-07-20T09:59:18.619-07:00Hi falcy,
I haven't used Selenium for a while...Hi falcy,<br /><br />I haven't used Selenium for a while, so I'm a bit out of touch with the latest developments. From what I know though, it is being used heavily at Google, so that tells you Selenium is doing *something* right ;-)<br /><br />As far as waitForCondition vs. waitForElement, I think it's better to use waitForElement, since it doesn't force you to use that much custom JavaScript in your tests.<br /><br />GrigGrig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-22942196459632234632009-07-20T08:20:15.998-07:002009-07-20T08:20:15.998-07:00uh, me again! :)
is waitForCondition still the way...uh, me again! :)<br />is waitForCondition still the way to go with AJaX or is waitForElementPresent alternative by now?falcyhttps://www.blogger.com/profile/01544217462014752360noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-63745755241985051422009-07-09T07:21:51.524-07:002009-07-09T07:21:51.524-07:00first of all let me thank you for all your seleniu...first of all let me thank you for all your selenium intel! it helped getting me started with the whole thing. i have a question though: your selenium posts are not the most recent and i was wondering if selenium is still the tool of your choice or if you're using sth. else now?falcyhttps://www.blogger.com/profile/01544217462014752360noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-84964061157617718962009-06-09T11:01:07.654-07:002009-06-09T11:01:07.654-07:00This post is wonderful! Congratulations ;)This post is wonderful! Congratulations ;)Daniel ABellahttps://www.blogger.com/profile/11173371264998822537noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-1990756361432587322009-05-31T20:56:02.341-07:002009-05-31T20:56:02.341-07:00hello!!
we nid help in using selenium..
we instal...hello!!<br /><br />we nid help in using selenium..<br />we installed selenium ide..<br />how can we make a value generic?<br />coz it nids to be edited the value manually so that the case will be successful. It creates error when we dont change or put the specific value..<br />Do we nid variable?<br />if yes.. how?<br />pls help us..<br /><br />thank's<br />cath, har & joyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-88014308229786642402009-04-11T03:55:00.000-07:002009-04-11T03:55:00.000-07:00hi,need advice on using selenium.getText with xpat...hi,<BR/><BR/>need advice on using selenium.getText with xpath location in C# via Nunit. It does not seem to work. any ideas?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-13236620491411285962009-02-26T00:01:00.000-08:002009-02-26T00:01:00.000-08:00Hi Grigm,Regarding the 'WaitForCondition', I have ...Hi Grigm,<BR/>Regarding the 'WaitForCondition', I have one question, would like to help me?<BR/><BR/>I use Selenium RC(C#) to develop the test script.And the AUT is a ajax web application.<BR/>There is a scenario, after the user click one button, saying button1, a drop down listbox will be filled in, it is ajax feature, which means the page will not be re-loaded totally,only the drop down listbox will be filled in.<BR/>And the button clicking tragger a javascript funtion to fill in the drop down listbox.<BR/>So I write the test script.<BR/>1. selenium.Click("Button1");<BR/>2, selenium.WaitForCondition(,10000);<BR/>I do not know what should be written as the first parameter of the WaitForCondition.<BR/>I know it should be javascript.<BR/>But I don't know how to invoke the javascript in the page's html.<BR/><BR/>Can you help me with it?<BR/>Please send the answer to my mail<BR/>Grrison.W.Wang@gmail.com<BR/><BR/>Thanks in Advance.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-561474828277688852009-02-09T06:40:00.000-08:002009-02-09T06:40:00.000-08:00@Hari:use "var str=selenium.getBodyText();str.inde...@Hari:<BR/><BR/>use "var str=selenium.getBodyText();str.indexOf('{0}')==-1;"; instead and use String.format to include your textAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-61690412528293162672008-11-07T05:57:00.000-08:002008-11-07T05:57:00.000-08:00hi everybody... I need an urgent help to autiomat...hi everybody...<BR/> I need an urgent help to autiomate a test case using Selenum(using HTML).I want to declare a variable in "user-extension.js" file, which I will use in automated test cases.<BR/> Can anybody suggest how this will be possible?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-68966118740907294292008-09-01T05:48:00.000-07:002008-09-01T05:48:00.000-07:00Hi All,I am php developer. I was trying to work ar...Hi All,<BR/><BR/>I am php developer. I was trying to work around for same problem. when i was getting option MUMBAI not found. I am using Selenium IDE. I added a waitForCondition code between 2 calls; i.e. after selecting state Wait till drop down values are populated and then select related city.<BR/>Code snippet :<BR/><BR/><I><BR/><tr><BR/> <td>select</td><BR/> <td>regions</td><BR/> <td>label=Maharashtra</td><BR/></tr><BR/><tr><BR/> <td>waitForCondition</td><BR/> <td>selenium.browserbot.getCurrentWindow().document.getElementById('cities').options.length >= 2</td><BR/> <td>30000</td><BR/></tr><BR/><tr><BR/> <td>select</td><BR/> <td>cities</td><BR/> <td>label=Mumbai</td><BR/></tr><BR/></I><BR/><BR/>Hope this helps!<BR/><BR/>Cheers!<BR/><BR/>K.T.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-32676026232880480922008-08-09T01:35:00.000-07:002008-08-09T01:35:00.000-07:00Hi, i am a.Net developer and one of my projects co...Hi, i am a.Net developer and one of my projects contain a page with two drop down boxes. When a vale is selected in upper drop down the lower drop down is enabled and populated with values corresponding to the selection in upper drop down. This is accomplished using AJAX. But when my selenium test case tries to select the value from the lower drop down box. It throws error that the object/Field (i.e Drop down selection option) not found. Truly so the source code of the page also does not have the Options in it for the lower Drop down so the selenium statement fails...What i tried in this scenario is to use the selenium.Submit(formLocator) function; which too failed coz the options never appeared in lower drop down box<BR/><BR/>selenium.Type("ctl00_BodyPlaceHolder_txtPostCode_field", "2000"); // Enter 2000 as post code value.<BR/><BR/> selenium.WaitForCondition("var elements = selenium.getSelectOptions('ctl00_BodyPlaceHolder_ddlSuburb_field'); elements.length > 2", "30000");<BR/>// Wait for the drop down to be populated with city names.<BR/>selenium.Select("ctl00_BodyPlaceHolder_ddlSuburb_field", "label=SYDNEY");<BR/>Select Option with label "Sydney"<BR/>selenium.Click("//option[@value='SYDNEY']");<BR/><BR/>This throws error that optio SYDNEY does not exist.. Rightly so as it is not present in the page source but I can view it on the page (coz of Ajax)..<BR/>Could you give your thoughts on this.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-41072914645918831652007-09-21T04:08:00.000-07:002007-09-21T04:08:00.000-07:00Well that was a lot of wasted work: Selenium has s...Well that was a lot of wasted work: Selenium has since implemented a dedicated waitForElementPresent command, which does exactly what we need waitForCondition to do. <BR/><BR/>waitForCondition appears to be deprecated.Kieranhttps://www.blogger.com/profile/14385673876363854687noreply@blogger.com