What is the purpose of "typeAndWait" command in Selenium IDE? - selenium

I am just thinking about command typeAndWait in Selenium, because I cant figure out any real purpose of it.
In what situation you type in some input and then the page immedeately starts reloading? I can imagine AJAX, but in this case the page doesn't reload - which is the reason, you have to use waitForXY commands instead of xyAndWait when testing AJAX...
But it was a long day today, maybe I am just dull now and the answer is quite obvious...

The google search while you type is the only situation I can think of where that would happen, except your right that the page wouldn't actually load, but there are some weird cases out there that I'm sure I haven't thought of.

Related

Actionaz validation

I work on a program, which involves lot of clicking. To prove if everything works fine, i have to write tests in Actionaz. Mostly i use clicks, text and tabs. Problem occured, because i need to validate test is done okay, without looking the screen.
I know what i have to do, i just dont know how to do it. So example: i have to add a new client, with adding all information. I designed Actionaz where to click and what to enter. If there will be changes made in the program, Actionaz will keep clicking same spot, but this time, test may not be succesful. How to make Actionaz read, what is the correct outcome? (And notify me, that test wasnt succesful.)
Im sorry, if im not understood correctly, but i really cant find answers about my problem online elsewhere.

Sometimes xpath is not working but sometimes same xpath is working while running automation

I wrote one xpath like below:
//div[contains(#id,'ext-element-')]/table[2]/tbody/tr/td/div/span
Same xpath sometimes it is finding the particular element.But sometimes it is throwing
ElementNotFoundException.
Is there any convenient way to solve this problem?
The more elements there are in the xPath (e.g. tbody/tr/td/div), the more possibilities it is for it to break (sometimes for mysterious reasons).
Wherever possible, use descendant to skip them, for example:
//div[contains(#id,'ext-element-')]/table[2]/descendant::span[contains(#id, 'spanId')]
Or just double-slash // (meaning any child or subchild):
//div[contains(#id,'ext-element-')]/table[2]//span[contains(#id, 'spanId')]
Shorter, yes, but less readable (easy to miss a slash and then wonder what happened). But is still mostly prefer double-slash.
The use of "Axis names" can make your xPaths more robust.
Here are some resources:
http://seleniumworks.blogspot.de/2014/03/xpath-selenium-uses-part-ii.html
https://www.simple-talk.com/dotnet/.net-framework/xpath,-css,-dom-and-selenium-the-rosetta-stone/
http://www.guru99.com/xpath-selenium.html
Does the step prior to this cause a change to the DOM (e.g. new page load or AJAX request that changes the page)? If yes, then is likely to be a timing problem: the element is sometimes not found because the request for the element happened while the page was loading. You should instead wait for the element to exist. Then find the element and do whatever comes next.
Not sure if this will help you much, but I was having a similar issue where driver.find_element_by_xpath(...) would return information initially, but then running the same thing a couple seconds later would result in the 'Element Not Found' exception, so I imported time and put a sleep(2) right after my driver.get(...) and that fixed it for me.
Hope that helps.
Always try to go with an absolute path; otherwise try by adding indexes to XPATH; otherwise go for the third option of a relative path (keeping it minimal).

On Smalltalk IDEs (Squeak, VisualWorks, etc), how can you navigate away from a message's code you're working on to inspect another?

In every IDE I've tried so far, if I'm partway through writing a message and need to look at the code of another, the browser asks me if I want to save. But if I say I do want to save, it actually tries to compile/syntax check the code, and refuses to perform the save if it does not pass. The only way to view the source of another message seems to be to say "no" to save and have everything wiped. How can I look at another class incidentally, or save code I am partway through working on that might not build right now?
Smalltalk is a multi-browser system. You'll need to have lots of different browsers open. Smalltalk is opinionated. The system browser (Nautilus) doesn't make it easy to view long methods, steering you towards writing short ones. It doesn't make it easy to have non-compiling code in a method, to steer you towards making small changes.
Experimental/prototypical code you might want to have in a Workspace/Playground. That can save to disk.
We are aware that it is an issue for people new to Smalltalk. We tried some fixes, they were a lot worse.
For now there is no easy way to do that. The two easiest opting are
Make the current method syntactically correct and save it.
Open another browser. If you want to see a class or method that is in your current code, you can cmd+click it or use "browse it", "implementors of", shortcuts that will open another window.
Also in pharo you can use GTSpotter to quickly find what you are looking for and preview its source code
When you say "this seems like a pretty huge thing to be missing,
and it could be gotten around by just having the option to use
a regular editor" I'm afraid you've entirely missed the point.
Understandable, though -- happens to us all.
Or did. Perhaps it was long ago, but we
were all there.
You might be thinking about the task in terms of
scrolling a giant text up and down to find what
you want. Scroll up -- read a little -- scroll back --
and continue making your changes.
And when you say " I can't imagine any circumstance
where it is OK, in pursuit of any agenda, to throw away
the coder's work against their will "
you are spot on correct, of course.
Imagine -- scrolling around, making dozens of little changes,
and before you've saved them -- poof -- they're all thrown away --
a mistake, perhaps, but completely against your will.
That would be awful. We're agreed.
(In fact, the editor I'm using to type this
is like that -- I can scroll around the whole thing,
making little improvements, all over, but it could
all go --poof-- and disappear, All of it.
Fairly common occurrence, when editing the web.
)
So let's try another run through that same task.
You get one little teensy, DUMB AS A POST editor,
where you can only see one thing at a time.
And now you just want to scroll somewhere else,
for a moment, and come right back.
Which actually means that
you are attempting to look up a second method,
while already changing a first method
(which would require the browser toforget the
context of the first method, and move to the second).
The browser does not know how long you will be away
from this context. You might go chaining along from
place to place, stop and read an email, take a call,
and go to lunch.
So, the browser cautions
"Hey - want to save this first?"
as if to say:
"
Hey - I can't imagine any circumstance where it is OK,
in pursuit of any agenda, to throw away the coder's work
against their will.
So listen up, coder.
You want to save this first?
"
But you can't save it.
You must first look something up.
Conundrum.
Ah-ha! There is a list of methods in that other pane.
One of them is highlighted.
Not those -- that one.
Double click that one.
The one you're already in.
As if to say
" Thanks. Good catch.
Yes, I know - can't though.
I need to change contexts.
You stay right here.
And give me another context
to go wandering about in.
please.
"
Soon, I expect, they'll start actually talking.

Intellij IDEA 14 Ultimate cursor jumping around in Java Code when hitting Enter from time to time

Sometimes when i hit Enter behind a line to write the next line my cursor jumps down like 300 lines of code within the same Java class which is absolutly annoying.
It jumps just to anywhere within the same file but always somewhere faar below the line i hit enter behind ... so its not jumping to a definition or something like that - it literally just places the cursor to a random point.
Did anyone ever had a similar experience? (I cant find anything on the internet hence i think its either a very easy to fix thing or something for the support).
Like could this be a side effect of defined live templates or something like that?
ANY suggestion could help since i tried out anything i could think of (code completion, live templates, editor settings - nothing looks like it would trigger this behaviour)
Note: I dont like this question at all but i am realy lost right now.
I have not seen any one run into this nor have I seen a bug report on such (and something like that would be a critical). I recommend the following steps:
Upgrade to the latest v14.0.3 if you are not at that version
Invalidate your caches and restart, then wait for IntelliJ to re-index your project (this is a bit of a long shot, but worth the couple of minutes it takes)
File/Application > Invalidate Cache
Disable all third party (i.e. non-bundled) plug-ins and restart
My strongest suspicion is that a 3rd party plug-in is causing the issue.
If this solves the issue, isolate the plug-in causing the issue and contact the developer.
If none of the above work, provide as much detail as you can about the issue as #Makoto suggests. What type of file; what are you doing; OS; IDEA version; etc, etc.

cucumber format pdf

I've just started using Cucumber and formatting them as pdf's to show clients.
Is there a way to make sure a whole Scenario stays together on the one page?
Is there some sort of Orphan/Widow control in the Cucumber pdf output which I could use?
Sometimes I find I end up with a page with one line on it from the last Scenario. Not only is this a waste of paper but it can be sometimes an issue when going through Scenarios with the client.
I'm not sure if there are any formatters that do what you are looking for but you can always create your own.