At first, I failed to find which weekday is today by following codes:
timetoday = Time.now
if timetoday =~ /Fri/
puts “Friday”
end
I found in the internet that following codes works:
timetoday = ” ”
timetoday = Time.now.to_s()
if timetoday =~ /Fri/
puts “Friday”
end
June 10th, 2009 | Posted in ruby | No Comments
When debugging the scripts of the watir application, there may be a need to flash an element, following is the code:
ie.element_by_xpath(” “).flash
May 7th, 2009 | Posted in watir | No Comments
When I tried to use hpricot, I found some error like “safariwatir missingsourcefile” from the beginning.
and it is said in the internet that I should remove include Watir from the script.
after I removed the “include Watir”, I got another error message like “uninitilezed constant IE “, and the internet tells me I should use Watir::IE.start() instead of IE.start(), should use Watir::IE.attach() instead of IE.attach()
May 7th, 2009 | Posted in watir | No Comments
I encountered the error of Unknown OLE server: `AutoItX3.Control’ , following is the solotion:
navigate to the folder of \ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\lib\watir, and type regsvr32 AutoItX3.dll
April 19th, 2009 | Posted in watir | No Comments
we can login to a drupal site by http://www.example.com/?q=user when the login block has been hidden.
April 19th, 2009 | Posted in drupal | No Comments
I faced a weird problem.
I can start a test job test.rb by WindowsXP task scheduler, but cannot initiate the test job by Windows Vista task scheduler, the test.rb can be run by double click on Windows Vista Explorer.
I encoutered a solution for this when I almost went to install windows xp on my computer, just Disable User Access Control on the Control Panel of Vista, and everything is ok.
April 17th, 2009 | Posted in watir | Comments Off
we can login to a drupal site by http://www.example.com/?q=user when the login block has been hidden.
March 25th, 2009 | Posted in wordpress | Comments Off
I encountered a error 14001 when I tried to install watir 1.6.2 in a new computor, I googled and found:
the version of win32-api should be 1.3.0 or later
the version of windows-api should be 0.3.0 or later
the version of windows-pr should be 0.9.9 or later
After fix the above version problems, the watir can work properly.
March 17th, 2009 | Posted in ruby, watir | Comments Off
I had hosted some of my websites on Lunarpages for about 2 years, their sevice were good previously but not good any more resently.
I had moved 2/3 of my website out of Lunarpages, their response to the tickets become too slow, I wait almost 5 hours for the initial response said my question will be forwarded to technical support staff and wait another day to get another response.
Now I have only several wordpress blogs left, and they complained the usage too high, I told them that all my blogs are not active, and they said maybe malacious script exits on my site and no willing to examine the scripts.
Their limit for usage is 1% CPU usage, 1% Memory usage, 0.2 SQL usage and 20% Top Process, and I guess them put my hosting in a evaluation server for almost one year.

November 23rd, 2008 | Posted in other software | No Comments
Bellow is the code to refresh a browser using watir:
ie77.refresh
Related Blogs
November 1st, 2008 | Posted in watir | No Comments