Ecrire dans une fenêtre HTML

Hi Karine,

Alternatively to Andrej comment (which may work) try using the switch to iFrame using the “Switch to Frame” WebUI Keyword. If you need to find the iFrame, the best way to do this is open the object in question, and, using Andrej tip, find what iFrame the object needs.

Then use that iFrame within the “Switch To Frame” WebUI Keyword.

Hope this helps!

Thank you for your answersI used the Parent I-FRAME method.I duplicated the repository object and selected "Object Repository / iframe description ifr" as Parent IframeHowever, he puts as error06-26-2018 10:23:04 AM - [FAILED] - Unable to focus on object - Object Repository / input_Caption - Description (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository / input_Caption - Description' located by 'By.xpath: // input [@id =' Caption 'and @name =' Caption 'and @type =' text ']' not found)06-26-2018 10:23:04 AM - [END] - End action: focus06-26-2018 10:23:04 AM - [FAILED] - Test Cases / Article - FAILED record because (of) Unable to focus on object 'Object Repository / input_Caption - Description' (Root cause: com.kms.katalon. core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository / input_Caption - Description' located by 'By.xpath: // input [@id =' Caption 'and @name =' Caption 'and @type =' text ']' not found)06-26-2018 10:23:04 AM - [END] - End Test Case: Test Cases / Article - FormIf I understand correctly he looks for an item to write and the text to register.I typed these lines:It's ok ?In all cases a big thank you to all

Katalon26.png

just delete focus command i suggested before we knew about iFrame

Accept our apologies if you repeat things. We are not developers and we have to put tests in place without training, we are really stunned and your help is really valuable.

My order lines are
In step 21, the errors are as follows :

06-26-2018 10:54:09 AM - [START] - Start action : setText

06-26-2018 10:54:09 AM - [INFO] - Finding Test Object with id 'Object Repository/input_Caption - Description ’

06-26-2018 10:54:09 AM - [INFO] - Finding Test Object with id ‘Object Repository/iframe_Description_ifr (2)’

06-26-2018 10:54:09 AM - [INFO] - Checking object

06-26-2018 10:54:09 AM - [INFO] - Checking text

06-26-2018 10:54:09 AM - [INFO] - Object: 'Object Repository/input_Caption - Description ’ has parent object(s)

06-26-2018 10:54:09 AM - [INFO] - Switching to iframe: ‘Object Repository/iframe_Description_ifr (2)’

06-26-2018 10:54:09 AM - [INFO] - Checking timeout

06-26-2018 10:54:09 AM - [INFO] - Finding web element with id: ‘Object Repository/iframe_Description_ifr (2)’ located by ‘By.xpath: //iframe[@id = ‘Description_ifr’ and @title = concat(‘Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d’ , "’" , ‘outils. Appuyer sur ALT-0 pour de l’ , “’” , ‘aide.’)]’ in ‘30’ second(s)

06-26-2018 10:54:09 AM - [INFO] - Found 1 web elements with id: ‘Object Repository/iframe_Description_ifr (2)’ located by ‘By.xpath: //iframe[@id = ‘Description_ifr’ and @title = concat(‘Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d’ , "’" , ‘outils. Appuyer sur ALT-0 pour de l’ , “’” , ‘aide.’)]’ in ‘30’ second(s)

06-26-2018 10:54:09 AM - [INFO] - Switched to iframe: ‘Object Repository/iframe_Description_ifr (2)’

06-26-2018 10:54:09 AM - [INFO] - Checking timeout

06-26-2018 10:54:09 AM - [INFO] - Finding web element with id: 'Object Repository/input_Caption - Description ’ located by ‘By.xpath: //*[@id=“tinymce”]/div’ in ‘30’ second(s)

06-26-2018 10:54:09 AM - [INFO] - Found 1 web elements with id: 'Object Repository/input_Caption - Description ’ located by ‘By.xpath: //*[@id=“tinymce”]/div’ in ‘30’ second(s)

06-26-2018 10:54:09 AM - [INFO] - Clearing text of object 'Object Repository/input_Caption - Description ’

06-26-2018 10:54:09 AM - [INFO] - Checking timeout

06-26-2018 10:54:09 AM - [INFO] - Finding web element with id: 'Object Repository/input_Caption - Description ’ located by ‘By.xpath: //*[@id=“tinymce”]/div’ in ‘30’ second(s)

06-26-2018 10:54:09 AM - [INFO] - Found 1 web elements with id: 'Object Repository/input_Caption - Description ’ located by ‘By.xpath: //*[@id=“tinymce”]/div’ in ‘30’ second(s)

06-26-2018 10:54:09 AM - [INFO] - Setting text of object 'Object Repository/input_Caption - Description ’ to value ‘tests’

06-26-2018 10:54:10 AM - [INFO] - Switching to default content

06-26-2018 10:54:10 AM - [FAILED] - Unable to set text ‘tests’ of object 'Object Repository/input_Caption - Description ’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: cannot focus element

(Session info: chrome=67.0.3396.87)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.10240 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: ‘WKSRBT0550’, ip: ‘10.0.7.69’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, 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\KARINE~1.COR\AppDa…}, 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.87, webStorageEnabled: true}

Session ID: 2ae029e68320bb0970b0db7980673cd7)

06-26-2018 10:54:10 AM - [END] - End action : setText

06-26-2018 10:54:10 AM - [FAILED] - Test Cases/Article - Fiche FAILED because (of) Unable to set text ‘tests’ of object 'Object Repository/input_Caption - Description ’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: cannot focus element

(Session info: chrome=67.0.3396.87)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.10240 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: ‘WKSRBT0550’, ip: ‘10.0.7.69’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, 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\KARINE~1.COR\AppDa…}, 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.87, webStorageEnabled: true}

Session ID: 2ae029e68320bb0970b0db7980673cd7)

06-26-2018 10:54:10 AM - [END] - End Test Case : Test Cases/Article - Fiche

Katalon26bis.png

Détails

input.JPG

My parent iframe

Parent_Iframe.JPG

Karine, no stress… I guest that you struggle with that task. Fortunately, it seems you have web application with id of object in web page so it’s easier to start. And don’t worry, i’ll try to help you as much as i can. Katalon is so far best free tool i tried when you starting with automation so you choose well.

this object ‘Object Repository/input_Caption - Description’ - is that input field you are trying to set? because on beginning of this post you were trying to set ‘Object Repository/input_Caption’

I duplicated the inputCaption object in input_Caption- Description to keep the 1st correct :smiley:

ok, but then you are trying to set text to div (//*[@id=“tinymce”]/div’) element is that correct?
setText() is used to put some string in input field

I grope …

I put as Method: Basic and this delete the Xpath: // * [@ id = "tinymce"] / div

The error with Basic méthod for
21 - Set text / input_Caption - Description

06-26-2018 11:53:17 AM - [START] - Start action : setText

06-26-2018 11:53:17 AM - [INFO] - Finding Test Object with id 'Object Repository/input_Caption - Description ’

06-26-2018 11:53:17 AM - [INFO] - Finding Test Object with id ‘Object Repository/iframe_Description_ifr (2)’

06-26-2018 11:53:17 AM - [INFO] - Checking object

06-26-2018 11:53:17 AM - [INFO] - Checking text

06-26-2018 11:53:17 AM - [INFO] - Object: 'Object Repository/input_Caption - Description ’ has parent object(s)

06-26-2018 11:53:17 AM - [INFO] - Switching to iframe: ‘Object Repository/iframe_Description_ifr (2)’

06-26-2018 11:53:17 AM - [INFO] - Checking timeout

06-26-2018 11:53:17 AM - [INFO] - Finding web element with id: ‘Object Repository/iframe_Description_ifr (2)’ located by ‘By.xpath: //iframe[@id = ‘Description_ifr’ and @title = concat(‘Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d’ , "’" , ‘outils. Appuyer sur ALT-0 pour de l’ , “’” , ‘aide.’)]’ in ‘30’ second(s)

06-26-2018 11:53:17 AM - [INFO] - Found 1 web elements with id: ‘Object Repository/iframe_Description_ifr (2)’ located by ‘By.xpath: //iframe[@id = ‘Description_ifr’ and @title = concat(‘Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d’ , "’" , ‘outils. Appuyer sur ALT-0 pour de l’ , “’” , ‘aide.’)]’ in ‘30’ second(s)

06-26-2018 11:53:17 AM - [INFO] - Switched to iframe: ‘Object Repository/iframe_Description_ifr (2)’

06-26-2018 11:53:17 AM - [INFO] - Checking timeout

06-26-2018 11:53:17 AM - [INFO] - Finding web element with id: 'Object Repository/input_Caption - Description ’ located by ‘By.xpath: //input[@id = ‘Caption’ and @name = ‘Caption’ and @type = ‘text’]’ in ‘30’ second(s)

06-26-2018 11:53:48 AM - [INFO] - Switching to default content

06-26-2018 11:53:49 AM - [FAILED] - Unable to set text ‘tests’ of object 'Object Repository/input_Caption - Description ’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/input_Caption - Description ’ located by ‘By.xpath: //input[@id = ‘Caption’ and @name = ‘Caption’ and @type = ‘text’]’ not found)

06-26-2018 11:53:49 AM - [END] - End action : setText

06-26-2018 11:53:49 AM - [FAILED] - Test Cases/Article - Fiche FAILED because (of) Unable to set text ‘tests’ of object 'Object Repository/input_Caption - Description ’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/input_Caption - Description ’ located by ‘By.xpath: //input[@id = ‘Caption’ and @name = ‘Caption’ and @type = ‘text’]’ not found)

06-26-2018 11:53:49 AM - [END] - End Test Case : Test Cases/Article - Fiche

can you please post screenshot of definition (Basic) from Katalon of object you are trying to set text to, and if possible also screenshot from any html inspector from browser of that object. thank you

why i’m asking - if you just switch from xpath to basic on same object definition in Katalon, (seems to be case)
your defined xpath pointed to some div element : //*[@ id = “tinymce”]/div
but definition in basic settings points to input field //input[@id = ‘Caption’ and @name = ‘Caption’ and @type = ‘text’]’
i’m confused …

For the first part of the question

And the copy outHTML :


For the second question, the confusion is related to the beginning … I tried several ways to do without understanding that it crossed

Fenêtre.JPG

Where should I write the HTML code?
in the ifram description or in InputCaption?

I have to copy / paste it into the Xpath + Selector Editor

Karine, i was writing about this page with definition of element from webpage you want to set text to

2nd :
open chrome, right-click on element you want text to and choose Inspect, then screenshot what you will see in window of developer tools like this

thank you

image.png

2018-06-26_16-41-59.png

i’m starting to understand (probably) - if they are using some kind of embeded editor like on this page, that actually puts data to be displayed in (in case of this page tag)

tag they will need to use something like:
driver.executeScript("arguments[0].innerHTML = arguments[1]", element, text);