Contributions
Re: How to verify whether a blinking cursor is currently inside of a text box
Got it. Everything works now, thank you! var actualFocusedElement = Sys.Browser().Page("*BC/Report*").contentDocument.activeElement.id if(aqString.Contains(actualElement, "saveDialog_tmpl_sfsName", 0, true)) Log.Message("The blinking cursor is inside of the name text box") else Log.Error("The blinking cursor is not inside of the name text box") I used the actual focused element's ObjectIdentifier (ID) and compared it against the expected ID, utilizing the activeElement jScript function.3.5KViews0likes0CommentsRe: How to verify whether a blinking cursor is currently inside of a text box
Is this what you were referring to when you said I can make direct calls to jscript functions? Why is it that I can not use the NameMapping Aliase pages to call the "contentDocument" function? For example, contentDocument is not available for the following: Aliases.iexplore.IESA.contentDocument.activeElement.id or var reportPage = Aliases.iexplore.IESA; reportPage.contentDocument.activeElement.id1.9KViews0likes1CommentRe: How to verify whether a blinking cursor is currently inside of a text box
Ok thanks. How exactly would I convert that into Jscript code if I find a DOM property that can check focus? I found the following which uses activeElement, but I dont know how I could utilize this inside testcompletes Jscript code: http://stackoverflow.com/questions/497094/how-do-i-find-out-which-dom-element-has-the-focus3.8KViews0likes4CommentsRe: How to verify whether a blinking cursor is currently inside of a text box
>This had to be done in the Expression text box and the result of evaluation is displayed in the Result text box. I now typed it in the expression text box and clicked evaluate. Nothing happened. I then clicked inspect, and it says object non-existant. Keep in mind, this is AFTER I already saw that the object did exist. I then typed "saveWindowNameTextBox.Enabled" and clicked evaluate, and then it said "True" >To be sure that the Focused property is absent, check that Inspector is in the Advanced view (Advanced view texton the top of the windowmust be in bold and not underlined. Click it if this is not the case). Yes I am in advanced view. If I inspect the actual window that the name text box is within, the Focused property is there. But if I inspect any element inside that window, the Focused property is not there.3.8KViews0likes8CommentsRe: How to verify whether a blinking cursor is currently inside of a text box
-- if the saveWindowNameTextBox was found (its Exists property equals to True), then close the Inspector window and type saveWindowNameTextBox.Focused in the Evaluate dialog, press the Evaluate button and check the result. The object was found so I proceeded. I typed saveWindowNameTextBox.Focused in the "New value" text box and then I clicked "Evaluate". Testcomplete did nothing after I clicked Evaluate. I then changed the text in "New value" to "saveWindowNameTextBox.Enabled" and again, nothing happened. What is supposed to happen when I click "Evaluate"? Is this considered a bug when nothing happens? NOTE: When I inspect this text box object in the object inspector window, "Focused" is not listed in the list of properties.3.9KViews0likes10CommentsHow to verify whether a blinking cursor is currently inside of a text box
I am trying to verify that the text box gets the focus (the blinking cursor gets placed inside of it) after a certain action. I tried to use the Focused property, but it does not seem to work, or the object just doesnt have this property to begin with. Here is the code: mainWindow = Aliases.iexplore.IESA; saveWindow = mainWindow.Find("ObjectIdentifier", "MainContent_saveFilterSetDialog_saveDialog", 50, true); saveWindowNameTextBox = saveWindow.Find("ObjectIdentifier", "*MainContent_*_sfsName", 25, true); if(saveWindowNameTextBox.Focused == true) Log.Message("The blinking cursor is inside of the name text box") else Log.Error("The blinking cursor is not inside of the name text box") The logging window says "Waiting for Focused", then it fails and the log says "Unable to find the object with the specified properties" Is there another way to accomplish this?Solved4.4KViews0likes14CommentsRe: How to verify whether a blinking cursor is currently inside of a text box
Hello, I will get that info. for you when I talk to the developer. In the meantime, I would like to add one more piece of info. The object is found and my Finds are correct, as in debug mode, the object is found correctly. While it tries to perform the If statement, the logging window says "Waiting for Focused". So maybe the object doesnt have this property?3.9KViews0likes12CommentsRe: How to represent End Line in a String for TestComplete using Javascript
So I found 2 solutions: 1. I used contentText property as suggested above. This passes only when I include one "\n". My warning label has 3 line-breaks when visually verifying, so this method doesnt accurately verify the message. See below: if(warningMessage.contentText== "First Line\nSecond Line") Log.Checkpoint("Pass"); else Log.Error("Fail"); 2. The next solution is using the innerText property, but instead of "\n", I have to use "\r\n". I'm not sure why this works, as it was just a suggestion in another forum if(warningMessage.innerText== "First Line\r\n\r\n\r\nSecond Line") Log.Checkpoint("Pass"); else Log.Error("Fail");4KViews1like0CommentsRe: How to represent End Line in a String for TestComplete using Javascript
The value of innerText is exactly what I pasted in the original post. When I paste it in notepad, It shows text on the first line, then it has a couple end lines and shows the next set of text. Could that be an Array inside innerText? I never saw that before. Anyway, the warning message label in question is a web element with the following attribute: <SPAN id=warningMessageLabelID>First Line<BR><BR> <CENTER>Second Line</CENTER></SPAN> If I cant find a solution to verifying End Lines with text, then I can use the aqString.Find workaround. Thanks4KViews0likes3Comments