hello,
iam trying to loop through 11 Li elements to extract the inner text of h2 and h3 tags. iam getting errors below. please help
this is my sample code
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
var repo = BottomLineIIRepository.Instance;
var accname = repo.DigitalBanking.Accounts.accname;
var checkingacccont = repo.DigitalBanking.Accounts.checkingacccont;
var cardslist = repo.DigitalBanking.Accounts.cardslist;
//string[] list= new string[] {(List)cardslist};
IList mylist = accname.InnerText.ToList();
string acc_name = "";
foreach (var accname in accname)
acc_name=accname.GetAttributeValueText();
the error is:
A local variable named 'accname' cannot be declared in this scope because it would give a different meaning to 'accname', which is already used in a 'parent or current' scope to denote something else (CS0136) - C:\Dev\Git\Online\BottomLineII\BottomLineII\Small Business\Accounts\accountvalidation.cs:58,26
foreach statement cannot operate on variables of type 'Ranorex.H2Tag' because 'Ranorex.H2Tag' does not contain a public definition for 'GetEnumerator' (CS1579) - C:\Dev\Git\Online\BottomLineII\BottomLineII\Small Business\Accounts\accountvalidation.cs:58,13
iam attaching scapshot of the elements iam trying to loop.
loop through UI elements
loop through UI elements
You do not have the required permissions to view the files attached to this post.
Re: loop through UI elements
Hi,
Could you please upload a Ranorex snapshot showing the list of li elements? Screenshot is not very useful here. Also, I would suggest you to check this Ranorex code sample, describing how to create a list of adapters from repo element...
https://www.ranorex.com/#Createalistofa ... oryelement
Could you please upload a Ranorex snapshot showing the list of li elements? Screenshot is not very useful here. Also, I would suggest you to check this Ranorex code sample, describing how to create a list of adapters from repo element...
https://www.ranorex.com/#Createalistofa ... oryelement
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: loop through UI elements
those are the Li tags in the spy screenshot. each Li tag has div/div/h2 and h3 tags . i want to write a foreach loop to get the innertext of the h2 and h3 tags here. i do not have any other screenshot
Re: loop through UI elements
Hi,
I’m not asking for screenshot but snapshot! Please learn how to create one here...
https://www.ranorex.com/help/latest/ran ... hot-files/
Anyway, the link with code examples I posted before should lead the way.
I’m not asking for screenshot but snapshot! Please learn how to create one here...
https://www.ranorex.com/help/latest/ran ... hot-files/
Anyway, the link with code examples I posted before should lead the way.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: loop through UI elements
hello,
thank you for helping me. iam attaching the rxsnp. i am not able to follow the article on creating the list of adapters . i didnot understand how to implement in my project. please help.
thank you
thank you for helping me. iam attaching the rxsnp. i am not able to follow the article on creating the list of adapters . i didnot understand how to implement in my project. please help.
thank you
You do not have the required permissions to view the files attached to this post.
Re: loop through UI elements
i tried to do this
var repo = BottomLineIIRepository.Instance;
var acclist = repo.DigitalBanking.Accounts.acclist;
Report.Log(ReportLevel.Info,"starting test");
IList<Ranorex.H2Tag> accnamelist = repo.DigitalBanking.Accounts.acclistInfo.CreateAdapters<Ranorex.H2Tag>();
List<Ranorex.H2Tag> names = new List<H2Tag> {};
foreach (Ranorex.H2Tag tagh2 in accnamelist)
names.Add(tagh2.InnerText);
Report.Info("account name is: "+names);
getting this error in report:
Parsing RxPath 'Non Profit CD - 394518999' failed.
line 1:15 no viable alternative at character ' '
line 1:0 no viable alternative at input 'Non'
Show/Hide Stacktrace
at Ranorex.Core.RxPath..ctor(String path) at Ranorex.Core.Element.FromPath(String path) at Ranorex.H2Tag.op_Implicit(String path) at BottomLineII.Small_Business.Accounts.accountvalidation.Ranorex.Core.Testing.ITestModule.Run() in c:\Dev\Git\Online\BottomLineII\BottomLineII\Small Business\Accounts\accountvalidation.cs:line 58 at Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Int32 iterationCount, Boolean skipIteration)
var repo = BottomLineIIRepository.Instance;
var acclist = repo.DigitalBanking.Accounts.acclist;
Report.Log(ReportLevel.Info,"starting test");
IList<Ranorex.H2Tag> accnamelist = repo.DigitalBanking.Accounts.acclistInfo.CreateAdapters<Ranorex.H2Tag>();
List<Ranorex.H2Tag> names = new List<H2Tag> {};
foreach (Ranorex.H2Tag tagh2 in accnamelist)
names.Add(tagh2.InnerText);
Report.Info("account name is: "+names);
getting this error in report:
Parsing RxPath 'Non Profit CD - 394518999' failed.
line 1:15 no viable alternative at character ' '
line 1:0 no viable alternative at input 'Non'
Show/Hide Stacktrace
at Ranorex.Core.RxPath..ctor(String path) at Ranorex.Core.Element.FromPath(String path) at Ranorex.H2Tag.op_Implicit(String path) at BottomLineII.Small_Business.Accounts.accountvalidation.Ranorex.Core.Testing.ITestModule.Run() in c:\Dev\Git\Online\BottomLineII\BottomLineII\Small Business\Accounts\accountvalidation.cs:line 58 at Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Int32 iterationCount, Boolean skipIteration)
Re: loop through UI elements
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration