IE10 and showModelDialog title show #Name? - internet-explorer-10

We are in process of testing our current web application in IE10(compatibility mode). Throughout our application we use showModelDialog method and title of dialog message always end up with #Name? i.e. if title of page is My, then title appears on dialog window is My#Name?. Please use the link below to see the problem in action.
http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialog2.htm
Set dialog height using drop down and then click 'Push To Create' button. Dialog appears on the screen has title end with #Name?.
In earlier versions of IE it used to be Webpage Dialog.
Is there any way to get rid of the #Name? and I do not want to use spaces after the title as there still appears ... at the end of title.
Thanks,

Related

robotframework- unable to click a button on a modal dialogue box

when I open a particular webpage it has a EULA form that appears on top of the home page in the form of a modal in HTML/CSS. I have tried the XPath of the accept button but it says element not found also tried using handle alert.
is there a unique way to handle a dialogue box in robotframework?
image of HTML in inspect view
SeleniumLibrary.Set Focus To Element ${button_on_popup_page}
SeleniumLibrary.Click Element ${button_on_popup_page}
I figured it out, shown in the above code. I first set focus to the button and then used the click element. This seemed to work.

How to handle modal/ pop-up using automation

Tried to handle the pop-up many ways, need clarity do we need to change the body. because when the pop-up is displayed the new class is adding it is as below.
https://i.stack.imgur.com/jQC2B.png
The actual Pop-up class is as below. there is no close button for this pop-up.
https://i.stack.imgur.com/e1ZWc.png
-By manual user can close the pop-up when user click any where in the page. When i tried click any where using automation it is displaying as element not found
Here is the code i user to handle the pop-up i am so confused how to handle the pop-up
https://i.stack.imgur.com/ibf0j.png
Thanks for help in advance
please try to check the javascript from where this pop-up is executing and try to disable display property by setting it to none
Try to remove this div class name "_355Q0" from DOM. by using this javascript query.
var myobj = document.querySelector("._355Q0")
myobj.remove();

Finding buttons on a webpage using Selenium

I am trying to automate a web based application and I am having trouble finding buttons in order to click on them.
Basically there are a number of text boxes on a screen and next to each text box is a "Go" button. Once you hit the "Go" a popup will be overlayed on the screen saying "Are you Sure?" and 2 buttons Yes/No. Where I am getting stuck is after the first set of buttons on the Yes/No popup buttons. Each button has a non-unique class name and no name variable, so I am finding each button by its tagName and then clicking on the relevant element
WebElement aButtons = driver.findElements(By.tagName("button");
aButtons .get(x).click();
This works until aButtons .get(x).click(); throws an exception saying the element isn't clickable. On further inspection of aButtons it has a size of 78 elements, despite there being only 33 visable buttons on the page.
Does anyone have a suggestion on how to find my buttons better? Or perhaps how to handle the exception such that I can, with a bit of trial and error, find the element? If the exception could be ignored, I could probably use a for loop in increments of 10 in order to find which element the Yes/No buttons correspond to.
If I ruled the world I would go to the developer of this webpage and ask them to make the buttons more easily identifiable, but that unfortunately is out of the question
When I inspect the elements in question this is the block in the html that gets highlighted
"Go" button:
<
button type "submit" ng-click="vm.click()" ng-disabled = "vm.isDisabled()"
class = "btn btn"> Generate <button/
>
<
button class ="btn" ng-show="vm.runScripts" ng-click="vm.runScript()" ng-
disabled ="vm.runScript.isScriptRunning">
>span class = "glyphicon play" aria-hidden="true"></span>
Yes
</button>
I was having trouble with the formatting of the above since I am unfamiliar with posting html code.v the 2nd button is the yes button.
(Note the "No" button has the same "btn" class name). When I tried to find the element based off of the class name " glyphicon play" I got an error saying compound class names are not valid. I was able to find the "Go" buttons since they were sequential, so like aButtons .get(1).click(); was the first Go button on the page, aButtons .get(2).click(); was the second etc.
I cannot share the url since it is an internal site.

Give focus to text-entry field in prompt in node-webkit

In most browsers, a javascript prompt() gives focus to the text entry field so the user can begin typing immediately.
In node-webkit, a javascript prompt() gives focus to the prompt window, but not the text entry field. The user has to click inside the field before typing.
How can I set the focus to inside the text entry field when using a prompt in node-webkit?
An extensible way is to create your own prompts with a javascript modal window. Many of the common JS frameworks have easy ways of creating a modal window which will give you complete control over the text and inputs being displayed.

Unable to handle confrimation box with selenium RC

i am trying to press the ok button from a confirmation box like this (i added Thread.spleep so i checked the button is pressed and the confirmation box is shown)
selenium.chooseOkOnNextConfirmation();
selenium.click("xpath=//a[contains(#href,'123')]");
assertTrue(selenium.getConfirmation().equalsIgnoreCase("123"));
but i get this
com.thoughtworks.selenium.SeleniumException: ERROR: There were no confirmations
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262)
at com.thoughtworks.selenium.DefaultSelenium.getConfirmation(DefaultSelenium.java:429)
Thx for your help.
I got the same error with the code
selenium.chooseCancelOnNextConfirmation();//点击cancel按钮
selenium.click("link=Delete");
selenium.getConfirmation();
Finally I find the reason is that the developer used the jconfirm function of jquery instead of window.confirm, and the jconfirm function is override with div.
Finally I used assertTrue(selenium.isElementPresent("id=popup_container")).
from this information it is hard to say exactly. but i will give you some info which will help you
java script generates 3 types of pop-up windows
1) Alerts
2)Confirmations
3)Prompts
your case, i guess
1) may be the statement selenium.click() you used, is not triggering the confirmation box
OR
2) if it is triggering, then it may not be the Confirmation box.it could be any one of the other 2 boxes
so, you must make sure manually what type of pop-up window it is and call the statements accordingly.
ex : Confirmation window : conatins OK and Cancel buttons
Alert window : contains only OK button
Prompt window : contains Textbox and OK and Cancel buttons
so check and use that commands respectively
if it is not the above case please the HTML code also