Using Selenium IDE Firefox plugin, I want to take automated screenshots. The test script contains these steps
Command Target Value
open /?gfe_rd=cr&ei=GNCWU-6BCujV8geh_4C4Bg&gws_rd=ssl
click id=gbqfq
type id=gbqfq software testing
click id=gbqfb
captureEntirePageScreenshotAndWait F:\Screenshots\
The log shown this error:-
[error] Unexpected Exception: [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIFileOutputStream.init]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 2986" data: no]. toString -> function toString() { [native code] }, message -> Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIFileOutputStream.init], result -> 2152857621, name -> NS_ERROR_FILE_ACCESS_DENIED, filename -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -> 2986, columnNumber -> 0, inner -> null, data -> null, location -> JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 2986
please resolve this error
There is a Screenshot on Failure plugin. It grabs a screenshot of the HTML at the point of failure as per it's name. Here is the link:
https://addons.mozilla.org/en-US/firefox/addon/screenshot-on-fail-selenium/
This plugin integrates directly with Selenium so you can turn it on or off through the UI itself. To install it, open the link with a FIREFOX browser and click the "ADD TO FIREFOX" link. (For those not familiar with the Selenium IDE, it only plugs into Firefox.)
Once installed properly you will see a Screenshot on Fail icon next to the "FAST - SLOW" slider. Toggling this button on turns on the feature, toggling it off means that snapshots won't be taken. By default it is off when the IDE is launched. The tiny down-arrow next to it allows you to view the screen shot / failure report(s).
Related
I'm trying to browse multiple files (one after the other ) using the keyword "Choose File" for the attached screen.
The circled in red are the web elements through which files are to be browsed ( top right ).
The page code is highlighted in red.
The xpath circled in black ( bottom left ) , which when searched, highlights both the web elements one after another which browse the file.
Below are my steps:
Scroll Element Into View xpath=//span[contains(#class,'filebrowse .click')]
Wait Until Element is visible xpath=//span[contains(#class,'filebrowse .click')]
Set Focus To Element xpath=//span[contains(#class,'filebrowse .click')]
Choose File xpath=//span[contains(#class,'filebrowse .click')] ${file_path}
I got the error below for the step above - "Choose File" :
WebDriverException: Message: unknown error: cannot focus element
(Session info: chrome=71.0.3578.98)
(Driver info: chromedriver=2.45.615291
(ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 10.0.10586 x86_64)
I used the below code and worked fine.
Libraries Used :
Library pyautogui
Library ImageHorizonLibrary
Code sample :
Scroll Element Into View xpath=//div[1]/div[5]/a/span
Wait Until Element is visible xpath=//div[1]/div[5]/a/span
Set Focus To Element xpath=//div[1]/div[5]/a/span
Click Element xpath=//div[1]/div[5]/a/span
Sleep 5s
pyautogui.Typewrite file_name.jpg
pyautogui.Key Down 'enter'
ImageHorizonLibrary.Press Combination Key.enter
Sleep 15s
For this I had to keep the file "file_name.jpg" in a default browse folder.
Identified the default folder through a sample code run.
I need to disable the Accurancy check only on every execution plan configured.
The others check (Performance, Availability Errors, Execution Errors) must be active.
Could anyone help me?
Regards,
Ema
Below my solution
Guide: https://community.microfocus.com/borland/tm_art/w/knowledge_base/22848/classifying-tm-art-workbench-script-runtime-error-as-availability-or-accuracy-error-in-tm-art-central
Steps:
open file .ltz with Silk Performer
Settings -> Active Profile -> Replay -> Simulation -> Errors tab
Click the Add... button.
Select a module and a severity and the list of predefined error codes will appear in the table.
For example, select "BMC TM ART - HTTP" as module and "error" as Severity. In the list of error codes, you will find the code "500" and its error description "internal server error". Below is a screenshot of some error codes for the WinSock module.
Select the new severity
Save and reload file .ltz
I am using TestComplete 11 with JScript code in the scripts - no keyword tests.
I am getting a cross reference error that is incorrect. I checked all the USEUNIT declarations of the referenced units and they do NOT reference each other, yet I am all of the sudden getting this error.
EX:
Unit DataCheck:
//USEUNIT Button
//USEUNIT Lots of other Units
Unit Button
//USEUNIT Input
//USEUNIT Map
//USEUNIT Utilities
ERROR:
Syntax error(s)
The units Button and DataCheck refer to each other.
Cross references are not allowed in JScript units.
Error locationL
Unit: "Button"
Line 4 Column: 1
Ummm.....line 4 has NO DATA! SIGROWL
Remove Utilities from Button and no error, but then a function essential to Button can't be accessed.
Any ideas??
This means that the Utilities unit references the DataCheck unit:
Utilities -> DataCheck -> Button -> Utilities
It is also possible that there are more units in this chain:
Utilities -> [Mysterious Unit A] -> [Mysterious Unit B] -> DataCheck -> Button -> Utilities
Check the entire reference chain.
Also, you can consider using Script Extensions for library code.
Pure Data has a loadbang component, which does what it says: sends one bang when the graph starts running. NoFlo's core/Kick doesn't send its data until its IN input is hit, and you can't save a bang IIP in noflo-ui.
core/Repeat with an IIP (any string) on the IN port will do what you're looking for. Here is a browser example that shows a popup alert when the network starts:
loadbang(core/Repeat) OUT -> IN alert(core/MakeFunction)
'alert("hi");' -> FUNCTION alert
':-)' -> IN loadbang
Related discussion: https://github.com/noflo/noflo-ui/issues/97
Selenium Select Window command fails and shows "Could not find window with title....". but if i Execute the Select Window command alone it passes the case and verifying the elements.
Code i used:
public void testDefaultlogo() throws Exception {
selenium.open("http://Sitename/samp.aspx");
selenium.type("ctl00_mainContentPlaceHolder_txt_LoginName", "uname");
selenium.type("ctl00_mainContentPlaceHolder_txt_Password", "pwd#12");
selenium.click("ctl00_mainContentPlaceHolder_btn_login");
selenium.waitForPageToLoad("60000");
selenium.click("ctl00_defaultLogo");
selenium.selectWindow("Sample~Window-ID");
verifyEquals("http://Sitename/index.html", selenium.getLocation());
selenium.close();
selenium.selectWindow ("null");
verifyTrue(selenium.isElementPresent("ctl00_defaultLogo"));
I mean by clicking one by one of the follwing commands in Selenium IDE it shows green but if i run the case it failed and shows as i mentioned above
What I can get from your code is that, clicking the "ctl00_defaultLogo" will popup another window. The possible issue could be that after write the command selenium.click("ctl00_defaultLogo") you need to wait for the popup to load.
The possible resolution, insert the command
selenium.WaitForPopUp("Sample~Window-ID", "5000");
before the
selenium.selectWindow("Sample~Window-ID");
This will cause selenium to wait for 5 secs before selecting the popup window.
Hope this helps!!!
some times it may not work for that u better use.
open_window("URL","WindowID or title or name");
selenium.selectWindow("WindowID or title or name");