CheckBox checked, clicked ok button but the value of checkbox not reflected on next page - watin

I have a checkbox and a ok button on a webpage,
steps to be performed using Watin Automation:
click checkbox
click ok button
expected result : A row gets added to concerned checkbox on next page
Actual Result with Manual execution : A row gets added on next page.
Actual Result with Watin Automation : No row is added on next page. Even after checkbox is checked.
I have used following code to check the checkbox
browser.Frame(Find.ByTitle("Frametitle")).CheckBox(Find.ById("CheckboxId")).Click();
Thread.Sleep(1000);
if (!browser.Frame(Find.ByTitle("Frametitle")).CheckBox(Find.ById("CheckboxId")).Checked)
{
Console.WriteLine("Checkbox is not checked, checking it once again");
}
Also I have used javascript to check the checkbox and clicked the button, but still it is not working
Javascript code is as follow:
browser.RunScript("document.getElementById('CheckboxId').click();", "javascript");
Please help me to resolve this issue.
Thanks,
Saurabh

Try to focus on the element and send ENTER key and check.

Related

Why does APEX submit when I press Enter when I never programmed it to?

I discovered this behavior in Oracle APEX 4.2: you create a page with form elements and now when you press Enter in a textbox (text field), the page submits, even though you have "Submit when Enter pressed" set to No and haven't made any dynamic actions or other javascript checking for the keycode 13.
This can also end up making it look like you submitted twice: first with a blank/empty request, and then with the actual request. Interestingly, the first blank request is the only one Firefox sees, but Chrome and IE see both requests.
It turns out if you have exactly one text field on your page, APEX will cause the page to submit. I found the solution here: http://deneskubicek.blogspot.com/2008/06/textfield-item-submiting-page.html
Just create another text field and give it the following in the HTML Form Element attributes: "style="display:none". Voila, all set!

radio button getting automatically unchecked after some time

i have build a quiz app in VB . Radio buttons for answers are being selected and accordingly score is being calculated and displayed correctly. But the radio buttons are getting automatically unchecked after sometime and score is reset to 0. i am not being able to figure out why is this happening. can anyone help?
It sounds like the form is being unloaded, then displayed again. You can see if this is the case by putting a breakpoint int the form load handler.

How do I display a submit button after 3 images are clicked?

so I'm running a Runescape Private Server and my java code for voting in it is if the link = www.clearpkz.webs.com/votevote?Username= + username entered is active, then it allows users to do ::claim to get a reward. But how can I make it so the Submit button to enter their username only displays if they click on every image first? Or can I only make it display once every 24 hours even if the page is refreshed?
Here is my current code:
http://pastebin.com/rfQeVkfT
Here is my voting website: www.clearpkz.webs.com/vote
You must disable with jQuery a submit function and check if user clicked on image then you can enable a button for submit.
Also:
1. If you show page> $("input[type=submit]").attr("disabled", "disabled");
2. You need one variable for click test. if user clicked on image COUNTER++
3. If COUNTER > 0 then $("input[type=submit]").removeAttr("disabled");

How to add a custom button to a jqGrid row that does NOT select the row when clicked

This example from Oleg is very close to the behavior I'm looking for (the first button) but I want preserve whether or not it was highlighted if possible, and don't want to highlight a row and check on the check box if it was un-selected. Just to clarify, I will be popping a modal dialog if they click this button, it has nothing to do with editing the row.
http://www.ok-soft-gmbh.com/jqGrid/Admin3.htm
Thank you,
Stephen
To prevent highlighting of the row in which the custom button will be clicked one need just include return false; inside of click event handler:
click: function(e) {
alert("'Custom' button is clicked in the rowis="+
$(e.target).closest("tr.jqgrow").attr("id") +" !");
return false; // !!!!!
}
The demo demonstrate the results. It's the updated version of the demo from the answer and the previous one which you referenced in your question. Additionally I updated the code of myDelOptions.onclickSubmit based on the code from the answer.

jqgrid multiple datepickers and autofocus

i think i found a strange bug in jqGrid.
If you click on this link you can see a jqGrid with a pager. If you click on the '+' button you get the add form in which the 2 datepickers work as expected.
If you now click on this link you can see the very same table, and the very same add button. Anyway if you try to set the second date using tha datepicker you will notice that the focus moves back to the first input, opening the first datepicker.
The example does not work because it has the first field (Id) hidden, so the real first field is a datepicker. Moreover, the edit form is modal.
Last, if you click in this link the behaviour is correct even if the first field is a datepicker. The only thing i changed is the modal property (to false, before it was true).
However, i NEED to hide the Id field AND have a modal window, so i have to to get rid of this problem...
Can someone suggest a solution or an hint?
Thanks
PS: notice that if you set modal: false, you still get the black/transparent overlay like if the window is modal BUT it is not! If you click outisde the edit form it will be closed. This is not acceptable for my requirements.
try to set jqModal parameter into false
var editParams = {
modal: true,
jqModal:false,
... //other options you need
}
grid.editGridRow(row_id, editParams);
for more information see answer Oleg's analisys

Resources