Input Text: This keyword is used to give text into the text field identified by the locator.
Syntax: Input Text locator text
Clear Element Text: This keyword is used to Clear the value of the text-input element identified by the locator.
Syntax: Clear Element Text locator
Click Button: This keyword is used to Click the button identified by the locator.
Syntax: Click Button locator
Note: By default, buttons are searched using id, name and value.
Example Test Case:
- Open Browser Navigate to Demo Form URL: https://testingcolleges.blogspot.com/2023/08/demo-form.html
- Enter First Name as "Testing" and Last Name as "Colleges".
- Give the email ID: "123@gmail.com"
- Then Remove the above email ID and Add a new id: abc@gmail.com.
- Click on Submit button.
- Close the Browser.
Program:
- *** Settings ***
- Library SeleniumLibrary
- *** Variables ***
- ${url} https://testingcolleges.blogspot.com/2023/08/demo-form.html
- ${firstName} Testing
- ${lastName} Colleges
- ${email} 123@gmail.com
- ${email2} abc@gmail.com
- *** Test Cases ***
- TextBox
- Open Browser ${url} Chrome
- Input Text id:fname ${firstName}
- Input Text id:lname ${lastName}
- Input Text id:mail ${email}
- Sleep 2
- Clear Element Text id:mail
- Input Text id:mail ${email2}
- Click Button Submit
- Sleep 2
- Close Browser
Output:
No comments:
Post a Comment