How to locate webelement having dynamic id in numerical format only? - webdriver

How to locate web element having dynamic id in numeric format only?
we have tried by using contains() method
//a[contains(#id,'*')]
also tried as
//a[#id=.]

Have you tried
//a[matches(#id,'\d')]

Related

How Convert amount to rupees and paise in words in Devexpress Xtrareport

I want to convert the summery of devexpress report to words. I found a question 'convert amount to rupees and paise in words format in c#' here convert amount to rupees and paise in words format in c# But i dont know how to use the code for devexpress report to convert the number to word? Please help me how to do.
if you're using the end-user-designer (not the visual studio), i may suggest to register custom function 'RupeesToWords' for binding expressions.
in this new function implemetation you may write your custom code.
in the XRLabel's summary expression specify the expression like this
RupeesToWords(sumSum(Value))
Assuming you were to display this value in an XRLabel, you could handle the XRLabel's BeforePrint event and set the Label's text to the result of the code you've already found for the conversion process.

How to use suggest box for numbers

I'm trying to add a field on my form that suggests different ID's in the database. I'm getting the error suggest_field.ID does not support the startsWith function. Is there any way to change this so that I can use the Suggest box with numbers
Since your IDs are integers and not strings they do not have a startsWith function. You can use (#datasource.items..Id).map(String) as your suggest box options and then autocomplete would work. Just be careful with value bindings as the types will not match - you may have to ditch bindings for value and use the onAttach and onValueChange events to convert the type to/from an integer and then set your datasource item's ID value (use parseInt(string) to convert a string to a number type and use number.toString() to convert a number to a string).

XDocReport number formatting in table

I have a template, where I have a table with column which I want to format as currency (2 decimal places). I'm using Velocity and NumberTool, which is putted in context.
I tried to use <<$number.format("currency", $My_data)>> in template, but as result I got empty column.
Is there some possibility to format list field in table without writing e.g. new foreach? Is some function which can be use in tempate to format field in one column?
Regards
I resolve it by myself.
I must just override VelocityTemplateEngine and Formatter to recognize phrases like <<$numberTool.format($My_data)>>, becouse default formatter was looking for field name after first '$'.

how can I join two regex into one?

I have two regex that I need to join into one as I am using the RegularExpressionAttribute in ASP.NET and it does not allow multiple instances.
How can I join the following two regex into one?
.*?#(?!.*?\.\.)[^#]+$
[\x00-\x7F]
the first one checks that there are not 2 consecutive dots in the domain part of an email and the second regex checks that all characters are ascii
I thought it might have been as easy as joining them together like (.*?#(?!.*?\.\.)[^#]+$)([\x00-\x7F]) but this does not work
Here is link to previous post relating to this problem
EDIT: I am decorating an string property of my viewmodel using reglarexpression attribute and this gets rendered into javascript using unobtrusive therefore it has to validate using javascript. I failed to mention this in my initial post
You can use:
^[\x00-\x7F]+?#(?!.*?\.\.)(?=[\x01-\x7F]+$)[^#]+$
You can just use this regex
^[\x00-\x7F-[#]]*?#(?!.*?\.\.)[\x00-\x7F-[#]]+$
Or, if you want to match at least 1 character before #:
^[\x00-\x7F]+#(?!.*?\.\.)[\x00-\x7F-[#]]+$
Mind that [\x00-\x7F] also includes # symbol. In C# regex, we can subtract this from the range using -[#] inside the character class.
And you do not need the anchors since you are using this in a RegularExpressionAttribute, I believe.
Here is a demo on regexstorm.net, remove the second #, and you will have a match.

Edit ASP.NET Dynamic Data visibleTables Display Names?

I've figured out how to use metadata to define the displaynames for table data I want to rename - but I haven't figured out how to do this to the tables themselves - so that when the initial dynamic data menu comes up the menu options are friendly rather than the actual table names. Any suggestions?
See the TableNameAttribute. It takes effect when you reference MetaTable.DisplayName. The attribute can be applied either to the specific table class, or its associated MetadataType class.

Resources