Accept a Confirm box with PHPUnit_Extensions_Selenium2TestCase - selenium

I have found a ton of solutions in other languages but not with php, any suggestions?, I thought I could just use $this->keysSpecial('ENTER'); when it pops up but if i understand it it stops the selenium test when a popup apears.

$this->acceptAlert();
I had this same problem last week and it took me hours to find the solution. I tried the keysSpecial('ENTER'), I tried chooseOkOnNextConfirmation() which I found out they didn't implement in php.
I wish I had bookmarked where I found it, phpunit Selenium documentation is awful and you get downvoted to oblivion when you ask questions about it.
Hope that was what you were looking for!

Related

Using DeckGL with Vue.js

I am struggling to get Deck play nice with vue. all the examples I have found till today are either quite hacked, not really my use case or out of date.
Does anyone know a good first step Source I could look at to get started?
I'm not sure if you ever found your solution or if you found other content, but I just wanted to post some info here in case you or anyone else who finds there way here needs some help on this.
There is a open source library we are working on to help bootstrap DeckGL/Mapbox implementations in Vue while providing some and soon more helpful abstractions.
Here is a couple links you may find useful:
Repo: https://github.com/loftylabs/vue_deckgl
Tutorial and documentation: https://loftylabs.github.io/vue_deckgl/
Feel free to stop by the repo and drop questions in issues if you are looking for any more help!

Cypress not used for tests

So, I am trying to create some sort of bot to interact with Twitter. I am familiar with Cypress and wouldn´t be a problem at all learn how to deal with Selenium, but my point is: for what I´ve been reading, they´re both specific for testing, and what I want to do is not exactly testing, but keep an algorithm running for as long as I want.
I can obviously make a loop on the Cypress or the Selenium code, but I don´t see it as the easier way to deal with the problem.
So my question is: is there some ideal framework to keep pressing buttons or typing stuff for a few days on a webpage, not for testing, but to automatically interact with other accounts?
What you need is what is called an autoclicker.
Although this can be done with Selenium, there are simpler and faster alternatives like this Chrome extension: Auto Click/Auto Fill.
A search for autoclickers can help you figure out the best alternatives for your use case and there are plenty of approaches in many different languages.

PHPStorm for Hack Language

I am kinda of a new user here and don't have enough reputation points to comment/ask on this question: IDE support for Hack Lang.
So, I am hoping that since the last entry provided by Themis Beris someone has been able to get PHPStorm working properly with Hack. I followed the 3 steps described in the post I mentioned, but still get compile-time errors on the classes I've written using Hack. <?hh is not recognized, for instance.
Any suggestions as to how to get PHPStorm playing nice with Hack?
I have no idea what Themis Beris is talking about on the linked question. (He seems to be saying something about PHPUnit, which is a completely separate issue.)
JetBrains has a feature request open for Hack support and last I heard was very actively working on it. But as of this writing (Feb 2015) it's not released yet.

Selenium using conditional statements

I just started looking into selenium for automated testing for the past few days and am getting pretty stuck. I've been looking for documentation on this but haven't found anything very helpful but maybe one of you have found something interesting, if so I'd love to read it.
Anyway, here's the problem: I need to open up a website. This website takes in some parameters which takes the browser to another site, however if the parameters are invalid then the next site will display a message saying "An error has occurred".
If the second site doesn't error out like this we want to store a few arbitrary values and echo them later. If the site does error out we want to mark the error and move on. Right now, if the second site is invalid selenium stops running.
The only way it seems to do this is to have an if-else statement though I haven't found any mention of one in selenium. I have read somewhere that you can create some javascript on your own and then input that into selenium. The problem there is that I don't know how to actually input the javascript into selenium.
I hope that wasn't too confusing.
Thank you,
Jesse Smothermon
My coworker found it. code below:
<tr>
<td>storeEval</td>
<td>(selenium.isElementPresent("variable_looked_at")?selenium.getText("variable_looked_at"):"N/A")</td>
<td>Address</td>
</tr>
Thanks,
Jesse Smothermon
I am fairly new to selenium too, but I think what you want to do is use the Selenium IDE and export to visual studio or something. When you use selenium with visual studio (C#) you have complete control over the flow of the test. its much more easier to program something like that. but at the same time, you need to configure it with Nunit or selenium RC.
Also out there is a selenium extension called "Flow Control". I have not used it, but I believe it will allow the Selenium IDE to do if/else/etc
As a unit test, if the second site has failed, the unit test has failed. Perhaps rather than looking for a conditional processing of your unit test, fix the problem that causes the test to fail.
That may sound a little harsh and forgive me if it does, but it sounds illogical to me that you would want to take this approach.

Textmate Code Completion Question

I know the ESC key does code completion, but is there a way to get a pop-up(tool-tip I guess) that shows you all the possible choices for a piece of code? As an example, it would be nice when writing Javascript to get a list of available actions. Other apps I've used like Coda do this. I'd like to check out Textmate but I have a hard time getting past this missing feature which I find pretty valuable, particularly as a fairly new programmer who likes to see what options are there as it's a bit of a learning tool for me also. I thought I had found a plugin like what I'm looking for, Dialog2, but it seems to have disappeared as it was meant to be built-in to the never-released TM2.
I've looked around a fair bit for the answer to this question and figured this was my next best option. Thanks.
I don't have Textmate available to try it out, but I believe that option-Esc is supposed to show you the list of possible code completions.
Check out subtleGradient's tmbundle: https://github.com/subtleGradient/javascript.tmbundle
It knows how to auto-wrap for arrays, and objects. Documentation look-up too.