Copy/paste code source Katalon studio


I have some problems to create a specific test to control the SEO of a web page. The idea is to create a script that allow me:
1. to open the interested page;
2. to do a copy of the source code interested page;
3. to open a tab for the SEO validator page;
4. to paste the source code of the interested page;
5. to execute the test;

Actually, I have created this script

Help me please?



Cattura 2.PNG


Hi Fabio

The getPageSource method returns a string, so…

`def mySource = driver.getPageSource()

`Now you can use the MySource variable in a call to Set Text.

Hi @Russ Thomas

I have followed you advice and I have created this new script:

Now, when I launch the script, katalon returns the following error message

Help me please?




b khn m.PNG

It is basically saying that your ‘div_Incolla il codice11’ cannot be edited (cannot receive text). Maybe that div element has an input field inside it that hasn’t been taken into consideration?

Hi @Mate Mrse

I have captured the ‘div_incolla il codice11’. This is a screen of the informations captured:

From the inspect, I have verified the following source code for the object:



Can you show me the css locator of your ‘div_incolla il codice11’ element from your Object Repository? Because I’m not sure if I’m looking at the right element and if you can send text to it.

Fabio Rismino said:

From the inspect, I have verified the following source code for the object:

Fabio, that’s a screenshot of a webpage that uses CodeMirror ( a quite complex piece of coding I’ve used many times. I’m surprised to see someone trying to use it for testing, or try to test it (either is surprising).

Like @Mate asked, we need to see the HTML element you’re trying to send text to and enough of the HTML to see the CSS structure you’re using.