Cannot click Submit button on Selenium IDE - selenium

I am having trouble getting Selenium IDE to click the Submit button on one of my webforms after having selenium open and fill out the form. I am using the clickAndWait command and identifying the button by its ID:
<td>clickAndWait</td>
<td>id=ctl00_ContentPlaceHolder1_OSVFHResults_btSave</td>
<td></td>
Interestingly, if I write a script that simply opens the form and clicks the submit button without filling it out, I am not having any problems. My problem is coming specifically after I've asked Selenium to fill out the form. Additionally, if I try to manually click the submit button, it doesn't work if the Selenium script to fill out the form was run before my manual input. If I manually open and fill out the form, I have no problems clicking submit, and Selenium works for all of the other form's submit buttons on the site. Anyone have any ideas?

Instead of filling form with type command you can try typeKeys one. It simulates keystroke events on the specified element, as though you typed the value key-by-key and probably enable your submit button.

It sounds like some javascript event unrelated to click() (such as mouseover or onkeydown) is attached to one or more of the form fields and is responsible for enabling the submit button.
You'd have to look at which exact events are being fired, either by looking at the source with something like firebug, or by using a javascript debugger. Then modify your Selenium script to make sure the same events get triggered.

After type the values in the form just try "ClickAtandWait" instead of "clickandWait"..i also face the problem once and it gave hands once..
selenium.clickAtandWait("locator", "position");
if you know the exact "position" just put it, otherwise leave it as an empty string.

Related

'true' is being shown when SWT Radio Button is clicked while UFT automation testing

We have a dialog, where we use table viewer and in one of the columns, we used a Boolean data which are shown in the form of radio buttons. While running an UFT based automation suite which clicks the radio button and also encounters a confirmation dialog and clicks some other radio button again. In that above process we encounter the issue which is not possible to encounter while testing manually.
I would like to know what the issue might be.
Let me know if there is a way to fix it.

How to unfocus from all inputs/elements in Selenium without tabbing out

I have a form where I fill in textboxes through selenium (java). Some of the textboxes dynamically generate extra content when you click on them and remove the content when you focus on something else. This is a problem when I automate because if I am focused on a text box and try to click on something else, when the page removes the content it doesn't register my click and I need to click again. This leads to flakey behaviour since I need to now consider whether I need to click or double click a button depending on what element I was focused on before.
I can't send a tab key to the text box because sometimes it will tab into another textbox that has the same dynamic generation behaviour, leading to the same scenario as before.
I tried clicking the page element but it also doesn't seem to work. I also tried clicking the root div. It just doesn't seem to register my click (I also tried jsclicks)
What I would like to do is have a general way to unfocus a text box after I fill it.
Thanks!

Input type search clear button Microsoft Edge not working properly with Datatables

I am using Datatables to sort and filter my tables. When you activate Datatables, there is a search field. In Chrome, Firefox, Edge and Internet Explorer 11 there is a clear button present with every search input field.
When you click on it, the text is cleared and the table will reset. Except in Microsoft Edge, this does not work. The table is not resetting.
Is this an issue with Microsoft Edge or Datatables?
I believe it is Edge that not is triggering the events the DT input is listening on. That is keyup, keydown, keypress, cut and paste ...There is two additional events that is fired when you click on the search input clear button: mousedown and mouseup.
You could create event handler that force a redraw when mouseup is triggered :
$('.dataTables_filter input').on('mouseup', function() {
table.draw()
})
See this question where the issue is discussed more thoroughly -> Event fired when clearing text input on IE10 with clear icon
This is a known bug found in build 17.17134 of Edge.
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17584515/
I am using an earlier version and it still works.
I try to make a test on my side with EDGE and got the same result like yours.
When click on 'X' it is not reset the table.
Click here to see testing result
Then i made some other tests and find that if you use BackSpace key to clear the search text then it will work as expected.
If you use 'X' button then after text get clear you need to press enter to reset the data.
I agree with other community members that Edge is not triggering the event to reset data.
I think you need to submit your feedback to Datatables site. So that they modify their code which can work properly with Edge.
Regards
Deepak

selenium, hidden button by overlapped input ( not clickable)

Is there any way on how to click a hidden button by an overlapped input text field, for example if you go to www.google.com and enter a text to search for, selenium can not find the "Search Google" button because it is hidden by the autocomplete of the text field.
Thanks.
You can bypass the validation by using #click! instead of #click. Basically, this triggers the click via JavaScript rather than through standard Selenium commands.
browser = Watir::Browser.new
browser.goto('www.google.com')
browser.text_field(name: 'q').set('watir')
browser.button(name: 'btnK').click!
If you are only using Selenium, you can do:
btn = driver.find_element(name: 'btnK')
driver.execute_script('arguments[0].click();', btn)
As discussed in the comments, you could also close the suggestions box before trying to click the button. You can do this by moving focus to any other element - eg the first link on the page. Depending on what you're testing, this may or may not have value.
browser.text_field(name: 'q').set('watir')
browser.link.focus # move focus to any other element so suggestions close
browser.button(name: 'btnK').click

Selenium ClickandWait

Using id=incidentsCheckBox gets me an error but when clicking manually it shows up fine. What is the best way of capturing dynamically generated icons (incidentIcons), which pop up when a checkbox is clicked, which if click individually will show a popup data of status?