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

  • SEARCH
  • Home
  • 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 8159075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:48:08+00:00 2026-06-06T17:48:08+00:00

I try to get some website attribute (colour of the cell) and compare in

  • 0

I try to get some website attribute (colour of the cell) and compare in Selenium.

When I put this:

javascript:window.getComputedStyle(document.getElementById("simple_cname"),null).getPropertyValue("background-color");

in Chrome Omnibox, I receive correct answer, but when I, by using storeEval or assertEval try to get this value it does not work correctly.
edit:
I put to selenium command like this. I use storeEval and when I echo the value it returns me this command. I use Firefox. I used Chrome just to chech if the command is correct. (it should be “rgb(220, 22, 92)” )
edit2:
Yes, the command is ok, but I have a problem with using it in Selenium-IDE tool. It do not returns the value when I use it with storeEval command.
log:
[info] script is: var test javascript:window.getComputedStyle(document.getElementById(“simple_cname”),null).getPropertyValue(“background-color”); echo test;
[info] Executing: |echo | ${test} | |
[info] echo: var test javascript:window.getComputedStyle(document.getElementById(“simple_cname”),null).getPropertyValue(“background-color”); echo test;


I put to selenium command like this. I use storeEval and when I echo the value it returns me this command.
I use Firefox. I used Chrome just to chech if the command is correct. (it should be “rgb(220, 22, 92)” )

  • 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-06-06T17:48:09+00:00Added an answer on June 6, 2026 at 5:48 pm

    You need to remove the javascript: part and refer to document as window.document. The command will then look like this:

    window.getComputedStyle(window.document.getElementById('simple_cname'),null).getPropertyValue('background-color');
    

    The javascript: part is only needed when running the code from your URL bar, it’s redundant anywhere else. Use the Console instead of your Omnibox to run JS commands in Chrome.

    The document -> window.document thing is mentioned in the docs under the storeEval section.

    Also, note that your script will only work in modern browsers, it will fail in IE < 9. If you’re okay with it, fine. If not, Google has the solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get some information from this website: http://www.131500.com.au/plan-your-trip/trip-planner?itd_name_origin=hurstville&itd_name_destination=town+hall The table structure is:
I try to get some insights from the pages I am administrator on Facebook.
For some reason if I try to get the actual size of mystruct I
I am working on some scraping app, i wanted to try to get it
I try to replace few characters in some string 14/04/2010 17:12:11 and get, for
When I try to install my software in some computers, I used to get
I try get a my attribute inside Fancybox, and I get when I use
I try to get the main window handle using following code in Lazarus (Free
I try to implement a Google +1 button in my website, but for some
I have this stack trace error when I try view some data in my

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.