here is the source code:
<table id="movements" cellpadding="1" cellspacing="1"><thead><tr><th colspan="3">Movimentações de tropas:</th></tr></thead><tbody><tr>
<td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="att1" alt="Tropas atacantes chegando" title="Tropas atacantes chegando" /></a><span class="a1">»</span></td>
<td><div class="mov"><span class="a1">1 Ataque</span></div><div class="dur_r">em <span id="timer1">13:21:06</span> hrs.</div></div></td></tr><tr>
<td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="def1" alt="Tropas de reforço chegando" title="Tropas de reforço chegando" /></a><span class="d1">»</span></td>
<td><div class="mov"><span class="d1">1 Reforço</span></div><div class="dur_r">em <span id="timer2">0:14:55</span> hrs.</div></div></td></tr><tr>
<td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="att2" alt="Próprias tropas atacando" title="Próprias tropas atacando" /></a><span class="a2">«</span></td>
<td><div class="mov"><span class="a2">1 Ataque</span></div><div class="dur_r">em <span id="timer3">0:08:50</span> hrs.</div></div></td></tr><tr>
<td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="def2" alt="Próprias tropas reforçando" title="Próprias tropas reforçando" /></a><span class="d2">«</span></td>
<td><div class="mov"><span class="d2">1 Reforço</span></div><div class="dur_r">em <span id="timer4">2:50:45</span> hrs.</div></div></td></tr></tbody></table>
and this is the View Source Chart of the document html (for easy DOM working):
I would like to get to the 0:14:55 value coming from <span class="d1">, how to do it?
EDIT Marcel Korpel: The value is always in the span in a div coming directly after a div containing a span with class d1, like:
<div class="mov"><span class="d1">1 Reforço</span></div><div class="dur_r">em <span id="timer2">0:14:55</span> hrs.</div>
Currently in my tests I do something like this to test if an email is queued to be sent
assert_difference('ActionMailer::Base.deliveries.size', 1) do
get :create_from_spreedly, {:user_id => @logged_in_user.id}
end
but if i a controller action can send two different emails i.e. one to the user if sign up goes fine or a notification to admin if something went wrong - how can i test which one actually got sent. The code above would pass regardless.
When I execute a Rails unit test from the command line (as suggested here) such as
ruby unit/test_model.rb
...I get this error:
No such file or directory - .../test/config/database.yml (Errno::ENOENT)
Am I doing something wrong? Or is there a workaround?
Hello,
I would like to have .class and .java files in a JAR. Thus, I have "bin" and "src" pastes in that JAR. How should I edit the MANIFEST.MF?
JAR
|
-- bin -- .class files
|
-- src -- .java files
|
-- META-INF -- MANIFEST.FM
Im doing this:
Manifest-Version: 1.0
Class-Path: ./bin/
Main-Class: simul.Simulador
But with no success.
Proxy configuration of a machine can be easily fetched using
def check_proxy():
import urllib2
http_proxy = urllib2.getproxies().get('http')
I need to write a test for the above written function. In order to do that I need to:-
Set the system-wide proxy to an
invalid URL during the test(sounds
like a bad idea).
Supply an invalid
URL to http_proxy.
How can I achieve either of the above?
Does increasing the number of test cases in case of Precision Neural Networks may led to problems (like over-fitting for example)..?
Does it always good to increase test cases number? Will that always lead to conversion ?
If no, what are these cases.. an example would be better..
Thanks,
I have a private method in my controller. which is used for some database update. this method i am calling from another controller method. and it works fine.
But when i am trying to write a test case for that method then It is tripping on accessing (session variable and params) in my functional all other methods are working fine the problem is only with private method?
In my setup method in functional test, I am setting session also.?
What if I need to add a class to the options tag?
testme1
I haven't been able to do this.
This is what I have
<%= select(:user, :goalstext, Bodytarget.all.collect {|b| [ b.name, b.id ] }, {"class", "test"}, :class = "selected", :class = "selected") %
I am using a custom class loader which extends URLClassLoader. I load some classes into my custom class loader and perform some task. Once the task is completed i want to dispose of the class loader. I tried doing that by setting the reference to null.
But this does not garbage collect the class loader.
Is there a way that can help what i want to achieve?
I have a private method in my controller. which is used for some database update. this method i am calling from another controller method. and it works fine.
But when i am trying to write a test case for that method then It is tripping on accessing (session variable and params) in my functional all other methods are working fine the problem is only with private method?
In my setup method in functional test, I am setting session also.?
I'm sure I'm missing something simple. bar gets autowired in the junit test, but why doesn't bar inside foo get autowired?
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"beans.xml"})
public class BarTest {
@Autowired
Object bar;
@Test
public void testBar() throws Exception {
//this works
assertEquals("expected", bar.someMethod());
//this doesn't work, because the bar object inside foo isn't autowired?
Foo foo = new Foo();
assertEquals("expected", foo.someMethodThatUsesBar());
}
}
Seems a great C++ unit testing framework. I'm just wanting something a bit more sophisticated than the console output for running the test, also something that makes it really easy to run specific tests (since gtest supports all kinds of test filtering)
If there is nothing, I'll probably roll my own
i.e. as I compose my test suites to include other suites as well as test cases,
is there a global count of how many tests the TestRunner has executed, will be executing?
Any way I can progammatically access that count?
We do not use a Maven
framework in our environments. Can you suggest a way to use the Jersey
test framework for testing the Rest web services? I have tried to override the TestContaioner and TestContainerFactory interfaces to set up an AppDescriptor but I fail to understand how to set the LowLevelDescriptor to use the HTTPContainerFactory instead of the default one. I tried also settign the System property jersey.test.containerFactory. Does not work?Any ideas?
Can anybody explain why load test result on Graph are different form load test result on Table Page. If compare Min and Avg page response time they are the same. But if we compare figures in Max column they are different for the same page and the same load rest run.
see linked images for more details.
http://cid-ee8b34c203174724.skydrive.live.com/self.aspx/.Public/3.png
I utilize the standard python logging module. When I call python manage.py test I'd like to disable logging before all the tests are ran. Is there a signal or some other kind of hook I could use to call logging.disable? Or is there some other way to disable logging when python manage.py test is ran?
Hi,
what test data approach/framework is recommended for .net unit testing? I'm in VS2010, C#, doing business logic layer testing.
By approaches I mean like: creating database snapshots, programmatically creating each time, etc etc. Like what approach to use to ensure at the start of each test the database is in a known state.
i have swing code which is written in eclipse with out help of visual editor(not choose the class as visual class), now i need to modify that code using visual editor, how can i convert the a java class into visual class?
I'm brand new to Ruby testing and Google isn't helping.
Using Test/Unit, how can I print an instance variable, like
test "thing to happen" do
do_stuff
assert_equal "foo", @variable
p @varible
end
The connection string in my app.config for my C# project looks like
Data Source=.\SQLEXPRESS;AttachDbFilename='|DataDirectory|\EIC.mdf';Integrated Security=True;User Instance=True"
I am writing unit tests for the project and have the set the test run configuration to copy the EIC.mdf, but I do am not able to reference the Deployed copy of EIC.mdf to be referenced by the app.config I created for the test project. If I set it to
Data Source=.\SQLEXPRESS;AttachDbFilename='EIC.mdf';Integrated Security=True;User Instance=True"
It still does not find the mdf file.
I follow this tutorial here to create RESTful web service on Netbean 6.8. However, when I right click on the project node and select Test RESTful Web Service, the browser pop up, and supposedly my project would be listed on the left, and supposedly I would be able to select it, and test against various function that listed on the right. However, I dont see any of that. Any idea why?
I have a class that processes a file, and as part of the constructor with one argument I want to input a file using fstream.
I basically want it do something like this
class someClass{
public:
someClass(char * FILENAME)
{
fstream fileToProcess;
fileToProcess.open(<FILENAME>, fstream::in | fstream::out | fstream::app);
}
};
I want to pass the filename in as an argument to the class constructor, and then the class someClass will access it with fstream.
I would like to test if an instance variable lies in a range of numbers. I solved the problem by using assert_in_delta but would like to know if there is a formal assertion for this.
#part of the tested class
def initialize(value = 70 + rand(30))
@value = value
end
#test_value.rb
class ValueTestCase < Test::Unit::TestCase
def test_if_value_in_range
assert_in_delta(85, p.value, 15)
end
end
Can somebody give me a link to PKCS#11 test suite? This may be a simple utility or part of big project no matter.
I now only this one: Netscape PKCS #11 Test Suites