How to handle WebUI.click() and WebUI.setText() built in keywords using “XPATH”
I am unable to click on an object/ unable to set a text in login box using xpath
WebUI.setText(driver.findElement(By.xpath("//*[@id="edit-name"]")), username)
WebUI.setText(driver.findElement(By.xpath("//*[@id="edit-pass"]")), password)
WebUI.click(driver.findElement(By.xpath("//*[@id="user-login"]/div/div/button")))
Text should be entered in to the login boxes
click on Go button!
selenium-webdriver automated-tests katalon-studio
add a comment |
I am unable to click on an object/ unable to set a text in login box using xpath
WebUI.setText(driver.findElement(By.xpath("//*[@id="edit-name"]")), username)
WebUI.setText(driver.findElement(By.xpath("//*[@id="edit-pass"]")), password)
WebUI.click(driver.findElement(By.xpath("//*[@id="user-login"]/div/div/button")))
Text should be entered in to the login boxes
click on Go button!
selenium-webdriver automated-tests katalon-studio
add a comment |
I am unable to click on an object/ unable to set a text in login box using xpath
WebUI.setText(driver.findElement(By.xpath("//*[@id="edit-name"]")), username)
WebUI.setText(driver.findElement(By.xpath("//*[@id="edit-pass"]")), password)
WebUI.click(driver.findElement(By.xpath("//*[@id="user-login"]/div/div/button")))
Text should be entered in to the login boxes
click on Go button!
selenium-webdriver automated-tests katalon-studio
I am unable to click on an object/ unable to set a text in login box using xpath
WebUI.setText(driver.findElement(By.xpath("//*[@id="edit-name"]")), username)
WebUI.setText(driver.findElement(By.xpath("//*[@id="edit-pass"]")), password)
WebUI.click(driver.findElement(By.xpath("//*[@id="user-login"]/div/div/button")))
Text should be entered in to the login boxes
click on Go button!
selenium-webdriver automated-tests katalon-studio
selenium-webdriver automated-tests katalon-studio
edited Jan 4 at 11:37
Mate Mrše
1,8922627
1,8922627
asked Jan 2 at 6:08
NagendraNagendra
61
61
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
WebUI object works with TestObject, not the WebElement of selenium. You could either use manual mode or scripting mode to create the test script.
What is the difference/connection between TestObject and WebElement?
– Mate Mrše
Jan 3 at 13:50
TestObject is the object in Katalon and we can use it like findTestObject. WebElement is from Selenium. We need to use selenium command for it.
– Tony Bui
Jan 3 at 13:52
So, it is just a formal difference - Katalon uses one, and Selenium the other? But, it is the same thing, basically.
– Mate Mrše
Jan 3 at 13:54
add a comment |
Please try without using the object WebUI.
If you can share the entire code along with the error message in the console it would be great.
add a comment |
First, you define test objects like this:
TestObject editName = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-name"]')
TestObject editPass = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-pass"]')
TestObject userLogin = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//*[@id="user-login"]/div/div/button')
And then use them in your script
WebUI.setText(editName, username)
WebUI.setText(editPass, password)
WebUI.click(userLogin)
Note: I guess username and password used here are variable names, otherwise use 'username' and 'password'.
Note 2: you will need the following imports at the top of the script:
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject as TestObject
Hi It's working now Thanks,
– Nagendra
Jan 7 at 6:22
If you found it useful, please accept the answer (click the checkmark next to the answer).
– Mate Mrše
Jan 7 at 7:09
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54001962%2fhow-to-handle-webui-click-and-webui-settext-built-in-keywords-using-xpath%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
WebUI object works with TestObject, not the WebElement of selenium. You could either use manual mode or scripting mode to create the test script.
What is the difference/connection between TestObject and WebElement?
– Mate Mrše
Jan 3 at 13:50
TestObject is the object in Katalon and we can use it like findTestObject. WebElement is from Selenium. We need to use selenium command for it.
– Tony Bui
Jan 3 at 13:52
So, it is just a formal difference - Katalon uses one, and Selenium the other? But, it is the same thing, basically.
– Mate Mrše
Jan 3 at 13:54
add a comment |
WebUI object works with TestObject, not the WebElement of selenium. You could either use manual mode or scripting mode to create the test script.
What is the difference/connection between TestObject and WebElement?
– Mate Mrše
Jan 3 at 13:50
TestObject is the object in Katalon and we can use it like findTestObject. WebElement is from Selenium. We need to use selenium command for it.
– Tony Bui
Jan 3 at 13:52
So, it is just a formal difference - Katalon uses one, and Selenium the other? But, it is the same thing, basically.
– Mate Mrše
Jan 3 at 13:54
add a comment |
WebUI object works with TestObject, not the WebElement of selenium. You could either use manual mode or scripting mode to create the test script.
WebUI object works with TestObject, not the WebElement of selenium. You could either use manual mode or scripting mode to create the test script.
answered Jan 2 at 6:52
Tony BuiTony Bui
72527
72527
What is the difference/connection between TestObject and WebElement?
– Mate Mrše
Jan 3 at 13:50
TestObject is the object in Katalon and we can use it like findTestObject. WebElement is from Selenium. We need to use selenium command for it.
– Tony Bui
Jan 3 at 13:52
So, it is just a formal difference - Katalon uses one, and Selenium the other? But, it is the same thing, basically.
– Mate Mrše
Jan 3 at 13:54
add a comment |
What is the difference/connection between TestObject and WebElement?
– Mate Mrše
Jan 3 at 13:50
TestObject is the object in Katalon and we can use it like findTestObject. WebElement is from Selenium. We need to use selenium command for it.
– Tony Bui
Jan 3 at 13:52
So, it is just a formal difference - Katalon uses one, and Selenium the other? But, it is the same thing, basically.
– Mate Mrše
Jan 3 at 13:54
What is the difference/connection between TestObject and WebElement?
– Mate Mrše
Jan 3 at 13:50
What is the difference/connection between TestObject and WebElement?
– Mate Mrše
Jan 3 at 13:50
TestObject is the object in Katalon and we can use it like findTestObject. WebElement is from Selenium. We need to use selenium command for it.
– Tony Bui
Jan 3 at 13:52
TestObject is the object in Katalon and we can use it like findTestObject. WebElement is from Selenium. We need to use selenium command for it.
– Tony Bui
Jan 3 at 13:52
So, it is just a formal difference - Katalon uses one, and Selenium the other? But, it is the same thing, basically.
– Mate Mrše
Jan 3 at 13:54
So, it is just a formal difference - Katalon uses one, and Selenium the other? But, it is the same thing, basically.
– Mate Mrše
Jan 3 at 13:54
add a comment |
Please try without using the object WebUI.
If you can share the entire code along with the error message in the console it would be great.
add a comment |
Please try without using the object WebUI.
If you can share the entire code along with the error message in the console it would be great.
add a comment |
Please try without using the object WebUI.
If you can share the entire code along with the error message in the console it would be great.
Please try without using the object WebUI.
If you can share the entire code along with the error message in the console it would be great.
answered Jan 2 at 6:21
Sagar SagarSagar Sagar
162
162
add a comment |
add a comment |
First, you define test objects like this:
TestObject editName = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-name"]')
TestObject editPass = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-pass"]')
TestObject userLogin = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//*[@id="user-login"]/div/div/button')
And then use them in your script
WebUI.setText(editName, username)
WebUI.setText(editPass, password)
WebUI.click(userLogin)
Note: I guess username and password used here are variable names, otherwise use 'username' and 'password'.
Note 2: you will need the following imports at the top of the script:
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject as TestObject
Hi It's working now Thanks,
– Nagendra
Jan 7 at 6:22
If you found it useful, please accept the answer (click the checkmark next to the answer).
– Mate Mrše
Jan 7 at 7:09
add a comment |
First, you define test objects like this:
TestObject editName = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-name"]')
TestObject editPass = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-pass"]')
TestObject userLogin = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//*[@id="user-login"]/div/div/button')
And then use them in your script
WebUI.setText(editName, username)
WebUI.setText(editPass, password)
WebUI.click(userLogin)
Note: I guess username and password used here are variable names, otherwise use 'username' and 'password'.
Note 2: you will need the following imports at the top of the script:
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject as TestObject
Hi It's working now Thanks,
– Nagendra
Jan 7 at 6:22
If you found it useful, please accept the answer (click the checkmark next to the answer).
– Mate Mrše
Jan 7 at 7:09
add a comment |
First, you define test objects like this:
TestObject editName = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-name"]')
TestObject editPass = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-pass"]')
TestObject userLogin = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//*[@id="user-login"]/div/div/button')
And then use them in your script
WebUI.setText(editName, username)
WebUI.setText(editPass, password)
WebUI.click(userLogin)
Note: I guess username and password used here are variable names, otherwise use 'username' and 'password'.
Note 2: you will need the following imports at the top of the script:
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject as TestObject
First, you define test objects like this:
TestObject editName = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-name"]')
TestObject editPass = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//[@id="edit-pass"]')
TestObject userLogin = new TestObject().addProperty('xpath', ConditionType.EQUALS, '//*[@id="user-login"]/div/div/button')
And then use them in your script
WebUI.setText(editName, username)
WebUI.setText(editPass, password)
WebUI.click(userLogin)
Note: I guess username and password used here are variable names, otherwise use 'username' and 'password'.
Note 2: you will need the following imports at the top of the script:
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject as TestObject
answered Jan 2 at 7:26
Mate MršeMate Mrše
1,8922627
1,8922627
Hi It's working now Thanks,
– Nagendra
Jan 7 at 6:22
If you found it useful, please accept the answer (click the checkmark next to the answer).
– Mate Mrše
Jan 7 at 7:09
add a comment |
Hi It's working now Thanks,
– Nagendra
Jan 7 at 6:22
If you found it useful, please accept the answer (click the checkmark next to the answer).
– Mate Mrše
Jan 7 at 7:09
Hi It's working now Thanks,
– Nagendra
Jan 7 at 6:22
Hi It's working now Thanks,
– Nagendra
Jan 7 at 6:22
If you found it useful, please accept the answer (click the checkmark next to the answer).
– Mate Mrše
Jan 7 at 7:09
If you found it useful, please accept the answer (click the checkmark next to the answer).
– Mate Mrše
Jan 7 at 7:09
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54001962%2fhow-to-handle-webui-click-and-webui-settext-built-in-keywords-using-xpath%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown