sayems / csharp.webdriver Goto Github PK
View Code? Open in Web Editor NEWBrowser test automation using Selenium WebDriver in C#
License: GNU General Public License v3.0
Browser test automation using Selenium WebDriver in C#
License: GNU General Public License v3.0
Hi Sayem,
I am newbie in framework designing, Your framework seems great .
I was trying to use it, but i am getting error while executing DriverScript class
Error "
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at test.java.com.totsy.test.DriverScript.createXLSReport(DriverScript.java:183)
at test.java.com.totsy.test.DriverScript.start(DriverScript.java:105)
at test.java.com.totsy.test.DriverScript.main(DriverScript.java:59)
One more thing till that steps Browser does not gets initiated.
It will be great help if you provide some guidance.
Thanks
Vikas Singh
Compete Logs:
Mozilla
2015-01-13 11:05:10 DEBUG devpinoyLogger:66 - Hello
2015-01-13 11:05:10 DEBUG devpinoyLogger:67 - Properties loaded. Starting testing
2015-01-13 11:05:10 DEBUG devpinoyLogger:73 - Intialize Suite xlsx
2015-01-13 11:05:11 DEBUG devpinoyLogger:79 - Check out -- Y
2015-01-13 11:05:11 DEBUG devpinoyLogger:84 - ***_Executing the Suite_***Check out
2015-01-13 11:05:11 DEBUG devpinoyLogger:88 - ShoppingCart -- Y
2015-01-13 11:05:11 DEBUG devpinoyLogger:92 - Executing the test case -> ShoppingCart
2015-01-13 11:05:11 DEBUG devpinoyLogger:98 - Iteration number 1
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Opening browser
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Navigating to URL
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Writing in text box
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Writing in text box
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Clicking on Button
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Selecting Random event
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Selecting Random Product
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Selecting Random Size
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Clearing input text box
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Writing in text box
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Clicking on Button
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - Clicking on Button
2015-01-13 11:05:11 DEBUG devpinoyLogger:139 - pause
2015-01-13 11:05:21 DEBUG devpinoyLogger:147 - PASS
2015-01-13 11:05:21 DEBUG devpinoyLogger:139 - Closing the browser
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at test.java.com.totsy.test.DriverScript.createXLSReport(DriverScript.java:183)
at test.java.com.totsy.test.DriverScript.start(DriverScript.java:105)
at test.java.com.totsy.test.DriverScript.main(DriverScript.java:59)
Tried to open the Project, but the project files are not getting loaded. Could you please have a look
Hi,
I cannot get/download your project to my pc.
Please recheck and help me
Thanks,
Regards,
To send the data to the text box i used col|data(user) it is executing fine but it is not able to past the data in the text boxes. and i am getting all the PASS results only. Please help me out
Hi,
I have downloaded the script and automated my couple of testscenarios using that. now i want to plugin that in CI. Could you please help me how to do that ?
Currently I am invoking DriverScript.java file from eclipse and that intern invoke my keywords.
Since testng/junit is not used in the DriverScript.java file, test ran by invoking DriverScript.java file are not creating any html report which i can publish and integrate with Jenkins.
My requirement is
the pause script when you do a download the new version of chrome
Hi,
i have downloaded your Hybrid-Framewok where I am getting below error on import statement.
"The import com.totsy.xls.read.Xls_Reader cannot be resolved"
Class read does not exist at all and so Xls_Reader is not ..
Please help asap.
Thanks
Initially tried using action library methods as following but it didn't work
Actions builder = new Actions(driver);
builder.DragAndDrop(students[i], target[1]).Build().Perform();
tried using MovetoAnElement, MovetoOffset but no luck
then tried using a JS file found on net
(function( $ ) {
$.fn.simulateDragDrop = function(options) {
return this.each(function() {
new $.simulateDragDrop(this, options);
});
};
$.simulateDragDrop = function(elem, options) {
this.options = options;
this.simulateEvent(elem, options);
};
simulateEvent: function(elem, options) {
/Simulating drag start/
var type = 'dragstart';
var event = this.createEvent(type);
this.dispatchEvent(elem, type, event);
/*Simulating drop*/
type = 'drop';
var dropEvent = this.createEvent(type, {});
dropEvent.dataTransfer = event.dataTransfer;
this.dispatchEvent($(options.dropTarget)[0], type, dropEvent);
/*Simulating drag end*/
type = 'dragend';
var dragEndEvent = this.createEvent(type, {});
dragEndEvent.dataTransfer = event.dataTransfer;
this.dispatchEvent(elem, type, dragEndEvent);
},
createEvent: function(type) {
var event = document.createEvent("CustomEvent");
event.initCustomEvent(type, true, true, null);
event.dataTransfer = {
data: {
},
setData: function(type, val){
this.data[type] = val;
},
getData: function(type){
return this.data[type];
}
};
return event;
},
dispatchEvent: function(elem, type, event) {
if(elem.dispatchEvent) {
elem.dispatchEvent(event);
}else if( elem.fireEvent ) {
elem.fireEvent("on"+type, event);
}
}
});
})(jQuery);
and used it as following
public static void DragAndDrop(string source, IWebDriver driver)
{
string current = Environment.CurrentDirectory;
string filepath = Path.GetFullPath(Path.Combine(current, @"....\EducatorUtilities"));
string fullpath = Path.GetFullPath(Path.Combine(filepath, @"DragandDrop.js"));
var dragItem = File.ReadAllText(fullpath);
IJavaScriptExecutor exe = driver as IJavaScriptExecutor;
exe.ExecuteScript(dragItem + source);
}
DragAndDrop("$('ul.learners li:nth-child(1)').simulateDragDrop({droptarget:'ed-group-edit.ng-isolate-scope div:nth-child(1)'});",driver);
DOM of source element is
Could someone please help to get this draganddrop working?
Any help is highly appreciated.
Thanks in advance!!!
while running the code i am getting the following errors i tried so many ways by googling still not able to resolve.please give me a solution.
log4j:WARN No appenders could be found for logger (devpinoyLogger).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at varun.Test.DriverScript.executeKeywords(DriverScript.java:151)
at varun.Test.DriverScript.start(DriverScript.java:107)
at varun.Test.DriverScript.main(DriverScript.java:63)
Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:205)
at org.openqa.selenium.firefox.internal.FileExtension.readIdFromInstallRdf(FileExtension.java:98)
at org.openqa.selenium.firefox.internal.FileExtension.writeTo(FileExtension.java:61)
at org.openqa.selenium.firefox.internal.ClasspathExtension.writeTo(ClasspathExtension.java:64)
at org.openqa.selenium.firefox.FirefoxProfile.installExtensions(FirefoxProfile.java:441)
at org.openqa.selenium.firefox.FirefoxProfile.layoutOnDisk(FirefoxProfile.java:419)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:95)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:276)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:116)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:221)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:216)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:212)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:125)
at varun.Test.Keywords.openBrowser(Keywords.java:42)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 42 more
Receiving java.lang.reflect.InvocationTargetException
exception in line
driver=new FirefoxDriver();
in Keywords.java
file
Even after creating a separate profile for firefox doesn't fix the issue.
String profilePath="/Users/username/Library/Application Support/Firefox/Profiles/vnn479sh.Default User";
FirefoxProfile firefoxprofile = new FirefoxProfile(new File(profilePath));
driver=new FirefoxDriver(firefoxprofile);
Hi,
i have downloaded your Hybrid-Framewok where I am getting below error on import statement.
"The import com.totsy.xls.read.Xls_Reader cannot be resolved"
Class read does not exist at all and so Xls_Reader is not ..
Please help asap.
Thanks
C:/Selenium/Aug18/KDF/Results_TS
C:/Selenium/Aug18/KDF/Results_TC
C:/Selenium/Aug18/KDF/Automation Plan 1.1.xls
C:/Selenium/Jul5/HF/Automation Plan.xls
C:/Selenium/Jul5/HF/Result/TC_Res_
C:/Selenium/Jul5/HF/Result/TS_Res_
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.