Tushard8 / robotframework-seleniumlibrary

Automatically exported from code.google.com/p/robotframework-seleniumlibrary
Apache License 2.0
0 stars 0 forks source link

Add GUI mapping posibility. #182

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I propose to add possibility to address UI elements by alias name.

For example:

There are two pages - New Document form and Log-in Page.

New Document Form has got many fields with ids:
 - First Name field has got id=input1(in html)
 - Last Name field has got id=input2(in html)
 - ...

Log-in Page has got several fields with ids:
 - Log-in Name field has got id=input1(in html)
 - Password field has got id=input2(in html)
 - ...

For example in robotframework test cases i wanna name these elements like this:
   Input Text NewDocumentForm.FirstName Joe
   Input Text NewDocumentForm.LastName Malcom

   Input Text LoginPage.UserName Carrol
   Input Text LoginPage.Password ****

So, i propose to keep this mapping in some file, for example:

NewDocumentForm.FirstName=input1(or some XPath expresion )
NewDocumentForm.LastName=input2(or some XPath expresion )

LoginPage.UserName=input1(or some XPath expresion )
LoginPage.Password=input2(or some XPath expresion )

So SeleniumLibrary should be able to access this file and each time invoking 
its any own keyword to pull out  the real CSS or XPath or just id of element by 
alias i have shown above.

Thank you,
Fill free for any questions
With best regards
Andrew Kolesnik

Original issue reported on code.google.com by Kolesnik...@gmail.com on 17 Mar 2011 at 12:03

GoogleCodeExporter commented 8 years ago
Probably its needed to implement generally on robotframework level, not just on 
SeleniumLibrary.
does it make sense?

Original comment by Kolesnik...@gmail.com on 17 Mar 2011 at 12:52

GoogleCodeExporter commented 8 years ago
Does something prevent you from using Robot's normal variables for this purpose?

Original comment by pekka.klarck on 17 Mar 2011 at 6:28

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
2 purposes:
1. Just readability. For non-technical people aliases like ${....} will make 
some confuse. IMHO.
2. In my projects I suppose to use one bunch of test cases in testing with 2(at 
least) tools(Selenium and whatever). So i wanna just separate Gui mapping for 
each tool in such GUI files. I considered about resource files but variable 
notation(${..}) makes me afraid because of readability of test cases(keywords). 
Probably there is another solution but question is which one?

Original comment by Kolesnik...@gmail.com on 17 Mar 2011 at 8:58

GoogleCodeExporter commented 8 years ago
1) A generic solution requires a way to separate mapped values from normal 
strings. I agree that ${...} can look weird for non-techies but I believe that 
a) they don't normally need to see tests on that level and b) they can be 
educated to understand this syntax.

2) Instead of resource files you should consider variable files for this kind 
of mapping. You can even make your variable files dynamic and read values from 
some external source.

Because we believe variables are the way to handle this need, and generic 
enhancement ideas don't belong to this tracker, I mark this issue as WontFix. 
If you want to continue discussing about this please send a mail to 
robotframework-users. That way the idea gets more publicity and others can also 
voice their opinions.

Original comment by pekka.klarck on 17 Mar 2011 at 9:41

GoogleCodeExporter commented 8 years ago
Thank you, Pekka

Original comment by Kolesnik...@gmail.com on 17 Mar 2011 at 11:03