Selenium IDE GoToIf command - selenium-ide

I am using Selenium IDE GotoIf command, if my condition is true, then selenium executes the label that I specified. In my case, I would like my test to break if the condition is true, without going to a label, I would like my test script to break immediately if my condition is true, without being redirected to a label. I think that what I would need is an IF command instead of a GOIF command. I would like my test to behave like this:
IF CONDITION==TRUE
TEST BREAK
ELSE KEEP EXECUTING
Is there any command to make that happen? I would like the execution to keep going only in case my condition is false and I would like my test case to break if my condition is true, of course since the test case would break, the execution would stop at that point!
Also, is there a command to make a test case explicitly break in Selenium IDE? I would like to voluntarily make my test case break, is there any command for that?

I answered a similar question before albeith in a defrent way.
To force Selenium to end with an error message you have to actualy cause an error on purpose. Truthfully I would be using...
gotoIf / condition is false / Variableiffalse
click / Errormessage of my choice / (leave value field empty)
label / Variableiffalse / (leave value field empty)
Test continue up to the end
The failed click command will automaticaly end the test and post the target as your error message. I hope this was useful
your error message should appear as something similar to [error] Element message I put in target not found

Related

Xcode Swift Unit Test Output is too verbose

Is it possible to limit the console output of unit tests in Xcode? I don't need to a list of every passed test case (hundreds) and test suite (dozens) listed. I only want to see the details of what has failed.
Answering my own question...
The best solution I have found is to enter the word "failed" (without the quotes) into the filter text box at the bottom of the console window. Once this is done the console output will show only one line for each:
- XCTAssert failure,
- Test case failure,
- Test suite failure.
If there are no test failures, nothing will be displayed. However, the "test succeeded" pop up is only displayed for a couple of seconds and if you don't see it then there is nothing to indicate that the tests have completed.
If the filter word is changed to "fail", the console output will additionally include stats for the number of tests passed or failed. These are displayed even if all the tests pass.

how to verify text present in placeholder in selenium IDE

I want to verify the text present in placeholder. I have located the element and i am using Assert text command. I've entered the same string in value. On executing it is showing actual value did not match
Use assertAttribute or verifyAttribute command.
Example:
verifyAttribute | css=#search#placeholder | Sample String
Notes:
In the Target column of Selenium IDE, you need to provide the proper path of the element followed by an # sign
and then the name of the attribute. (placeholder in your case)
Using
verifyAttibute will still continue running the test case once an
error is detected while using assertAttribute doesn't.
You need to understand that assertText function can only check static text on your webpage.
You must be getting an error message.
This is perfectly normal.
What can help in this situation is using the assertAttribute or verifyAttribute functions.
Both these functions perform the same task; the former stops the test after receiving an error message in the text box while verifyValue just records the error in the log and runs the next commands.
While giving the target, either specify the XPath or refer by using the name=name#placeholder format.
You can find the name value by inspecting the box with a firefox addon called Firepath which runs with another firefox tool called Firebug. Install them if you don't already have.
Hope this helps!
Xpath contains() is the best way.
driver.find_element_by_xpath('//input[contains(#placeholder,"email")]')
Format : '//tag[contains(#attribute,"value")]'

How to always set correct number of tag before every run htmlUnit or Selenium test? Eclipse

I would like to ask you, if is possible to renumber (automatically) my tags in testing script before every start (Test defined in include) ... no shortcuts. My goal is always actual and right number of step in log.
you can write a counter function. give a parameter at start to reset and whenever you called it, counter increment by 1

Macro runs on one computer and get run time error 5 on anothe

I run a macro on one computer and it is fine
And on another it gives me the run time error 5: invalid procedure call or argument
This is the code he doesn`t like:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
Range(Cells(1, 1), Cells(R, C)), Version:=xlPivotTableVersion15).CreatePivotTable _
TableDestination:="ProjectsOW!R3C1", TableName:="PivotTable3", DefaultVersion _
:=xlPivotTableVersion15
Please help!
CAUSE
This problem occurs because the destination worksheet and the range for the new PivotTable are specified in the recorded macro. Therefore, the recorded macro is not dynamic. Additionally, the recorded macro cannot be played repeatedly.
RESOLUTION
To resolve this problem, follow these steps:
In the Microsoft Visual Basic Editor (VBE), locate the code for the recorded macro.
Empty the value of the TableDestination variable as in the following example.
TableDestination=""
On the File menu, click Save.
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
For more info

How can I diagnose this critical error? Zend_Db and PHPUnit

I have an action in a model that adds a record to a table. It works fine when I test it by typing values in to the browser, but is failing when I test it with PHPUnit. The frustrating part is that I don't really know how to diagnose the problem.
The unit test has a (rather long) $data array, and the problem occurs when I call the dbTable->insert($data) method. The log shows:
CRIT (2): Application Error
CRIT (2): Request Parameters
How can I get more information on these errors? The line following the offending line is not executed.
Thanks!
Ok, so I had a boolean field in the DB that was not nullable. It showed a default value of 0, so I assumed that I didn't need to provide this field in the insert statement. Seems I was wrong.
As soon as I provided a value for this field it worked fine.
Something else that confused this issue is that I had assumed I'd get a more descriptive error in my log if was such a simple error ...