Unable to run testcases for login

I’m unable to run the test case of record and play scenario.
Please see the following details and attachments:

1.Katalon Studio Version: 4.8.0
2.Pc: Mac Sierra

Screen Shot 2017-09-25 at 4.39.47 PM.png

Screen Shot 2017-09-25 at 4.40.14 PM.png

First try to click on ‘Visit Date (Required)’ input field in order to display the datepicker.

I have selected’Visit Date’ during recording But, still showing the same error.
Please see the screenshot


Screen Shot 2017-09-27 at 12.40.30 PM.png

Screen Shot 2017-09-27 at 12.40.16 PM.png

Hello Vismi K George

I think you have made this scenario with record web.
And I have also tried the same and i face the same issue. After some research, i found the a_logout Object is the main problem…Please delete all the locator in this object except xpath…and replace the xpath with your own xpath from the website. See the screenshot below

And add a wait for element clickable function…it will pass

Hope it will work

log_btn.PNG

logOut_kata.png

Hi Borhan Uddin Sarker

I’m just beginner in katalon studio. So I didn’t get your solution. How can I delete locators in the objects and setting Xpath.

Please go through the screenshots.

Screen Shot 2017-09-27 at 3.18.55 PM.png

Screen Shot 2017-09-27 at 3.19.22 PM.png

If you want to modify or create an element object, First of all you have to go in object folder. For your case.

you will see an object with the name a_logout. Its actual locator of logout button.
So when you create step-like.
Click—object(a_logout) in katalon its execute like this scenario.

First of all, webdriver will locate the log out button with the object.
In katalon you can define an object with element XPath/tag name/class name/href etc.
so sometimes when you capture an object with web-record or web spy of katalon is unable to locate actual location so when you run the test it cannot locate exactly the element and the test case get an error. And in this case, you have to find your element location by your self.
I have found that the logout buttons XPath is //a[@href='profile.php#login'] so I delete all other objects like class name tag etc from a_logout object except XPath, And I replace the XPath value with my xpath //a[@href='profile.php#login']

So now when I run the test its only locate the log out button with the given XPath.

I am attaching the a_logout button object for you.

If you have any Question let me know.

Or you can try this code to generate the logout scenario

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

WebUI.openBrowser('')

WebUI.maximizeWindow()

WebUI.navigateToUrl('http://demoaut.katalon.com/')

WebUI.click(findTestObject('Page_CURA Healthcare Service/i_fa fa-bars'))

WebUI.waitForElementClickable(findTestObject('Page_CURA Healthcare Service/a_Login'), 10)

WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Login'))

WebUI.delay(10)

object121.PNG

Hii Sir,

I had copied the above code and tried to run the code but, still showing the same error
Please see the screenshot,
Sir, please send me the entire script of running above site.Only after learning basics I can move on the advanced level of katalon studio.


Screen Shot 2017-09-27 at 6.05.49 PM.png

Screen Shot 2017-09-27 at 6.06.02 PM.png

Have you modified the a_login xpath???
This code is running on my end so it will run same on your end.
I think you have not change the object of a_login.

Do this step…
Open a_login from object repository.
delete all the option like class, tag and all others only keep XPath option.

And most important is change the value of XPath to this value
//a[@href='profile.php#login']

save it and run again.

a_login.jpg

a_login.jpg

a_login2.png

Hii Sir,

Sorry for the delay response.
First test case run success…Thanks for your support.
Stil I have some doubts please see the screenshots.

Screen Shot 2017-10-03 at 10.58.44 AM.png

Hii Sir,
I have some more doubts.
1.What’s the need for setting XPath and how we will find the value of XPath?
2.Please see the screenshot

Screen Shot 2017-10-03 at 12.45.44 PM.png

1 Like