lundi 26 novembre 2018

Click button doesn't work - Katalon Studio

I am new to Katalon studio and am trying to run my test case but it's always filed as it says:

Test Cases/Logging in FAILED because (of) (Stack trace: com.kms.katalon.core.exception.StepFailedException: Unable to click on object 'Object Repository/Page_BaseLine - test/input_Przypomnienie o fakturze' (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/Page_BaseLine - test/input_Przypomnienie o fakturze' located by 'By.xpath: //input[@id='SubmitButton']' not found)

I tried to do it manually but everytime the same problem appears, what shall I do then?

Here is my source code:

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
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

WebUI.openBrowser('')

def plik = new File('Config.txt')

def lines = plik.readLines()

WebUI.navigateToUrl(lines[0])

WebUI.setText(findTestObject('Object Repository/Page_Demo version BaseLine/input_Login form_LoginTextBox'), lines[1])

WebUI.setText(findTestObject('Object Repository/Page_Demo version BaseLine/input_Login form_PasswordTextB'), lines[2])

WebUI.click(findTestObject('Object Repository/Page_Demo version BaseLine/input_remember me_LoginButton'))

WebUI.click(findTestObject('Page_BaseLine - test/a_Kontrahenci'))

WebUI.click(findTestObject('Page_BaseLine - test/a_Dodaj Kontrahenta'))

WebUI.setText(findTestObject('own/Page_BaseLine - test/input_Nazwa skrcona_ShortNameT'), 'greg12')

WebUI.setText(findTestObject('own/Page_BaseLine - test/textarea_'), 'Grzegorz Spytek12')

WebUI.click(findTestObject('Page_BaseLine - test/input_Przypomnienie o fakturze'))

WebUI.click(findTestObject('Page_BaseLine - test/input_Opis_CloseButton'))

Thanks for help.

Aucun commentaire:

Enregistrer un commentaire