Win a copy of Fixing your Scrum this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Hey object are you on the screen?

 
Ranch Hand
Posts: 191
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am stuck testing in IE 11.  I'm using selenium with Java.

For some objects I need to construct the xpath by guessing and then see if it works in the script.   I don't have the luxury of chropath or fire bug or tools such as that.

I'd like to write a script where I have the page with the object I am trying to reach open.  Then have a small Selenium script that makes the object on the screen blink or a message appear in the bottom of the screen saying if it was found.

I don't know of a way to find out if selenium can find the object.   I don't want it to take an action on the object such as click, but I'd like to know if Selenium can tell that it is there.  

I know how to click on an object with driver.object.click kind of code.

I found some code online that I am still debugging that calls JavaScript and changes the color of the object if it can find it.

I'll take any ideas or snips of code I can get.

Thanks,

Kevin

 
Ranch Hand
Posts: 92
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IE is deprecated
 
Saloon Keeper
Posts: 24171
165
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Damon McNeill wrote:IE is deprecated


The problem with a feature like IE which according to Steve Ballmer was "an integral part of the Windows Operating System" is what happens when Microsoft decides it shall no longer be an integral part of the Windows operating System.

Welcome to Windows 11. The best they'll promise is to try and fake it in Windows Edge.

There is a difference between being visible in a browser window and being part of the browser window's DOM. The DOM cintains everything in the webpage, including what is scrolled out of sight. Or, for that matter, covered up by other object in the DOM or other applications.

CSS/JavaScript does have some ways to persuade the view to scroll to where a DOM element is visible. If it can. As far as that goes, I think that you can chase down the bounding box for graphical DOM elements and compare them to their display container rectangle.

But fundamentally, I have to doubt that tests of display view positioning are really appropriate for Selenium. It is important to remember that web page layouts are suggestions to the client, not absolutes and that even the strictest CSS may get ignored if the user's environment won't permit it to be honored. If you want 100% control of your layout, that's what PDF's are about. So a page could pass your tests and still be unpleasant/unusable.

Speaking of passing tests, the system I'm typing from is a Raspberry Pi (Not a Windows machine) and the browser is Chromium (if IE ever ran on any flavor of Linux, I've forgotten what it was). So you can obsess all you want about IE's pretty face, but if you plan on doing business with me, you're better off paying attention to more general matters.



 
kevin Abel
Ranch Hand
Posts: 191
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Damon and Tim...Some places have developed applications that have run for years on IE. It does what they want but occasionally needs some adjustments.   They don't have the funds or need to upgrade to something else.  I'm the tester and can only recommend that they leave the platform.
 
Tim Holloway
Saloon Keeper
Posts: 24171
165
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

kevin Abel wrote:Damon and Tim...Some places have developed applications that have run for years on IE. It does what they want but occasionally needs some adjustments.   They don't have the funds or need to upgrade to something else.  I'm the tester and can only recommend that they leave the platform.



At this point, it's not a matter of them leaving the platform, it's a matter of the platform leaving them.

They definitely have the need, whether they'll admit it or not. And I'm going to go full-on Capitalist and say that any business that cannot afford to be competitive deserves to fail. No Socialist Handouts or other freebies here. Just good old American Eagle Self-Relianceā„¢. You've got to earn your right to stay in business. Every day. It's a Jungle out there and only the strong deserve to survive. Oink, oink, squeal.
 
kevin Abel
Ranch Hand
Posts: 191
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with you. They will get pushed off of IE.  For now I found that pressing F12  gets me to the developer utility as usual.  Then I press on the console button.   The xPath testing bar sometimes does not appear so I have to press on the Dom tab to the left and then back to the console tab.  Then I get the bar that I use to build the xPath string.
 
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic