0

大家好,我正在使用katalon studio并通过设置文本电子邮件将文本传递到电子邮件输入字段时我遇到了这个问题:

Test Cases/Valid_Login FAILED because (of) Unable to set text 'usman@myfake.tk' of object 'Object Repository/Page_Webtalk  Communicate Better/input_email' (Root cause: org.openqa.selenium.InvalidElementStateException: Element is not currently interactable and may not be manipulated
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z'
System info: host: 'USMAN', ip: '192.168.11.206', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_102'
Driver info: com.kms.katalon.core.webui.driver.firefox.CGeckoDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 58.0.2, javascriptEnabled: true, moz:accessibilityChecks: false, moz:headless: false, moz:processID: 5508, moz:profile: C:\Users\usmanPC\AppData\Lo..., moz:webdriverClick: true, pageLoadStrategy: normal, platform: XP, platformName: XP, platformVersion: 6.3, proxy: Proxy(direct), rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}
Session ID: d28ee92a-cfee-47ad-b6a2-46c705493a4e)

Test Cases/Valid_Login.run:31

生成的代码如下:

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.navigateToUrl('https://dev.webtalk.co/')

WebUI.click(findTestObject('Page_Webtalk  Communicate Better/a_Login'))

WebUI.waitForElementPresent(findTestObject('Page_Webtalk  Communicate Better/input_email'), 5)

WebUI.setText(findTestObject('Page_Webtalk  Communicate Better/input_email'), 'usman@myfake.tk')

WebUI.setText(findTestObject('Page_Webtalk  Communicate Better/input_login_password'), 'Pmasuaar1@#$')

WebUI.click(findTestObject('Page_Webtalk  Communicate Better/input_login_button'))

WebUI.click(findTestObject('Page_Webtalk  Communicate Better/button_Talk'))

WebUI.closeBrowser()
4

1 回答 1

2

我有一个类似的问题,并通过在调用显示错误的元素之前添加延迟线 (WebUI.delay(3)) 来解决它。

于 2018-03-08T00:30:41.607 回答