Sign Up

I wants to automate the scenario where user can sign up in the portal and then click on myprofile and do sign out where invalid signup will show error message and then click on okay. Now I am successfully able to execute the 2nd scenario where invalid user will through a error message but when i put valid login then my test case fail.

Here is my code:

WebUI.click(findTestObject(‘Page_Workilo Welcome/input_button (1)’))

if (WebUI.verifyElementPresent(findTestObject(‘Object Repository/Page_Workilo Welcome/Duplicate Email’), 10) == true)

{

WebUI.click(findTestObject(‘Object Repository/Page_Workilo Welcome/Duplicate Email’))

}

else

{

WebUI.click(findTestObject(‘Page_Workilo Welcome/li_My Profile’))

WebUI.click(findTestObject(‘Page_Workilo Welcome/a_Log Out’))

}

Now If I enter invalid email id then test case pass but when I enter valid email id it shows error that “Duplicate Email” object is not found . Please guide me on the above scenario.

Error result:

Test Cases/Sign-Up for Customer FAILED because (of) Unable to verify object ‘Object Repository/Page_Workilo Welcome/Duplicate Email’ is present (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Workilo Welcome/Duplicate Email’ located by ‘By.xpath: //button[@class=‘confirm’]’ not found)

Test Cases/Sign-Up for Customer.run:46

I have also attache my object file below:

duplicate email.png

nazneen said:

I wants to automate the scenario where user can sign up in the portal and then click on myprofile and do sign out where invalid signup will show error message and then click on okay. Now I am successfully able to execute the 2nd scenario where invalid user will through a error message but when i put valid login then my test case fail.

Here is my code:

WebUI.click(findTestObject(‘Page_Workilo Welcome/input_button (1)’))

if (WebUI.verifyElementPresent(findTestObject(‘Object Repository/Page_Workilo Welcome/Duplicate Email’), 10) == true)

{

WebUI.click(findTestObject(‘Object Repository/Page_Workilo Welcome/Duplicate Email’))

}

else

{

WebUI.click(findTestObject(‘Page_Workilo Welcome/li_My Profile’))

WebUI.click(findTestObject(‘Page_Workilo Welcome/a_Log Out’))

}

Now If I enter invalid email id then test case pass but when I enter valid email id it shows error that “Duplicate Email” object is not found . Please guide me on the above scenario.

Error result:

Test Cases/Sign-Up for Customer FAILED because (of) Unable to verify object ‘Object Repository/Page_Workilo Welcome/Duplicate Email’ is present (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Workilo Welcome/Duplicate Email’ located by ‘By.xpath: //button[@class=‘confirm’]’ not found)

Test Cases/Sign-Up for Customer.run:46

I have also attache my object file below:

@andrej Can I get help from you ?

change code like this:

WebUI.click(findTestObject('Page_Workilo  Welcome/input_button (1)'))
try{
WebUI.verifyElementPresent(findTestObject('Object Repository/Page_Workilo  Welcome/Duplicate Email'), 10)
WebUI.click(findTestObject('Object Repository/Page_Workilo  Welcome/Duplicate Email'))
} catch (Exception e) {
WebUI.click(findTestObject('Page_Workilo  Welcome/li_My Profile'))
WebUI.waitForElementClickable(findTestObject('Page_Workilo  Welcome/a_Log Out'),5)
WebUI.click(findTestObject('Page_Workilo  Welcome/a_Log Out'))
}

if duplicate exists it will do if not, exception is thrown and you process that exception

1 Like

Thanks Andrej. It works o:)

@Andrej,

This time again I found error on clicking button. I tried all the possible solution which I faced but all are in vein. Please help.

here are my code:

WebUI.verifyElementVisible(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’))

WebUI.waitForElementVisible(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’), 5)

WebUI.scrollToElement(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’), 5)

WebUI.click(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’))

//----Custom code failed also-----
//CustomKeywords.‘clickEvent.SelectServices.clickUsingJS1’(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’))

generated error result:

Test Cases/Add Listing FAILED because (of) Unable to click on object ‘Object Repository/Add Listing/Page_Workilo Create Listing/save’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (674, 383). Other element would receive the click:

(Session info: chrome=67.0.3396.99)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘WINCTRL-I1MBNJ3’, ip: ‘192.168.0.56’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_102’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528161 (5b82f2d2aae0ca…, userDataDir: C:\Users\ASSET-~1\AppData\L…}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 67.0.3396.99, webStorageEnabled: true}

Session ID: 87e2cedef76999fe33869a750ad4dd17)

Object created:

xptah.png

generated error result:
***************************************************
clickable at point (674, 383). Other element would receive the click:


***************************************************

there is something covering your button… try this:

WebUI.verifyElementVisible(findTestObject('Object Repository/Add Listing/Page_Workilo  Create Listing/save'))
WebUI.waitForElementVisible(findTestObject('Object Repository/Add Listing/Page_Workilo  Create Listing/save'), 5)
WebUI.scrollToElement(findTestObject('Object Repository/Add Listing/Page_Workilo  Create Listing/save'), 5)
WebUI.waitForElementClickable('Object Repository/Add Listing/Page_Workilo  Create Listing/save'), 5)
WebUI.click(findTestObject('Object Repository/Add Listing/Page_Workilo  Create Listing/save'))

Hi Andrej,
using the above code but still same error found :frowning:

Test Cases/Add Listing FAILED because (of) Unable to click on object ‘Object Repository/Add Listing/Page_Workilo Create Listing/save’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (674, 383). Other element would receive the click:

(Session info: chrome=67.0.3396.99)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘WINCTRL-I1MBNJ3’, ip: ‘192.168.0.56’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_102’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528161 (5b82f2d2aae0ca…, userDataDir: C:\Users\ASSET-~1\AppData\L…}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 67.0.3396.99, webStorageEnabled: true}

Session ID: 22e5b43805faf5fdd7e9f75fb95758f5)

Test Cases/Add Listing.run:91

Try adding a delay before clicking.

Also, do you get the **same **error when you try clicking the element using CustomKeywords.‘clickEvent.SelectServices.clickUsingJS1’(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’))?

Andrej, earlier I had used custom keywords in same scenario which worked well there but now it showing error :(. Please help and also guide me which will be more convenient to use in terms of coding.

Generated error :

Test Cases/Add Listing FAILED because (of) org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: clickEvent.SelectServices.clickUsingJS1() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject) values: [TestObject - ‘Object Repository/Add Listing/Page_Workilo Create Listing/save’]

Possible solutions: clickUsingJS1(com.kms.katalon.core.testobject.TestObject, int)

My Code:

@Keyword

def clickUsingJS1(TestObject to, int timeout){

WebDriver driver=DriverFactory.getWebDriver()

WebElement element= WebUiCommonHelper.findWebElement(to, timeout)

//WebElement element=WebUiCommonHelper.findWebElement(to, timeout)

JavascriptExecutor executor= ((driver) as JavascriptExecutor)

executor.executeScript(‘argument[0].click()’,element)

CustomKeywords.‘clickEvent.SelectServices.clickUsingJS1’(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’))

Mate Mrse said:

Try adding a delay before clicking.

Also, do you get the **same **error when you try clicking the element using CustomKeywords.‘clickEvent.SelectServices.clickUsingJS1’(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’))?

Hi Mate,

I have used wait command so should I also add delay after using wait ??

for custom coding I have posted above query. Please go through.

nazneen said:

Generated error :

Test Cases/Add Listing FAILED because (of) org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: clickEvent.SelectServices.clickUsingJS1() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject) values: [TestObject - ‘Object Repository/Add Listing/Page_Workilo Create Listing/save’]

Possible solutions: clickUsingJS1(com.kms.katalon.core.testobject.TestObject, int)

This error is saying your clickUsingJS1() is missing an (int) argument. You probably just gave it what object to click and forgot the timeout.

Mate Mrse said:

nazneen said:

Generated error :

Test Cases/Add Listing FAILED because (of) org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: clickEvent.SelectServices.clickUsingJS1() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject) values: [TestObject - ‘Object Repository/Add Listing/Page_Workilo Create Listing/save’]

Possible solutions: clickUsingJS1(com.kms.katalon.core.testobject.TestObject, int)

This error is saying your clickUsingJS1() is missing an (int) argument. You probably just gave it what object to click and forgot the timeout

I agree but when I gave argument for timeout it also show this error :frowning:

Test Cases/Add Listing FAILED because (of) org.openqa.selenium.WebDriverException: unknown error: argument is not defined

(Session info: chrome=67.0.3396.99)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘WINCTRL-I1MBNJ3’, ip: ‘192.168.0.56’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_102’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528161 (5b82f2d2aae0ca…, userDataDir: C:\Users\ASSET-~1\AppData\L…}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 67.0.3396.99, webStorageEnabled: true}

Session ID: 98d86c577b5e9e274aade56691a2b753

clickEvent.SelectServices.clickUsingJS1:97

clickEvent.SelectServices.invokeMethod:0

Test Cases/Add Listing.run:95

CustomKeywords.‘clickEvent.SelectServices.clickUsingJS1’(findTestObject(‘Object Repository/Add Listing/Page_Workilo Create Listing/save’), 5)

OK, now I’m going to take a guess. Different versions of javaScriptExecutor that I’ve seen have

executor.executeScript('arguments[0].click()',element) 

instead of

executor.executeScript('argument[0].click()',element)

Maybe try changing it?

Yes It Works Thanks Mate:)

Now My problem is when I click on Sign up button My test cases passes but still on the browser sign up is not clicked in. So I have used switchwindow functionality but its its not working.
Here are the screen

Here are the error details:

Test Cases/Sign up for service provider FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.switchToWindowTitle() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject) values: [TestObject - ‘Object Repository/Sign up for service provider/Page_Workilo Welcome/pagetitile’]

Possible solutions: switchToWindowTitle(java.lang.String), switchToWindowTitle(java.lang.String, com.kms.katalon.core.model.FailureHandling), switchToWindowUrl(java.lang.String)

Test Cases/Sign up for service provider.run:53

defined Object:

Please help @Andrej, @Mate

sign up issue.png

pagetitle.png

nazneen,
it’s written in error message:

Test Cases/Sign up for service provider FAILED because (of)
*** cut ***
Possible solutions: switchToWindowTitle(java.lang.String), switchToWindowTitle(java.lang.String, com.kms.katalon.core.model.FailureHandling), switchToWindowUrl(java.lang.String)

just call function with string in your case: switchToWindowTitle(“Workilo :: Shop Setup”)

okay Switch window is working still I get error.
Test Cases/Sign up for service provider FAILED because (of) Unable to switch to window with title: ‘Workilo :: Shop Setup’ (Root cause: Cannot find window with title: ‘Workilo :: Shop Setup’)

Also I have used this switch window because browser screen was not moved to the next page i.e. shop creation page. I dont know either it will be correct to use it here or not?
Here are the screen:

signup1.png

Please help @Andrej, @Mate

nazneen said:

okay Switch window is working still I get error.
Test Cases/Sign up for service provider FAILED because (of) Unable to switch to window with title: ‘Workilo :: Shop Setup’ (Root cause: Cannot find window with title: ‘Workilo :: Shop Setup’)

Also I have used this switch window because browser screen was not moved to the next page i.e. shop creation page. I dont know either it will be correct to use it here or not?
Here are the screen:

@Can anyone help me out on this scenario? I am totally stuck into it :frowning:

I have notice that sign up button is not clicked in actual using custom keyword but in my log file it passes the test case. Don’t know why? and that is the main problem. Any comment on this will be help me alot.
Thanks,