I'm creating tests (in Firefox) for a web app.
Depending on what field the cursor is over, a different help screen will appear. But when creating tests for those help screens, i cant get Selenium to focus on the particular field i want.
I've tried using fireEvent, click, select, and type in order to get the focus to stay on the field i require in order to load that particular help screen but i've had no luck.
Does anyone have ideas on how this can be solved. Or how i can work around it?
You can use selenium2 AdvancedUserInteractions API:
Actions builder = new Actions(driver);
builder.moveToElement(someElement).build().perform();
if my understanding of your question is correct, you wanted to display different help screens for differnt elements,
o.k here it is, if the message of the screen is displayed as a tool tip and the styling is taken care by mouseover event
selenium.mouseOver(locator) and then [ Thread.sleep(1000) ] and then use
selenium.mouseOut(locator)
try with this.if you don't get it and if my understanding of your question is wrong please post it.
you must investigate how that screen is being is displayed. and try to post all that code
Related
I am working on web application which is implemented with angular and react js. In this, I have a scenario to scroll and check whether element is displaying or not.
I have tried all ways like using x,y values, scrollIntoView and all possible ways what I have noticed on different blogs and technical related web pages. But, i an not succeeded in it.
Here, I need some suggestions like what are other approaches we have to scroll webpage other than javascriptexecutor as this is already applied and failed in my case.
As a side note, elements will be loaded dynamically when we scroll the webpage and will not be available in the DOM itself. To get these elements, we have to scroll manually and check it.
Thanks in Advance..
I found a root cause why javascriptexecutor is not working on my application. This script will work only on browser (I.e. if browser have scroll bar), but in my application browser does not have a scroll bar instead it has virtual table scroll bar (scroll bar inside application).
Even I found a solution for the same after 2 days of investigation using Keys.PAGE_DOWN/UP inside do while loop.
Thanks for your support.
Is it possible to expect a click to fail with testcafe?
I'm using testcafe studio.
After I hit a submit button on my page, I want a test to make sure that some text is no longer on the page.
What is the best way of doing that?
Thanks
I found one way of ensuring that the element wasn't on the page:
I used a t.notOk(Selector(mySelectorHere).count)
In your test scenario you can use exists Selector property:
Selector('h1').withText('Some text').exists
Does anyone know why my result for cascading LOV is not showing full screen?
http://i.imgur.com/QIp0YV4.png
As you can see, there is a line in the middle of the page. I have tried several ways to get it set to fullscreen but was unable to.
Figured it out. Had to change the template under report.
While clicking the dropdown in an overlay, it shows the list as expected and the main page gets hided. But when the user tries to scroll on the page, the dropdown content (list) start moving along the page scroll.
We used Dojo 1.8 for our HTML development. Can anyone help me with a suggestion to handle this?
It's not 100% clear from your question, but I believe you are describing https://bugs.dojotoolkit.org/ticket/5777. As far as I can tell, the resolution to this for moving popups along with their opener's container's scroll was only institituted in 1.9 and above (I couldn't find the _repositionAll method in 1.8).
I would suggest trying with 1.9.7 or 1.10.4.
I'm not even sure what the name of that is to be able to make a search... but I would like to make those kind of things. Facebook has that too with the messages, notifications and friends requests. Thanks
I'm not sure if you expect anyone to give you a complete tutorial with source code included? :) You should probably do some digging around yourself, since a concrete answer on this could mean to write a few pages :)
How can you dig around?
Thé tool for a job like that is Firebug (IMO).
With bigger tasks like these it makes sense to try to split it up in smaller pieces.
Let's say you go for a widget like the user profile popup on SO.
you need some HTML to display in a popup: right click on any html element on the popup and click the 'inspect element' menu item. This brings you to the HTML tab in firebug. This allows you to figure out how the HTML is structured
you need some CSS to style that popup: when you're browsing the html structure, you might already have noticed that on the right side of it is the CSS that is applied to the active element
you might want to use some animation effects: for that you could use jquery. Have a look here to find out more on which effects are available and how they can be triggered. Fading is used in the profile popup on SO.
then you might ask yourself the question where SO get's that html structure from, right? To find out more about which server calls are made you can use the 'NET' tab in Firebug. (When you hover over your user name (only the first time?), then you should notice there's a call made to something like: http://stackoverflow.com/users/profile-link-stats?_=someLongNumberHere
In firebug you can then inspect the request and response. You should notice that the response is some HTML structure. This HTML structure is then inserted into the DOM.
Sooooo you can kinda glue it all together now:
the user hovers over his user name
the hovering triggers a server call (see step 4): use jquery hover to attach a handler to the user link. (subsequent hovers don't trigger that server call, so there needs to be a check to see if that profile popup was already loaded or not)
when the server call successfully returns (see jquery get), the returned html is inserted into the DOM and a fadeIn effect is triggered.
it seems a mouseout is used to fadeOut the popup
I HOPE this is the answer you were looking for. It took me a while ;)
You probably need to check out stackapps