estinI'm trying to automate testing of the code... well, written without tg in mind (no IDs on many elements, and a lot of elements with the same class names). I would appreciate any help (questions are below the code):

30 views
Skip to first unread message

irshad mohammed khan

unread,
Jul 13, 2015, 2:20:12 PM7/13/15
to webd...@googlegroups.com
I'm trying to automate testing of the code... well, written without testing in mind (no IDs on many elements, and a lot of elements with the same class names). I would appreciate any help (questions are below the code):


2015-06-28 15_10_29-..__ afras HR portal __...png

darrell

unread,
Jul 14, 2015, 1:30:39 PM7/14/15
to webd...@googlegroups.com
As a manual tester, I have to be able to uniquely identify the elements on the page and what I want to do to them (check them, click them, select them, etc.). I should be able to figure out WHAT I want to do regardless of how easy (or hard) it is to identify the elements. HOW I do it would require me to have helpful locators. Can you add identifier to the code? If the code is not testable then as a developer I have not done a very good job. By making the code testable getting it to production is easier. If as a developer my goal is to get code to QA then I need to redefine my goals. Until my code is in production and people are using it, I am not done. If writing testable code makes my code making to production faster than I am going to write testable code.

Now this is what I push for. If you do not have the luxury of doing quality assurance and you are REALLY doing quality control then you'll just have to spot the patterns and find unique, static locators to find the elements you need to interact with. There is no magic solution in this case. You just have to be good at working in a difficult situation.

Dee pak

unread,
Dec 2, 2015, 9:40:51 PM12/2/15
to webdriver
then you have to write this path Driver.findElement(By.Xpath('//Span[@Class ="Kicon Kfilet"]))

David

unread,
Dec 5, 2015, 1:15:06 AM12/5/15
to webdriver
This would be a good time to learn & practice good XPath and CSS selector skills for encountering such situations.
Reply all
Reply to author
Forward
0 new messages