Hi,
I’m trying to set text in a Windows element on File Explorer. The test case pass but instead of setting all the text, it sets the variable character by character. For example, if I try to set the word “Test”, it’ll set “t”, then “e”, then “s” and finally “t”. But it also clear the all element betxeen every character.
I tried by using Set text method and also Send Keys. No difference. I tried by using an variable also. I don’t have this behavior on Web Elements.
What can I do to be able to set the all variable ?
My script if it helps :
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 static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
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.testdata.TestData as TestData
import com.kms.katalon.core.testng.keyword.TestNGBuiltinKeywords as TestNGKW
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys
Windows.startApplication('C:\\Windows\\explorer.exe')
Windows.click(findWindowsObject('WIN-Explorateur-Fichiers/Recherche'))
Windows.sendKeys(findWindowsObject('WIN-Explorateur-Fichiers/Recherche'), 'test')
Windows.sendKeys(findWindowsObject('WIN-Explorateur-Fichiers/Recherche'), Keys.chord(Keys.ENTER))
I also think I shouldn’t need to click in the element before setting the text, but if I don’t do it the explorer crashes.
Thank you for your help
Regards,
Alexis