How to store the source code of a page

77 views
Skip to first unread message

ama...@bufetedemarketing.com

unread,
Apr 24, 2017, 7:36:37 AM4/24/17
to Selenium Users

Hi guys!


I’m new in Selenium, I’ve never used commands in Selenium, only to record my movements through a web page. So, I don’t know how I could record/register or store the source code of a web page with Selenium through a script (I’m not programmer, I understand the code, but I don’t know how to create it from the beginning…).

Do you know any command to store the source code of a page in a file?

Thanks so much!!! :)

Ripon Al Wasim

unread,
Apr 24, 2017, 7:43:38 AM4/24/17
to seleniu...@googlegroups.com
Hi,
In which format do you like to store/save the source code?

HTML: You can save the recorded script as .html format from File menu

Java, C#, Ruby, Python: You can export the code to your preferred language

br,
Ripon

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/64a602fb-264c-411c-b3d5-4652ebcfdd3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ama...@bufetedemarketing.com

unread,
Apr 24, 2017, 8:02:24 AM4/24/17
to Selenium Users
Hi!

I prefer HTML language.
What I need is storing the source code of a web page which I'm navigating with a Test Selenium. I want to automate it. What could be the command?

Thanks!!!


El lunes, 24 de abril de 2017, 13:43:38 (UTC+2), Ripon Al Wasim escribió:
Hi,
In which format do you like to store/save the source code?

HTML: You can save the recorded script as .html format from File menu

Java, C#, Ruby, Python: You can export the code to your preferred language

br,
Ripon
On Mon, Apr 24, 2017 at 4:36 AM, <ama...@bufetedemarketing.com> wrote:

Hi guys!


I’m new in Selenium, I’ve never used commands in Selenium, only to record my movements through a web page. So, I don’t know how I could record/register or store the source code of a web page with Selenium through a script (I’m not programmer, I understand the code, but I don’t know how to create it from the beginning…).

Do you know any command to store the source code of a page in a file?

Thanks so much!!! :)

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

ama...@bufetedemarketing.com

unread,
Apr 25, 2017, 3:28:06 AM4/25/17
to Selenium Users
Hi guys!

I've found this command: storeHtmlSource(variableName), if I use this command, do I need a extra variable? Could I extract this output to a file??

I'm using Selenium IDE.

Thanks so much!

ama...@bufetedemarketing.com

unread,
Apr 26, 2017, 3:04:20 AM4/26/17
to Selenium Users
Hi guys!

I have a question... I write the following and I don't get anything from it:

command: runScript
target: document.documentElement.innerHTML
value: variable

With this instruction I try to get the source code of the current web page.

Why don't I get any thing and, however, there aren't no fails in the log??

Thanks so much!!

ama...@bufetedemarketing.com

unread,
Apr 26, 2017, 3:08:38 AM4/26/17
to Selenium Users


El miércoles, 26 de abril de 2017, 9:04:20 (UTC+2), ama...@bufetedemarketing.com escribió:
Hi guys!

I have a question... I write the following and I don't get anything from it:

command: runScript
target: document.documentElement.innerHTML
value: variable

   command: echo
   target: ${variable}

ama...@bufetedemarketing.com

unread,
Apr 26, 2017, 3:45:16 AM4/26/17
to Selenium Users
Well, I found the error... I had to put "javascript". 

command: store
target: javascript{document.documentElement.innerHTML}
value: variable
            command: echo
            target: ${variable}

Now I get data with "echo", but I don't get the source code of the web page... I don't know why because I found this javascript code by another user and he said that it worked...

Any help? Thanks so much!!!

ama...@bufetedemarketing.com

unread,
Apr 26, 2017, 5:39:47 AM4/26/17
to Selenium Users
Well, I continue testing my own ideas...

I run the following (without luck) because I would need to look for a specific data (datas from a highchart) but I can’t get anything doing the following:


command: store

target: javascript{document.documentElementsByClassName('highcharts-label')[0].textContent}

value: variable

command: echo

target: ${variable}


Would you know any command to get that??


Thanks...

ama...@bufetedemarketing.com

unread,
Apr 27, 2017, 3:21:54 AM4/27/17
to Selenium Users
Hi guys!

I've discovered that there aren't any commands to use in Selenium (right button, "show all possible commands" is disabled) in the highchart of my web page, so, I guess I will have to use a javascript to access that data. Is it possible with Selenium IDE or I have to use Selenium Webdriver?

Thanks so much...
Reply all
Reply to author
Forward
0 new messages