Rotate google adsense ads colors to reduce ad blindness

October 21st, 2009 1 comment

There is a tendency for regular visitors to your site to ignore adsense ads, this occurs when the ads is in same selected color palette and in the same location.

To prevent regular users from ad blindness, you can officially rotate upto 4 different types of color palettes for your adsense ads.

When you are selecting the color scheme for the adsense ads, just select multiple color schemes.

Now you will see 4 selected schemes beside each other and will also be incorporated in the adsense code. This color coding will now be changed automatically whenever the page is reloaded.

pay attention to attach the IE window when elements not found by watir

October 11th, 2009 No comments

Several times I spend several hours to identify an element, the element is there, but watir can not find it.

I click a link and a new IE window comes up, and forget to attach the new IE window, so watir and me are looking for elements on different windows.

Categories: watir Tags: ,

The ruby code to find which weekday is current day

June 10th, 2009 No comments

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

Categories: ruby Tags:

flash an element in watir

May 7th, 2009 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

Categories: watir Tags:

safariwatir missingsourcefile & uninitilezed constant IE

May 7th, 2009 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()

Waitr Unknown OLE server

April 19th, 2009 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

Categories: watir Tags: