Selenium IDE : How to press 'Enter' once text is entered in the search field using - selenium-ide

I am using Selenium IDE 2.9.1 + FireFox 52.0.1. I have a data table with search fields.
Once I enter text in the search field which command should I use to simulate a user pressing Enter (submit to search this text in the data table).

Here is how I accomplish this with Selenium IDE
Command: sendKeys
Target:
Value: UTF for Enter - U+E007

You can use keypress command to stimulate the button events.
Below is an example of searching test string in google.
You should specify the field's selector in the keypress event.
Here \13 is the ASCII value of Enter Key.
<tr>
<td>type</td>
<td>id=lst-ib</td>
<td>test</td>
</tr>
<tr>
<td>keyPress</td>
<td>id=lst-ib</td>
<td>\13</td>
</tr>

I'll mirror what's been said above, but, the best bet here is to use SENDKEYS and get the actual ID of the element from the DOM to pass in as the identifier (:value)

Related

Keyboard Shortcut to Surround Selection with HTML Tag

Desired Steps:
Highlight (select) HTML/text, e.g. really
Press keyboard shortcut
Highlighted text becomes <b>really</b>
How to?
In a Javadoc comment you can just select the text which you want to wrap in a <b> tag and press CTRL+Space. Select the <b> template, press Enter and the selected text gets surrounded as expected. There are pre-defined templates for <b>, <code>, <i> and <pre>. You can define your own templates here: Java -> Editor -> Templates.
You're looking for Quick Fix/Quick Assist: Ctrl/Cmd+1. Then start typing the tag name.

from sql, php generating msWord need to show a carriage return?

My PHP generates a Word document, but it will not render carriage returns. My CKEditor translates a carriage return into either,
<br>, or <div>asdf</div>
When the Word document is created, it will display those HTML tags, so I strip them out. What replacement code, character, ascii, or tag can I use so that when the page is rendered, it shows the text like it did in the Editor?
Current example - if you have the text "Don't jump off the" [then hit Enter, so that the next word is below it]...
"cliff." Instead, currently, that gets saved into SQL as:
Don't jump off the <br>cliff.
Don't jump off the <div>cliff</div>.
...depending on which browser is used. In the msWord output, any tags left in the content [exceptions to strip_tags function] get displayed literally in msWord. Or, if I replace the tags with ASCII 
 it displays that literally, too. Not sure if this helps, but this is defined at the top of my php report_generator.php file:
require_once '/var/www/PhpWord/src/PhpWord/Autoloader.php';
\PhpOffice\PhpWord\Autoloader::register();
include "/var/www/ncpcphp/NCPC_PHP_Functions.php";
DEFINE("WRITEtoFDOCS", "NO");
DEFINE("FDOCSDIRECTORY", "Contract Attachments");
DEFINE("MIMETYPE","application/vnd.openxmlformats-officedocument.wordprocessingml.document" );
Help - what can I use to cause the output to show the carriage return?
Thank you, Cindy. Your answer is a piece of the solution. My CKEditor saves carriage returns as either
<br>, <br />, or <div></div>
depending on which browser is used Chrome[div] or Firefox[br] - that goes into my msSQL. Yet, if my editor has turned-on an "Enter filter" [keycode-13] in order to prevent someone from enter-editing a [[Placeholder]] (ckeditor read-onlyplugin) then saved editor text strips out the Enter. So, I did this: kept in the enter filter because it is necessary, then after the text carriage returns are saved as br's or div's, when I run my report generator, I replace
<br>, <br />, and <div></div>
with "\n" like you said. Then I explode the text variable like this:
$show_cad = explode("\n", $show_cad);
foreach($show_cad as $line) {
$section->addText(htmlspecialchars($line));
}
The code in the editor needed to filter out the Enters only when Enter is pressed in the [[Placeholder]] plug in is more complex, and I got largely from CKEditor themselves. They request that I do not post their full solutions, but if you like I could show you pieces of it. Basically, I had to register the Placeholder widget. Then when Enter is pressed, it checks if the context is with Placeholder. If so, filter the Enter [then it disappears from the saved editor text], but if Enter is pressed elsewhere, it gets saved and used properly.
Thank you for your help!

Can't enter text to textfield with input type 'email'

I can't seem to enter text into a email type text field. How to enter text to a text field with email type?
Here is the code snippets i got from the page:
<input type="email" name="email-123" ng-model="value123" ng-disabled="(v.disable === true)">
Here is what I have tried so far and it is not working,
type | xpath=/html/body/div[1]/portal/div/div/tenants/div/div/div[2‌​]/form/div[1]/div/di‌​v/md-content/fieldse‌​t[3]/div[1]/div/div/‌​md-input-container/i‌​nput[#name='email-12‌​3'] | "aaa#yopmail.com"
The first thing I'd do is try to simplify the xpath, you don't need to start from the very beginning of the page. If the element is unique,
//i‌​nput[#name='email-12‌​3']
will suffice. It may just be failing to resolve such a long xpath to find the element.

How do I change opening and closing tag at the same time in Sublime Text 3

What is the easiest way to change the opening and closing code tag?
I especially need a way to do it using Sublime Text 3's Multi-Select... so I don't have to change it 1,000 times. And find and replace won't work because I need to change only specific matches.
EX: CHANGE ALL DIVs with class="item" to tr tags
(ignore my improperly formated code this is for example only)
<div class="item">foo foo bar is foofoobar</div>
<div class="item">bar foo is barfoo</div>
<div> not a match for .item</div>
<div class="item">foo bar foo is foobarfoo</div>
BECOMES
<tr class="item">foo foo bar is foofoobar</tr>
<tr class="item">bar foo is barfoo</tr>
<div> not a match for .item</div>
<tr class="item">foo bar foo is foobarfoo</tr>
I couldn't find the answer so I'm answering my own question.
What is the easiest way to change the opening and closing code tag?
I especially need a way to do it using Sublime Text 3's Multi-Select... so I don't have to change it 1,000 times. And find and replace won't work because I need to change only specific matches.
HERE GOES - THE ANSWER :
Install Emmet
Then select the opening tag you want to change.
(if you need to multi select -->) Hit ALT + F3.
Now (with Emmet installed) hit CTRL + SHIFT + u
Now change your tag and hit enter/return
EX: CHANGE ALL DIVs with class="item" to tr tags
(ignore my improperly formated code this is for example only)
<div class="item">foo foo bar is foofoobar</div>
<div class="item">bar foo is barfoo</div>
<div> not a match for .item</div>
<div class="item">foo bar foo is foobarfoo</div>
Highlight div class="item"
hit ALT + F3 to select all matching divs
hit CTRL + SHIFT + u
type "tr" and hit enter
DONE PRESTO MAGICO
<tr class="item">foo foo bar is foofoobar</tr>
<tr class="item">bar foo is barfoo</tr>
<div> not a match for .item</div>
<tr class="item">foo bar foo is foobarfoo</tr>
POSSIBLE ISSUES:
Package Control not working
I had to uninstall Package Control before installing Emmet as my Package Control had become corrupt somehow.
Solution:
This post answers the question of how to fix a corrupt package control item.
Why is Sublime Package Control not working?
Wrong Shortcode
It is possible your shortcode is conflicted with another plugin or your shortcode has changed from the default assignment.
Solution:
Go to
Preferences > Package Settings > Emmet > Key Bindings - Default
Look for "update_as_you_type" and check the "keys" assigned. This is the keyboard shortcut you should be using. If that still does not work. Try changing the key assignment.

How to search for this string using regular expressions in Eclipse?

I am trying to find and replace this lines:
<div id="fixed_bottom"></div>
</div>
<jsp:include flush="true" page="../includes/footer.jsp"/>
with this:
<jsp:include flush="true" page="../includes/footer.jsp"/>
<div id="fixed_bottom"></div>
</div>
And I do not know how to find them, because there are two line breaks in the sentence.
Any help would be appreciated, thank you so much!
\n or \r\n indicate line break in a regular expression depending on what OS you are on. See http://www.regular-expressions.info/reference.html for more help on regular expressions
If you are using the built in Eclipse "Search File" with the regular expression box checked it will build the search string for you (if you had it highlighted before you opened search box). Note if you have to check the regular expression box you need to close the dialog and re open to get it to refresh. From there you can see Eclipse uses the somewhat odd \R for newlines.