Read in data from a file and replace the text using /replacetext./
urlfile= “C:\\printservers\\printurls.txt”
i=1
servermax = 4
File.open(urlfile, ‘r’) do |f1|
while line = f1.gets
result = {}
server,product1,durl,product2,lurl,product3,curl,product4,murl,product5,surl,product6,mpurl=
line.split(”,”)
while i <= servermax
server1 = server.gsub!(/print01-0./, “print01-0″+ “#{i}”)
f.puts “1. First verify server is up #{server1}”
$ie.goto(server1)
i= i+1
end
end
end
An example to grab the first image loaded on a page and return the width and height.
$ie.goto(url)
width = $ie.image(:index,1).width
widthnum = Integer(width) #Convert to integer. #
if widthnum >50
f.puts “- SUCCESS: Width of image loaded: #{widthnum}”
else
f.puts “!!!!! WARNING: Did not find width for image on page !!!!!”
end
height = $ie.image(:index,1).height
heightnum = Integer(height) #Convert string to integer. #
if heightnum > 50 #height != nil (pixel version) #
f.puts “- SUCCESS: Height of image loaded: #{heightnum}”
else
f.puts “!!!!! WARNING: Did not find height for image on page !!!!!”
end
Testing a site that contains values that target certain users or simply trying to figure out which is the best approach via A/B tests? To modify your browser cookies, there are some simple tools to make this happen.
Firefox
1. Install Firebug 1.2.X:
- Go to the web page you wish to view or set cookie
- Go to Firefox -> Tools Menu-> Open Firebug
- Inspect -> Cookies
- Right click to Edit
2. Another option is to install the add-on Web Developer for Firefox.
- Firefox -> Tools->Web Developer -> Cookies -> View cookies
- Edit cookie
- Go to page again
- Tools -> Web Developer -> Cookies -> View cookies
- You can also delete and refresh cookies
Firefox Web Developer
Internet Explorer
- Go to the web page you wish to view/set cookie
- Install the little program called IECookiesView
- Double-click to execute program
- In the upper pane of the program, click on the name of the website
- In the lower pane of the program, click on the name of the cookie you wish to edit.
- Right-click on the cookie name and choose option to edit
- Close IECookiesView and restart browser
- Navigate to the web page again
View IE Cookies
The only open source web platform you need to know. LAMP stands for Linux, Apache, MySQL, and Perl, Python, or PHP technologies.
LAMP is an open-source Web development platform, also called a Web stack, that uses Linux as the operating system, Apache as the Web server, MySQL as the database management system, and PHP as the object-oriented scripting language. Perl or Python can be substituted for PHP.