No result with SendKeys to IE8 using Selenium on BrowserStack - unit-testing

I'm using Selenium to perform testing on BrowserStack, and have hit a problem while testing IE8.
I've found that when I target elements and then call Click, the full effect of the action is not being undertaken*.
Through trial-and-error I found that if I call Click twice then the expected action is undertaken.
However, one of the testing steps involves writing a number to a text field, and for this I have the following:
driver.FindElement(By.CssSelector("...")).Click();
driver.FindElement(By.CssSelector("...")).Clear();
driver.FindElement(By.CssSelector("...")).SendKeys(Keys.NumberPad1);
driver.FindElement(By.CssSelector("...")).Click();
But "1" never appears in the field. I can tell it never appears because I'm capturing screenshots after each step; I can see that the field gets highlighted (as the active element) and I can see the cursor inside the field, but no result from the method call.
Furthermore, I've even tried giving the field an ID and addressing it with
driver.FindElement(By.Id("txtCountManual")).SendKeys(Keys.NumberPad1);
But with the same (lack of) results.
Does anyone have any suggestions as to how I may send a textual value to a field in IE8 using Selenium and BrowserStack?
* The "expected action" involves using Knockout.js to display a selected value in another element. So for example, I found that if I programmatically click a radio button and then take a screenshot, I can see that the radio button has been clicked but the action performed by Knockout.js has not taken place; if I click the element a second time then the Knockout.js action is performed. This double-clicking is not required when I manually test using IE8 via BrowserStack.

Related

Oracle Apex Default "Create"-Button

I realised when creating a form with Apex (Version 19.2) a "create" button is generated. This one's behaviour is set to "define by dynamic option". Now the issue and the question at the same time is the fact that upon changing the behaviour once and then returning it back to the default setting the button will stop working.
If I were to create a new button I would have to manualy write all the insert operations for the whole form which I want to avoid.
Is this a bug from Apex itself or am I missing something?
I've found that in Oracle Apex (I'm working in v20.2), sometimes it's just easier to recreate something than to spend hours hunting for the reason it doesn't work. I copy the code I need to my NotePad and then copy the code to the new something. As it was in this particular example I spent 2 hours searching for the problem, whilst actually fixing the problem (with a new button) only took 5 minutes. Part of my problem was that I didn't know why the button wasn't clicking (no pun intended).
In this particular case it was a button on a form that calls "Form - Automatic Row Processing (DML)", using a Create button that calls "SQL INSERT action" Database Action. The problem happened when I changed the form from Modal to Non Modal and Back again.

Allow to check only one checkbox in Oracle apex

I created classic report with check boxes using apex_item.checkbox .I want to know how to allow to check only checkbox.That is if i click more than checkbox alert message should display.Please help me out
Thanks in advance.
If you want to do this via dynamic actions then you will want do a dynamic action on event Change, Selection Type jQuery Selector and the jQuery Selector being input[name = "something"]
This something you can figure out by running the page as is, and if you click F12 on your keyboard, the console will open. Then select the element that is your checkbox and find its name and this should be your "something". Play around with this to make it work(set the DA to run an alert or something to see when its triggered).
Then perhaps have a page item that is filled when this DA runs, and then if the page item is already filled and the DA runs, throw up an error saying you cant do this.
Or if you want to clear the previously checked box, you could save the name of currently checked box in the page item. And have the DA do a javascript function that clears the value in the field in the page item.
Basically have the DA get the name of the checked box from the item where you store it, and do some dynamic javascript. When I needed to do something similair I created a var in javascript that was formed like $s(" + checked_box + ", ""); assembling this with concat. And then do an eval(this_concacted_instruction).
I hope my ramblings guide you to a solution. I remember the first time I was working with this stuff I took a week to get one page sorted(although it was a bit more difficult than your problem), but it felt sooo good when I got it done. So keep on trying.
GLHF

Sitecore 8, MVC, Experience Editor: How to make a rendering refresh after a Field Editor Button has been used

We have a rendering listing the selected items in a TreeSelect in the current item. In our case we call them "Tags" (1)
We have added a Field Editor Button to the component to let the editor change selected items. (2) (As described on for example Adding a custom component)
When an editor clicks (2) the editor window (3) it is opened in a dialog. The editor may select different items(called tags in our case) using the TreeSelect.
When the editor presses the ok-button (4) the values are set.
Now to the problem:
The values are actually set as they get stored when the editor presses the Save button but we want our list on the page (1) to immediately reflect the set items when the editor presses the ok-button (4), i.e. before having to actually save the whole item.
How do we achieve that?
(I am in contacts with Sitecore support but so far I have not gotten any answers...)
Update
After a lot of conversation with the support we still have no useful solution.
We tried turning it into a field renderer displaying the links.
What worked was:
The field do get updated when you have edited it in the popup field editor. (but...)
It looks good the first time when page is loaded.
You can make a WebEdit button with commands to edit the field and add it as Custom button to the field (register <command name="webedit:fieldeditor" type="Sitecore.Shell.Applications.WebEdit.Commands.FieldEditor, Sitecore.Client"/> and set Click on the button to webedit:fieldeditor(command={3473DDA1-2983-493C-AF7A-054C75AA7AD3},fields=NameOfField where the guid points to itelf and an "Icon" is set on it.)
What didn't work was:
The field get updated by the raw value, not what I want to display. Server code is involved, but not in the rendering of html-code.
When I want to edit the value in the field editor, the value sent to the field editor is not the raw value but what actually is displayed on the page. (I guess this can be solved somehow)
The issue to the support turned into a feature request to let the server be involved in rendering the field, not just sending a new value to the JavaScript updating it. The server does the first rendering so when it already is involved in updating, it should be allowed to do the rendering the following times too.
We have decided to not spend more time on this right now (we have other things to do too.) and have a bad editor experience as the field not get updated until the editor actually saves the item.
Still we have no suitable solution for this issue. If you want to keep working on it and want a reference to my issue it is 439059.
This may not be useful here. I've done this in normal sites, but not in Sitecore. But, here's one possibility....
This is a situation where you would pass a callback function to the child popup window. This callback will cause the caller / parent window to re-read/re-load the information that was just updated by the child.
Example:
User presses (2) to open Editor Window(3) (Editor window is opened and the Callback function is passed as a parameter)
User presses "OK" button (4). The "OK" button event handler updates the changes, then calls the Callback function which re-loads the now updated information, and closes the popup window.
Once the popup closes, the parent window now displays the information that the popup/editor just updated.
This takes some client side javascript (jquery) development but it is quite do-able normally.

Content repeated in Joomla modal window

I'm having a really weird problem. When I click on Quick View the first time on
http://coderweb.info/tbps/index.php/shop/accessories
the content appears in the modal window as it should, namely once. The second time I click on any of the Quick View buttons, it appears twice (except for the image). The third time it appears thrice and so on. There is no loop anywhere in the code. The Quick View link is in the following format
http://coderweb.info/tbps/index.php/shop/accessories/universal-dual-tone-horns-detail?how=quick&tmpl=component
It basically loads the Virtuemart Product Detail page, but I have modified it so that when the 'how' parameter is passed with the value 'quick', it shows the 'Quick View' instead:
if(JRequest::getVar('how','') == 'quick'){
echo $this->loadTemplate('quick');
return;
}
What is causing this problem? How do I fix this?
I added
rel="{handler:'iframe'}"
to the link and that seems to have fixed it. I guess it was using a div element by default and it wasn't being cleared properly.

property sheet data validation

When the user clicks the OK or APPLY button on a property sheet and the program determines data on some page is invalid, how can I cause the page containing the error to be displayed along with a message box describing the error?
Currently the procedure doing the validation does the following while processing the PSN_APPLY notification.
MessageBox (hDlg, "Data must be positive!", "Error", MB_OK);
SetWindowLong (hDlg, DWL_MSGRESULT, PSNRET_INVALID);
This works ok if the page doing the validation (A) is currently displayed but if some other page (B) is being displayed, the message box appears with that page (B) being displayed, then when the message box is answered, the page with the validation error (A) is displayed. I thought about setting some flag so that when that page (A) gets the PSN_SETACTIVE notification it displays the message box but that seems kind of hokey.
Win32 API in c++, no MFC, no NET, nothing fancy.
I think the problem is in the design of your validation and it's presentation.
Am I right in thinking that you iterate through your property sheets, validate them and display a message box if something is awry? Because of course, what you have witnessed will happen, if I am on property page 3 and I wrote crap in to a field on property page 1.
The easiest solution is, when validating, note which property page the field in question is, and set that one active if the user has written crap in to one of your fields. This seems the fastest way possible.
Also, rather than spring up an annoying message box, reserve some room beneath the property pages to display a textual (red or otherwise) warning as to why, and then change to the appropriate property page, and highlight the offending control. Your validation routine can do this nice and easily as it loops through.
Even better, don't stop at the first error. One thing I HATE is correcting one field that I think is the only issue, only to be told every time I hit "OK" or "SUBMIT" that there's something else I missed.
I seriously think you should consider going the extra mile here... loop through ALL controls, and add all invalid ones to a list. Then change each offending control's background colour, tab colour etc... Then the user can work through and correct, no matter how many errors he or she made.