Jump to content


Photo

Changing Name property for all Pages using Javascript


  • Please log in to reply
5 replies to this topic

#1 avin_mehya

avin_mehya

    Member

  • Members
  • PipPip
  • 13 posts

Posted 03 August 2015 - 01:21 PM

Hi All,

 

I am trying to use the HTML TITLE tag under HEAD to use under the Name property for each page. The same has to be used using JavaScript and once the script has been verified than all the Page names should get changed as per the Title tag. This will in turn help in easier viewing of the Report. And effort will be saved for each and every user entering individual page names.

 

 

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
 
  ABC :: Log On

</title>

 

 

JavaScript can be accessed using

var title = context.document.getElementsByTagName("title")[0].innerHTML;

 

 

How can we access the internal Name property and set the same using variable created in Javascript



#2 Sergei Leonov

Sergei Leonov

    Advanced Member

  • Administrators
  • PipPipPip
  • 662 posts

Posted 05 August 2015 - 12:11 PM

You can just use WAPT function $Search and store the name into the variable.


Sergei Leonov
WAPT Project Manager
SoftLogica LLC

Office: +7-383-335-6692
Toll-free: 1-888-364-6797 (for US only)
Time zone GMT +6, EST +11
E-mail: support@loadtestingtool.com
http://www.loadtestingtool.com

#3 avin_mehya

avin_mehya

    Member

  • Members
  • PipPip
  • 13 posts

Posted 06 August 2015 - 05:03 AM

Thanks a lot for your quick response. But in this case $Search would only work when i wish to set the title for the first page to the second page which would be incorrect. Is there any other way which would help set the Page Name as Title of the same page



#4 Sergei Leonov

Sergei Leonov

    Advanced Member

  • Administrators
  • PipPipPip
  • 662 posts

Posted 07 August 2015 - 11:58 AM

Why do you need to change the name of the current page? Could you describe your need in more detail?


Sergei Leonov
WAPT Project Manager
SoftLogica LLC

Office: +7-383-335-6692
Toll-free: 1-888-364-6797 (for US only)
Time zone GMT +6, EST +11
E-mail: support@loadtestingtool.com
http://www.loadtestingtool.com

#5 avin_mehya

avin_mehya

    Member

  • Members
  • PipPip
  • 13 posts

Posted 10 August 2015 - 10:53 AM

We have a lot of scenarios to record and most of the scenarios go upto 400 pages or even more.

 

Also Page Names are set as Page URL's by default so the execution report finally is a lengthy one and its difficult to read because in most cases on the application under test URL's are appended with Invoice ID'S which is a very long one.

 

Hence we are looking at setting Page Names in a more distinguishable good manner so it would reduce manual effort of changing page names one by one and add value to the final report.



#6 iqra_faqraz

iqra_faqraz

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 17 August 2015 - 06:30 AM

You can just use WAPT function $Search and store the name into the variable.

i like it






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users