Challenges I Faced as a Beginner in Automation Testing — and How I Overcame Them
You are never too old to set a new goal or dream a new dream.
- Les Brown
Arise! Awake! And stop not until the goal is reached.
-Swami Vivekananda
As the above saying goes, I set my new goal as an Automation Engineer and started with my SDET course . But I don’t have any background related to the computer field. Slowly, my interests in this field started to bloom, as the world around me grew more and more technology based. Seeing rapid development in this field, my curiosity started to grow. When I started with my course, I had all kinds of doubts. For instance, Am I going the right way? Is the path I chose right or not? Without any prior knowledge, can I survive in this field? These were the questions I asked myself repeatedly, because after a long gap, I have chosen a totally different area of interest to learn.
Challenges I Faced:
Finding Xpath
Handling Exceptions
Communication and Collaboration Issue
1.Finding XPath:
XPath is a XML Path Language. It is also known as query language. XPath is for selecting nodes from an XML document or finding elements in an HTML web page. It provides an option to search for an element within a web page dynamically. XPath is defined by World Wide Web Consortium, Which is
an international organization that is maintaining the web standards.
Types Of XPath:
Absolute XPath:
This starts from the root element of the document and specifies the complete path to the element.It starts with the single slash where the root element is located. One of the disadvantages of this Absolute XPath is ,it follows the structure from root element to the target element. In the future, if some elements are added in between, this absolute Xpath fails.
Example:
/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div[1]/div[1]/input |
For instance, consider the HTML below:
<html><head>...</head><body>...<form id="loginForm"><input name="name" type="text" value="First Name" /><input name="name" type="text" value="Last Name" /><input name="email" type="text" value="Business Email" /><input name="password" type="password" /><input name="continue" type="submit" value="Sign Me Up" /></form></body></html> |
The syntax to select the business email field is as follows:
html/body/form/input[3] |
Relative XPath:
This starts from any point in the document based on the search criteria. This XPath starts with the double slash. It is directly targeting the element.
Syntax:
//tagName[@attribute=’value’] |
tagName => Tag names like input,button,div and span etc..
Attribute =>Attributes like id,name and classname etc..
value => Value of the Attribute
Example:
//input[@id=’abccds’] |
2.Handling Exceptions:
What is an Exception?
An uncommon event that takes place while a software application is executed, It is called an exception. It is a runtime error caused by an occurrence in the flow that ruins the flow. When an automation tester writes and executes a selenium script, the test can be impacted by unforeseen issues in the code , known as exception in selenium. Once this exception is encountered and passed to the runtime environment, the process is called “throwing the exception”.
Some Common Exceptions I faced at my project:
WebDriverException - This occurs when the WebDriver cannot interact with the browser because the session has ended.
TimeOutException - This occurs when waiting for an element or operation to complete but it takes too long.
ElementNotVisibleException - This occurs when Selenium tries to locate an element, but the element is not visible on the page. It means the element exists in the DOM but is hidden from view.
NoSuchElementException - This happens when Selenium cannot find an element on the web page. When the element does not exist on the page.
ElementNotInteractableException - This occurs when an element is present in the DOM but cannot be interacted with.This might be due to attempting to interact with the element before it is ready.
ElementClickInterceptedException - This happens when an element intercepts the click intended for another element, preventing the action from being completed.
NoAlertPresentException - This occurs when the code written to handle an alert cannot find the alert during execution.This means that the alert is not present on the web page.
StaleElementReferenceException - This occurs when you try to interact with a DOM element that is no longer attached to the DOM tree. This can happen when the element has been removed or page is refreshed, making the element to be outdated.
3.Communication and Collaboration Issue:
Issue:
Communication plays a vital role in a workplace. As a team, each member has to contribute, as well as try to understand each other's perceptions. Most of the projects don’t succeed due to lack of communication and collaboration in a team.
An unclear goal is difficult to work toward. Without having a clear idea of what needs to be done for the project and team members working mindlessly, which would decrease the motivation and productivity.This in turn, may contribute to negative feelings about a project.
Team members are more likely to be averse to collaboration when they aren’t in the track of the project or when they don’t understand what the rest of the team is doing to contribute to the project’s success.
Solution:
Team members should openly express their ideas and each team member should try to understand other members in the team. Each member has to understand the project’s goal, when it comes to analyzing progress and implementing changes to the project . So everybody can stay on the page.
Trust is one of the key elements to collaborate in a team. Each member should trust one another, so that they will feel more comfortable in expressing their ideas and collaborate with open mindedness.
As the saying goes “Too many cooks spoil the broth”. Each member has the right to express their ideas, But there should be one solution. That will take the project towards success.
In conclusion, even though I struggled a lot to understand each and every step in this process, As a result I learned to work in a group and face any problems with broad mindset. I am very lucky to have good and caring friends for my first group project. I personally learned lot of things from my teammates. They helped me a lot to understand things better. Now I am able to handle the xpath and exceptions with a good knowledge. Looking forward with great opportunity to work in selenium automation.


