I am new to Watir-Webdriver. I have written a function to take the screenshot and it works fine. My problem is I need to call the method, upon any error/exception or fail happening during my testcase execution. I have googled it and couldn't find anything related. I have tried rescue block but it doesn't work for me. Any help is appreciated.
Thanks,
Alex
Alister Scott has this about getting screenshots on WatirMelon when using cucumber:
After do |scenario|
if scenario.failed?
Dir::mkdir('screenshots') if not File.directory?('screenshots')
screenshot = "./screenshots/FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}.png"
Browser::BROWSER.driver.save_screenshot(screenshot)
embed screenshot, 'image/png'
end
end
Related
I am facing an issue in Google API regarding charts.apis.google.com
and
Failed to load resource: the server responded with a status of 502 ()
GET https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=15|acb7bf|FFFFFF 502
Due to this, my location markers are not showing up on the map.
On my live site clients are facing this issue.
I do not know what is the exact issue. Payments are clear, everything is ok.
Please suggest a quick solution for this.
I read 1 post on the google forum.
https://groups.google.com/forum/#!topic/google-visualization-api/1xT15iybzQ4
Please help me out with this issue.
Much appreciated.
Or any alternative solution.
Thanks
I had this same issue. I was using something like this below to set an different colored image for the Marker.
var pinImage = new google.maps.MarkerImage("http://www.googlemapsmarkers.com/v1/•/" + "d3d3d3" + "/");
This was reliant on googlemapsmarkers.com and is no longer working. As soon as I do not use this site to help with the MarkerImage then all is fine
Looks like this has been deprecated
https://developers.google.com/chart/image/docs/gallery/dynamic_icons
Please note that this issue has been recognized in the Issue Tracker via Issue #128905669, there is also an alternative solution offered by one of the support from Google which is to use https://www.image-charts.com/
I am using Knockout.js, and the most important part of the error message is (nowadays) often hidden under the <omitted> part. I tried hovering over, and clicking a lot of stuff, but I can't find a way to see the full message. Does anyone have a tip?
Thanks in advance!
PS: I'm looking for a fix within the Chrome settings. So without cluttering my code with extra window.onerror stuff or otherwise. I don't want to clutter my code just because the Chrome development team thought it was a good idea to omit debug text :S
For a code hack, see this answer: https://stackoverflow.com/a/22218280/647845
Here's a little bit of code that will output the whole error message:
window.onerror = function (errorMsg, url, lineNumber, columnNumber, errorObject) {
if (errorObject && /<omitted>/.test(errorMsg)) {
console.error('Full exception message: ' + errorObject.message);
}
}
You can execute this in the development console in Chrome, so it doesn't have to be in the actual code of your web page.
Use Firefox. And vote up for this issue in the meantime:
https://code.google.com/p/chromium/issues/detail?id=331971
I would like to show POP UP with message when my test runs successful. Pls suggest sikuli script for this.
As #autoKarma suggested, you can easily use the popup() function. I have been working with sikuli quite a while. You can see this simple code below.
popup("Display your message here")
That's it. This simple code would serve your purpose.
Goodluck
Have you tried using the popup() function? It is documented here. I don't know anything about sikuli's interaction with webdriver, so take it for whatever its worth.
variable = input("message", "default", "titleOfPopup")
I have some code to try to create a single PDF document but i can't do it.
code :
<%# language="vbscript"%>
<!--#include file="fpdf.asp"-->
<%
if Request.form("test") <> "" Then
Set pdf=CreateJsObject("FPDF")
pdf.CreatePDF()
pdf.SetPath("fpdf/")
pdf.SetFont "Arial","",16
pdf.Open()
pdf.AddPage()
pdf.Cell 40,10,"Hello Word!"
pdf.Close()
pdf.Output("list.pdf","T")
End If
%>
So, (dont mind with the request.form for execute..lol)
when i click the button i get :
"FPDF error: Unable to create output file: list.pdf"
I've tried some sites for help and done alot of things and searched here on stack and found some useful things but nothing directed to this ...
Any help would be appreciated ! I can try to answer any questions you may have about the code or something else.
Also, if you have another solution for creating PDF's with classic ASP, please lemme know (free or very low price)
Thanks for your attention !
I've specified the path of Output to a VIRTUAL location and it Works great !
Thanks Every one for your help !
Best Regards
Hello friends my code is too big u can download here zip file http://www.filefactory.com/file/6bvfmmx3zpet/n/New_folder_4_rar
i have downloded this code from internet .. this is working fine the problem is when this code get end then the web page jump to a URL i tried to put
getURL("http://www.adobe.com","_self");
but its not working may be i m not aware where to put this code .... plz help me
EDIT
you can read my code here .. jsfiddle.net/uM9zr
Thanks in advance
I cannot tell from your question whether you as using AS2 or AS3 as you mention both, but getURL is not supported in AS3:
ActionScript 3 - What happened to GetURL?
Try replacing "_self" with "_blank". This will open the link in a new tab, but should solve your problem of the URL not opening.
Also Mitch should read the title. AS2 was a quite obvious part of your question.