inline disable button not working in Firefox - firefox

I have two buttons, which are initially disabled
<button class="back" id="back" disabled="true">Back</button>
<button class="forward" id="next" disabled="true">Next</button>
Safari and Chrome read it just fine
But Firefox does not
I'm running FF 26.0. Removing ="true" doesn't fix it.

I don't know why, but after restarting FireFox, it works again. Weird...

I'm not sure which version of firefox you are using, but the latest version (26.0) seems to have no trouble disabling the button. In either case, you do not need to specify "true" or "false". Simply put
<button class='back' id='back' disabled>Back</button>
<button class='forward' id='next' disabled>Next</button>
W3 Disabled Attribute

Related

Debugger does'nt display after update

I've a strange problem since yesterday, I've made an update of Symfony and since I don't have the debug toolbar anymore. It is displayed in my html code like this :
<div id="sfwdtd14ed8" class="sf-toolbar sf-display-none" data-sfurl="/_wdt/d14ed8" style="display: none;">
Here is my web profiler config :
web_profiler:
toolbar: true
intercept_redirects: false
My config is good and I can display the debugger with url like this :
http://127.0.0.1:8000/_profiler/latest?ip=&limit=10
I can't find any solution if you could help me thank you.
Updating the Symfony Client to latest version (4.5.1) resolved the issue, which was probably the "broken Symfony WDT", fixed in 4.4.5.

Code works in watir-classic but not in watir-webdriver

When I write the blow code in Watir-webdriver:
$browser.checkbox(:index,0).click
It gives the following error:
element not visible (Session info: chrome=48.0.2564.97) (Driver
info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)
and then I have written this code $browser.input(:index,0).click then it reports this error:
unknown error: Element is not clickable at point (952, 17). Other
element would receive the click: ...
(Session info: chrome=48.0.2564.97) (Driver info:
chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)
But the element is clearly visible and also the given above two lines of code cleanly works in watir-classic, we do not even need to scroll the screen.
Can anyone suggest me why it is the case? Why this watir-webdriver is not as comfortable as watir-classic?
<td class="centred"> <label class="label-checkbox"> <input type="checkbox" data-ng-model="cover.IsSelected" class="ng-pristine ng-valid"> <div class="fake-checkbox"> <span class="glyphicon glyphicon-ok"></span> </div> </label> </td>
The first thing you need to do is to update your chromedriver, as version 2.9 is 2 years old. That binary needs to be kept up to date with current versions of chrome. It is quite likely that this alone will fix your issue.
If it is an issue of visibility... The purpose of Watir (and Selenium and WebDriver) is to mimic the action of a user. If the checkbox isn't visible to the user, you shouldn't be able to click it in your test.
If the checkbox is something that isn't visible at first, but then becomes visible, you can do: browser.checkbox.when_present.click (note that index: 0 is the default behavior and is not necessary)
If the checkbox has some exciting javascript things that are covering it up in a way that it is never going to be visible, and clicking on something that is visible throws the "Element not clickable" error, you might have to do browser.checkbox.when_present.fire_event :click
That method does not mimic what a user actually does on your site, so it should only be used as a last resort.

Form not submitted on click using watir-webdriver in Chrome

I am using ruby/cucumber/watir-webdriver and the page-objects gem to run my tests. My tests are usually run in firefox but decided to give chrome a try. While the click works in firefox it does not in chrome. Here is the sample html code:
<form id='test-form' method='post' class='validate-inline'>
...
<div class='margin-top'>
<input class='btn' data-disable-with='wait...' type='submit' value='Submit Form'></input>
</div>
</form
In my class page I have the button declared as the following:
button(:submit_form_btn, :value => 'Submit Form')
And call it this way:
submit_form_btn_element.when_present.click
I do see the button text change to 'wait...' for a few seconds then returns to 'Submit Form' but does not seem to submit the form. As mentioned before it works with firefox and when clicked manually. Just seems to be an issue in Chrome. Any ideas how to get around it?
I tried clicking the div, and tried clicking the button twice but same issue.
As always your help is appreciated. Thanks.
I know this question is little old now, but I thought I'd post in case this helps anyone.
Most of the times I've run into similar issues, it was caused by an update to Chrome that caused issues with the version of the watir-webdriver gem (or one of it's dependencies) or with the version of chromedriver that I was using. I've had success in the past by updating my gems and chromedriver and the other times I've had to roll back the browser version to the previous release.
It's not ideal to be testing on an older version of chrome but it worked fine as a stop gap until the issue was fixed.
If you do go for the previous version of chrome approach, make sure to log a bug ticket if there isn't already one there.

Unable to "click" in recent webdriver release on FireFox

I am facing intermittent issue in Clicking on a button or a hyperlink on Firefox.
I am using webdriver version 2.27 and FF17.
The buttons are simple html button -
<input class="btn" type="button" title="AddP" onclick="navigateToUrl('/p/tyy/SelectSearch?addTo=006y67&retURL=%2F00999yu2Boy9','MM_LIST','addP');" name="addP" value="Add P">
I use locator as : name=addP
For hyperlinks I use locator as : link=hyperlinktext
The Click will not fail with any exception, it will simply highlight the button or link, but not perform the actual click.
The frequency of failure is once in 3 times.
Thanks
Sky
Upgrade to at least Selenium 2.28. There were some bugs for Firefox 17 before that.
Here is what i found :
Issue 1: I was using By.linkText("test test").click which should have been By.partialLinkText("test test").click . Thanks to stackoverflow for the answer.
Issue 2: I rewrote the css locators for failed button to start from class of some parent above.
For e.g. instead of
css=input[name='j_id0:j_id2:j_id3:j_id4']
I am now using
css=.individualPalette input[name='j_id0:j_id2:j_id3:j_id4']
And it works all the time. I am not sure why??
I am still to rerun my scripts couple of more times to be sure these helps.

keep text inside div with firefox

Please open this fiddle with both firefox and Chrome.
http://jsfiddle.net/mattdevo/5bdDd/
as you may notice, text flows past div in firefox.
What is my mistake? (removing strong tags did not help...)
Thanks,
You're using display:-moz-box;; if you really need it you should also add -moz-box-orient: vertical;
Using a Firefox only display type leads to incompatibility, that's normal.
If you remove
display:-moz-box;
This works in FF as in Chrome.

Resources