ashharr / ashharr/xelement

Add other important element identifiers for the webpage.

Open
#5 5 comments 0 reactions 0 assignees View on GitHub
core application idea enhancement
Dominant language
JavaScript
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Need to add other identifiers for testers.

For testers, here are some commonly used identifiers that help locate and interact with elements on a webpage, along with **XPath** and **className**:

1. **ID** (`id`):
- A unique identifier assigned to an HTML element, typically the most reliable selector.
- Example: ``

2. **Name** (`name`):
- Often used for form elements, like inputs or buttons, especially in testing scenarios.
- Example: ``

3. **CSS Selectors** (`cssSelector`):
- CSS selectors provide a way to select elements based on CSS properties (e.g., classes, attributes).
- Example: `input[name='email']`

4. **Tag Name** (`tagName`):
- Identifies an element by its HTML tag (e.g., `

`, ``, ``).
- Example: `document.getElementsByTagName('input')`

5. **Class Name** (`className`):
- Selects elements by their `class` attribute, often used when many elements share the same class.
- Example: `

`

6. **Link Text** (`linkText`):
- Useful for testing links (anchor tags) by the exact visible text.
- Example: `
Submit` (selector: `By.linkText('Submit')`)

7. **Partial Link Text** (`partialLinkText`):
- Similar to `linkText`, but matches a portion of the link's text.
- Example: `Click here` (selector: `By.partialLinkText('Click')`)

8. **Attributes**:
- Elements can also be selected by attributes like `href`, `type`, `placeholder`, etc.
- Example: ``

9. **Relative XPath**:
- Provides flexibility by selecting elements based on their relationship to other elements.
- Example: `//button[text()='Submit']`

10. **Text Content** (`text`):
- Finds elements based on the visible text content of the element.
- Example: `document.querySelector('button').innerText`

Each of these identifiers can be essential for targeting and interacting with elements on webpages, particularly in automated testing scenarios like UI testing or form validation.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the JavaScript logic that detects webpage elements and exports their details to CSV. Compare the current exported identifiers with the requested list, then verify that the additional identifiers appear correctly for representative webpage elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.