5 Answers, 1 is accepted
0
Hello Madhu,
Check out the detailed step-by-step guide on Test Studio. A simple search on "RegEx" will take you to the chapter on regular expression:
http://www.telerik.com/documents/automated-testing-tools/WebUITestStudioQAEditionStepByStep.pdf
Test Studio uses regular expressions the same way they're used in the .NET Framework. What this means is that you can look at any .NET RegEx tutorials. Here is an example I found useful:
http://support.microsoft.com/kb/308252
In this tutorial you can see an example:
Regex emailregex = new Regex("(?<user>[^@]+)@(?<host>.+)");
which is a regular expression object used to describe an e-mail pattern. For instance:
I hope this answers your question; please don't hesitate to contact us again if you need more help.
Regards,
Anthony
the Telerik team
Check out the detailed step-by-step guide on Test Studio. A simple search on "RegEx" will take you to the chapter on regular expression:
http://www.telerik.com/documents/automated-testing-tools/WebUITestStudioQAEditionStepByStep.pdf
Test Studio uses regular expressions the same way they're used in the .NET Framework. What this means is that you can look at any .NET RegEx tutorials. Here is an example I found useful:
http://support.microsoft.com/kb/308252
In this tutorial you can see an example:
Regex emailregex = new Regex("(?<user>[^@]+)@(?<host>.+)");
which is a regular expression object used to describe an e-mail pattern. For instance:
johndoe@tempuri.org
If you wanted to verify an e-mail link using Test Studio you can use the same regular expression in your regex verification: (?<user>[^@]+)@(?<host>.+)I hope this answers your question; please don't hesitate to contact us again if you need more help.
Regards,
Anthony
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
Register Today!
0
Rohit
Top achievements
Rank 2
answered on 19 Jan 2012, 12:29 PM
How to find an element using expression.
My Scenario is :-
In My application there is link generated at Run time. It is a hyperlink which contain(IA:Auto1234567890 | rohit malhotra | 4000 rs)
I want to find this hyperlink with only this string "Auto1234567890" instead of (IA:Auto1234567890 | rohit malhotra | 4000 rs) exact same.
i used the code snippet below:-
Manger.ActiveBrowser.Imagehyperlink.Find.ByTextContent("Auto1234567890").Highlight();
Manger.ActiveBrowser.Imagehyperlink.Find.ByTextContent("~Auto1234567890").Highlight(); (contains)
Manger.ActiveBrowser.Imagehyperlink.Find.ByTextContent("%{Auto1234567890}%").Highlight(); (using wild cards)
All are fails Element not found :( :( :( :( :(
but it fail :( :( :( :( :(
Please help me how can i find the element which contains string only "Auto1234567890" instead of (IA:Auto1234567890 | rohit malhotra | 4000 rs) exact same.
My Scenario is :-
In My application there is link generated at Run time. It is a hyperlink which contain(IA:Auto1234567890 | rohit malhotra | 4000 rs)
I want to find this hyperlink with only this string "Auto1234567890" instead of (IA:Auto1234567890 | rohit malhotra | 4000 rs) exact same.
i used the code snippet below:-
Manger.ActiveBrowser.Imagehyperlink.Find.ByTextContent("Auto1234567890").Highlight();
Manger.ActiveBrowser.Imagehyperlink.Find.ByTextContent("~Auto1234567890").Highlight(); (contains)
Manger.ActiveBrowser.Imagehyperlink.Find.ByTextContent("%{Auto1234567890}%").Highlight(); (using wild cards)
All are fails Element not found :( :( :( :( :(
but it fail :( :( :( :( :(
Please help me how can i find the element which contains string only "Auto1234567890" instead of (IA:Auto1234567890 | rohit malhotra | 4000 rs) exact same.
0
Hello Rohit,
Find more information here.
Kind regards,
Anthony
the Telerik team
Use the following code to locate a link based on a partial match of its text content:
HtmlAnchor a = Find.ByExpression<HtmlAnchor>(
"textcontent=~Auto1234567890"
);
Assert.IsNotNull(a);
a.Click();
Find more information here.
Kind regards,
Anthony
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Rohit
Top achievements
Rank 2
answered on 20 Jan 2012, 10:03 AM
Hi Anthony,
we are using silverlight application please tell me solution regarding the same.
we are using silverlight application please tell me solution regarding the same.
0
Hello,
See here for more information.
Regards,
Anthony
the Telerik team
Use the following code to locate a Silverlight element based on a partial match of its text content:
SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
FrameworkElement fe = app.Find.ByTextContent(
"~Auto1234567890"
);
fe.User.Click();
See here for more information.
Regards,
Anthony
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items