ruby on rails - jQuery UI Dialog Buttons Not Responding to click_button or selenium.click in Selenium/Webrat -
Is anyone able to get the jQuery UI dialog button to respond to click_button or selenium.click? I do not seem to be able to do this work.
Actually, I am trying to test a form in the jQuery UI dialog in a Rail app using Cucumber / WebRat / Selenium.
I have a page with several table rows, and one row closes a dialog box with each form on the click. Each form element has a unique ID, so markup is valid.
Because the button can be dynamically created by the dialog plugin, I initialize the dialog to add the 'Save' and 'Cancel' button. Interestingly, the plugin includes a button tag, not an input tag. I also add open eds as shown below so that the button can be targeted by the test framework.
$ ('.inventory_dialog'). Dialog ({autoOpen: false, modal: true, button: {'save': function () {// submit AJAX}, cancel: Add an ID to the button for the function () {// Cancel}}, Open: Function () {// Selenium var inventory_id = $ ('' '' '' '' '' '' '' '' '' ' ('' '' '' '' '' '' ',' '-UI-dialogue button' '). Game (' button: in it ("save") occurs) ('Id', 'inventory _' + inventory_id '' _cause '');}}) (adi, 'inventory _'+ inventory_id +' _beta_button '). ;
The markup looks like this:
& lt; Div id = "inventory_dialog_392827" class = "inventory_dialog" & gt; & Lt; Div action = "/ suppliers / 22 / listings / 27738 / inventory / 392827" class = "edit_inventory" id = "edit_inventory_392827" method = "post" & gt; & Gt; Div style = "margin: 0; padding: 0" & gt; & Lt; Input name = "_ method" type = "hidden" value = "put" /> gt; & Gt; / Div & gt; & Lt; Div class = "input_bloc" & gt; & Lt; = "Label for inventory_392827_new_quantity" & gt; Quantity & lt; / Labels & gt; & Lt; Input id = "inventory_392827_new_quantity" name = "inventory [new_quentity]" type = "text" value = "10" /> & Lt; / Div & gt; & Lt; Div class = "input_bloc" & gt; & Lt; Label = "inventory_392827_claim_quantities" & gt; Groups of & lt; / Labels & gt; & Lt; Input id = "inventory_392827_claim_quantities" name = "inventory [claim_cutts]" type = "text" value = "6-8" /> & Lt; / Div & gt; & Lt; / Form & gt; & Lt; / Div & gt;
My cucumber stage (currently) looks like this:
when I ^ In the inventory dialog $ / do the "(. +)" Button Click me BUTTON_NAME | Debugger selenium.click "//button[@id='inventory_#{@current_offer.id}_#{button_name.downcase}_button ']" Selenium_Wright End
When I run cucumber And this 'debugger' hits, I'm able to manually 'seleniumclick' in the input fields.
selenium.click "// input [@ id = 'inventory_392827_new_quantity']"
It successfully puts a cursor in that area, however, on the button Clicking does not work:
selenium.click "// button [@ id = 'inventory_392827_save_button']"
When I type command line In the debugger, it returns zero (which I believe is the success, because there is no exception), but Firefox does nothing at all when the dialog box remains open in the browser when I use Output Feedback convey. Anyone, that button exists
I also tried
click_button "inventory_392827_save_button"
but the 'Selenium_wait' command-time, which means that this element is not Sees.
I'm stuck ...
If you call it "fireEvent .." Click "to click" or click away to fix the problem?
Comments
Post a Comment