how to highlight text after using istextpresent() in selenium RC.
selenium.isTextPresent("Welcome");
After searching i want to highlight this text!
You can use highlight command to make the particular element locator to highlight. It highlights the element in Yellow color.
selenium.highlight("//*[text()[contains(.,'Welcome')]]");
The above given Xpath is a sample one based on your input. Change it according to your HTML code.
Suggestion:
Selenium RC is a deprecated one and it has no further development. You can use WebDriver.
Related
I have this little challenge.
I want to ask, how do i sort the emails using the color code (light green) as stated in this picture here
I have tried to remove the non emails by scrolling through, but i need a solution that can make it a one click through sorting.
I will appreciate your kind response.
Open the Replace dialog box and enter the following regex in the Find field:
^((.*#[^\.]*)|([^#]+))$\n
Change the radio button to Regular Expressions. This regex pattern finds any line without a dot after # or any line without a #. Note that you need the last line of the document to be empty as shown in line 7 of your document.
Since we are deleting those lines, the "Replace with" field is blank. Now click Replace All.
I have some text in CKEditor which should be editable and some text which should be non-editable.
The non-editable text I am enclosing in a span as below.
<span contenteditable="false" unselectable="on">Here is where my non-editable text goes</span>
The editable text I am enclosing in a span as below.
<span style="background-color:Yellow">$[insert Date]</span>
Here we are using style background yellow to highlight the editable text in yellow to the user.
I put my cursor within the editable text and move using the left or right arrow keys. Once I move outside the editable text area, I am able to remove even the non-editable text using backspace.
The issue is that as soon as my cursor moves outside the editable text area the code isn't able to detect any key press due to which I am not able to restrict the backspace or delete.
Does Range functionality help in this issue? If yes please help and give an example of where we can use the Range code.
EDIT:
It came to my attention that there is a $nonEditable dtd descriptor that could also come in handy:
https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dtd.html
https://ckeditor.com/old//forums/CKEditor-3.x/Forcing-custom-element-be-BLOCK-level-element
PREVIOUS:
You could use the widget functionality to make the text ineditable-- using contenteditable="false" in CKEditor can be a bit unpredictable, but the creating a widget extension plugin can have really nice results.
It would be a very basic widget that simply uses the upcast checking if the element has 'unselectable="on"', then the text will automatically become uneditable and using the arrow keys will simply skip over the text instead of entering it. You also get quite a bit of other functionality with the widget plugin and it makes it much easier to integrate into things like events, dialog editing, etc.
You can get a widget creation tutorial here:
https://docs.ckeditor.com/ckeditor4/latest/guide/widget_sdk_tutorial_1.html
For more information, I just answered a question about making parts ineditable here:
How can I create uneditable fields on CK Editor?
Does anybody know of a non-manual method of highlighting syntax when pasted in InDesign?
I'm trying to show code of a project in an InDesign documentation but don't want to have to manually highlight the code, and preferably add numbered rows too.
Is there a plugin to achieve this?
This is the style in which I'd like to format the code.
Cheers
Not sure if you worked out an answer to this, but there's no magic button that will solve your problem.
However, InDesign does have a facility in each Paragraph style called GREP that can do what you're looking for.
This lets you write 'regex' or 'regular expressions' that are just rules for what to apply a given character style to. Yes, they look about as meaningful as Harry Potter incantations at first glance, but 2 or 3 simple regexes will get you a long way.
For instance:
(\<|<)!--\s*.*?\s*--(\>|>)
Will target HTML comments only.
(?<=").*?(?=")
This will target anything wrapped in straight double quotes.
(?<=\().*?(?=\))
This will target any text inside parentheses ().
There's an '#' symbol button in that GREP style next to where you type the regex - that gives you a drop-down menu that is almost like a 'Regex Wizard'. Try that too.
When you've got a regex that works, create a new character style for the text color and select it in the 'Apply Style' input.
Regexr.com has a tool that is good for testing this stuff. Paste your code sample in the bottom panel and your line of regex in the top. The bits that it targets will turn blue.
There is a searchable community panel on the left where people have probably already written expressions like the one you need.
I'm working out a JavaScript highlighter at the moment. It's a shame there's no communal 'Indesign style sharing library'.
Best of luck.
If had luck pasting syntax highlighted code into a Rich Text editor like Libre Office and then pasting it into Indesign. Just make sure whatever font your syntax highlighted code is in is also in InDesign because you'll get font missing errors when you pre-flight the book.
I'm currently using the Kendo UI web inline editor to edit content and wondered if it was possible to stop the editor from removing white space around the DIV element in source view? It currently keeps the format inside DIVs but not around the DIV element itself.
I was looking for a simple answer to this problem too, unfortunately there doesn't seem to be one. I'm working with KendoUI 2013.3.1119, I suppose in other versions of the editor the problem will be the same.
I was looking into the source code (kendo.web.js), where the editor is initialized. Due to a problem with ranges in IE when HTML is indented, the editor strips all whitespaces using the following line:
value = element.val().replace(/[\r\n\v\f\t ]+/ig, " ");
Since I don't work with ranges in IE (actually, I don'T use IE at home at all), I simple replaced this line with
value = element.val();
and from that point on everything worked fine.
However, you need to be aware the this is a tweak in the kendoui core and might lead to unexpected behavious depending on your usecase.
For those interested, the line number is 30497 in kendo.web.js.
Regards,
Frank
I'm using sublime text 2 to code ruby.
Is there a way to highlight the keyword pairs(do...end) which is similar to the parentheses match mode?
Check out the new Bracket Highlighter 2 alpha branch. I believe you can now customize it to do what you are asking.
Take a look at the Sublime extension called BracketHighlighter (github). If it doesn't support Ruby, it should be easy to add - the logic is already there, you just need to add the 'brackets'.