**Exploring the "contains" Function in XPath - Notes:** - Introduction: - Similar to "starts-with," useful for locating dynamic web elements. - Scenario: - Web elements with attributes that change with page refresh. - Attribute may contain a static part followed by a dynamic part. - Using the "contains" Function: - Format: double forward slash for relative XPath, followed by the tag name in square brackets. - Use "contains(@attribute, 'partial_value')" to locate dynamic web elements. - Advantages: Specify any part of the attribute value (start, middle, end). - Example: - To locate input elements with the name attribute containing "user": - XPath: "input[contains(@name, 'user')]". - Test Execution: - The test opens the browser, types in the dummy email, and closes it, passing the test successfully. - Conclusion: - "Contains" function in XPath is valuable for locating dynamic web elements. - It allows specifying partial attribute values to identify desired elements. - Combining "contains" with "starts-with" can enhance automation framework efficiency.
Hi Sir, If the value is variable type then how could we find with the contains function. '(//div[contains(text(), value)])' Here in my program "value" is not constant.Everytime i need to take value from for loop. Please let me know how to find text value if it is in variable mode
Hi Sir, Thank you so much for such an amazing idea about robot, I have started writing script using robot framework, I was lagging on UnexpectedAlertPresentException occurs, i'm very new to handle this exception so please upload a video about Handling exception on pycharm
**Exploring the "contains" Function in XPath - Notes:**
- Introduction:
- Similar to "starts-with," useful for locating dynamic web elements.
- Scenario:
- Web elements with attributes that change with page refresh.
- Attribute may contain a static part followed by a dynamic part.
- Using the "contains" Function:
- Format: double forward slash for relative XPath, followed by the tag name in square brackets.
- Use "contains(@attribute, 'partial_value')" to locate dynamic web elements.
- Advantages: Specify any part of the attribute value (start, middle, end).
- Example:
- To locate input elements with the name attribute containing "user":
- XPath: "input[contains(@name, 'user')]".
- Test Execution:
- The test opens the browser, types in the dummy email, and closes it, passing the test successfully.
- Conclusion:
- "Contains" function in XPath is valuable for locating dynamic web elements.
- It allows specifying partial attribute values to identify desired elements.
- Combining "contains" with "starts-with" can enhance automation framework efficiency.
Nice explanation
MASHALLAH SUPER EXPLAIN. THANKS A LOT
Subscribed and enrolled, thank you.
@Alla thank you very much!
thank you
amazing explanation ,,Thank you so much sir
Thanks and welcome
Thank you sir. I will share to help out :)
thank you for the video
Hi Sir, If the value is variable type then how could we find with the contains function. '(//div[contains(text(), value)])'
Here in my program "value" is not constant.Everytime i need to take value from for loop. Please let me know how to find text value if it is in variable mode
Hi Sir, Thank you so much for such an amazing idea about robot,
I have started writing script using robot framework, I was lagging on UnexpectedAlertPresentException occurs, i'm very new to handle this exception so please upload a video about Handling exception on pycharm
how to find an xath with text using contains