What are the click button and link command for PHPUnit Selenium? - phpunit

I am writing test with the selenium and I export to phpunit.
But click command doesn't work for me. I am writing like that $this->click("css=input.login");. But it shows errors like that ERROR: Command execution failure. And I already tested mine element correct or not.

I can find it from this. And the answer is the following.
This might also be related to a Selenium bug with the recent Firefox release (FF 22 I think), see (will be fixed in Selenium 2.34).
See Details in here.

Related

Goland run config console is wrapping lines before the end

For some reason the Goland console has started adding a line wrap well before the end of the screen when I run a debug configuration:
This is not happening when run the same command in another terminal or IDE, and I can't find any docs on settings I might have tweaked to make this happen. How do I get it to stop wrapping the lines like this?
It is a known issue in GoLand. Feel free to follow GO-12814.
As a workaround, you can invoke Help | Find Action | Registry, find go.run.processes.with.pty and disable it.

RobotFrameWork with Browser library starts in incognito modus, but the normal modus is needed

When a .robot file runs it can be started with =chromium =firefox =webkit
however it always starts in Incognito modus.
Our thought was, okay let's start is chromium and an argument
which looks like this
New Browser chromium headless=false arg=["--profile-directory=Persoon 1"]
But that didn't work because everytime it starts a new session so there is no Persoon 1 so to speak.
So the essence is: how can it be run in non-incognito modus?
(and how come it starts with incognito modus, is that standard behaviour or some config issue?)
resources: https://robotframework-browser.org/
https://peter.sh/experiments/chromium-command-line/switches/
The basic policy of robotframework-browser is to perform in incognito mode.
Their goal is not to leave any browser data through incognito mode.
Therefore, to support parts such as extension installation, incognito mode cannot be used. Because of that, they try to solve the problem in the following link.
https://github.com/MarketSquare/robotframework-browser/issues/963#issuecomment-913214068
However, this part has not been corrected yet.
Looks like we'll have to wait for a new version to come out.
After long research the answer is:
You can't! (It's just not possible)
Browser library incognito modus is deeply baked in somewhere deep in the code.
They are working on an option to give an argument with the url so it will become possible to use the LaunchPersistent of Playwright.
Until that time this is the solution:
install SeleniumLibrary as well. For some scripts use SeleniumLibrary.
Next you use the EDGE browser with 'msedgedriver.exe'
Done! you solved the problem.

Ghost Inspector tests are failing on running

I record test using Ghost Inspector on a website. But when I run the test in Ghost Inspector, one of the buttons is always greyed (only in the test run), and the test fails. Not sure why this is happening. When I record the button is not greyed.
This is the console output in Ghost Inspector:
1788:23079 Uncaught Error: Error in attempt to create DIL instance
with DIL.c…pendency for DIL v8.0+: Invalid Visitor instance.
The same test if recorder and playback using Selenium IDE runs fine
I also tried exporting the failing test from Ghost Inspector as Selenium IDE (new) and opened in Selenium IDE, and test ran successfully
Without seeing the code/test its a bit hard to tell but I'll take a shot in the dark
1) could be ghost inspector test settings. I would go into settings at the top right corner when you are inside your test and look at browser settings. Make sure you're using the browser you want as well as the correct screen size.
2) Could be a timing issue. You might need to add an assertion to let the button load before trying to click that button.
If these don't help let us know a bit more about the test steps as well as the button you are targeting. what is its function and what are the circumstances when its supposed to be disabled.

RSelenium WebDriver TimeoutException after ClickElement

I'm using the Selenium WebDriver in R to parse some online data. I originally wrote the script a few months ago, and it worked great. However, I ran it again today and I receive the following error after running ClickElement():
Error: Summary: ScriptTimeout
Detail: A script did not complete before its timeout expired.
class: org.openqa.selenium.TimeoutException
I'm using Chrome as my browser, and have updated to the newest version (2.20) of ChromeDriver (I was using 2.19 when I wrote the script). This error is peculiar because it occurs pretty late in my script, after I have already used ClickElement() multiple other times. The element being clicked is a download button. Selenium completes the click and starts the download, but then throws the above error after a few minutes. At this point, the script continues.
I can only think of a few possible issues:
The ChromeDriver update has broken something. I've tried it with both 2.19 and 2.20, and I'm unsure how to test this further.
Some issue outside of my understanding of Selenium. From some experimenting and trying to Google similar problems, I've decided that it might have something to do with the download process itself, i.e. the driver freezes up because the download is currently running on the page.
I'm not sure what is going on, and I don't know enough about Selenium to troubleshoot it effectively. What can I do? I imagine that I'll need an alternative way to perform the download, or at least a way to click the element while ignoring the ScriptTimeout error. I receive the same error when I try to send the enter key to the element as well.
I have a similar issue but I can't figure out.
Try this after your clickElement code
Sys.sleep(2)

How to use console.log in meteor jasmine tests

I'm using
Meteor 1.0.2.1
sanjo:jasmine 0.9.1
velocity:html-reporter 0.3.2
https://doctorllama.wordpress.com/2014/09/22/bullet-proof-internationalised-meteor-applications-with-velocity-unit-testing-integration-testing-and-jasmine/ says I should be able to use console.log() to see output in the console.
But nothing happens for me.
If I move the call out of tests/jasmine into client/ or server/ then the output is on the terminal where meteor is run.
The html-reporter also has a section called Logs. Looking at the code it appears to have a reactive collection on VelocityLogs. My google-fu is failing me as I can find no information on how to get any output to display in this section.
What is the correct way of logging in jasmine tests?
In Chrome the client side logs are visible through the JavaScript Console.
But I still don't know where the server side logs might be.
I've run with DEBUG=1 JASMINE_DEBUG=1 VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 and the console logs do not appear either.
Edit:
I've created a repo to provide an example of the problems at https://github.com/baerrach/meteor-velocity-issue-223.
If you are running server integration tests and they're not appearing, you may have found a bug!
Try running with:
VELOCITY_DEBUG=1 meteor
The logs should appear in the same place as the main meteor logs appear, prefixed with [velocity-mirror]

Resources