Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6559079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:16:43+00:00 2026-05-25T13:16:43+00:00

I have a html file which stores which suppose to store the absoluteUrl whose

  • 0

I have a html file which stores which suppose to store the absoluteUrl whose content is this :

<html>
<head><title>Root URL variable</title></head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Root URL variable</td></tr>
</thead><tbody>

<tr>
    <td>store</td>
    <td>javascript{window.location;}</td>
    <td>rootUrl</td>
</tr>

</tbody></table> 
</body>
</html>

The problem arises when I try to replace window.location with var loc = window.location; I am getting this error

Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: eval(match1) is undefined

That is the first issue. Second issue is that I would like to get the absolute path using javascript and try to store as the rootUrl variable. Any solution suggestions will be handy(If the first problem is solved I am planning to try solution similar to the one here by Neville Bonavia i.e.

function getAbsolutePath() {
var loc = window.location;
var pathName = loc.pathname.substring(0, loc.pathname.lastIndexOf('/') + 1);
return loc.href.substring(0, loc.href.length - ((loc.pathname + loc.search + loc.hash).length - pathName.length));

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:16:43+00:00Added an answer on May 25, 2026 at 1:16 pm

    When Selenium is running this refers to the Selenium object which means that you won’t have direct access to window or document.

    To get direct access you will need to do this.browserbot.getUserWindow(). That returns you the window object on the page and then you can make your usual calls.

    e.g.

    var window = this.browserbot.getUserWindow();
    return window.location;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this html form which calls a php file . The index.html ->
I currently have a huge HTML file which doesn't have line breaks and just
can anyone help? I have a simple html file which i am filling via
I have a HTML file upload field from which I'm reading the file name
Let's say I'm including a file which contains html. The html have characters as
Afternoon, I am trying have an HTML file containing a frameset which contains two
I have a file which is combination of PHP and HTML. How can i
I have written xml file which contains html tags as element like <component> <input
I have the following code which loads and html file into a webview -
I have a html form for uploading a file, which is as follows: $uploadhtml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.