List of usage examples for org.openqa.selenium By cssSelector
public static By cssSelector(String cssSelector)
From source file:com.crawljax.plugins.testilizer.generated.claroline_EXND.GeneratedTestCase11.java
public void checkState156_GeneratedAssertions() { element = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("class=\"claroDialogBox boxSuccess\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("style=\"padding-left:1em;padding-right:1em;\""))); childrenElements.clear();//from w w w .jav a2s .c o m childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("class=\"claroDialogMsg msgSuccess\"")))); childrenElements.add(new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("")))); // if(!(isElementRegionFullPresent(parentElement , element, childrenElements))){System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return;} // generated assertion in case of AEP for Original if (!(isElementPresent( By.cssSelector("div.claroDialogBox.boxSuccess[class=\"claroDialogBox boxSuccess\"]")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of ElementTagAttMatch if (!(isElementPresent(By.cssSelector("div.toolTitleBlock[class=\"toolTitleBlock\"]")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of ElementTagAttMatch if (!(isElementPresent(By.id("claroBody")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of ElementTagAttMatch element = new DOMElement("FORM", "", new ArrayList<String>(Arrays.asList( "action=\"/claroline-1.11.7/claroline/admin/tool/config_edit.php?config_code=CLWRK\"", "method=\"post\"", "name=\"editConfClass\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"claroBody\""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>( Arrays.asList("name=\"config_code\"", "type=\"hidden\"", "value=\"CLWRK\"")))); childrenElements.add(new DOMElement("INPUT", "", new ArrayList<String>(Arrays.asList("name=\"section\"", "type=\"hidden\"", "value=\"main\"")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("name=\"cmd\"", "type=\"hidden\"", "value=\"save\"")))); childrenElements.add(new DOMElement("INPUT", "", new ArrayList<String>(Arrays.asList("border=\"0\"", "cellpadding=\"5\"", "width=\"100%\"")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("INPUT", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("TABLE", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of RegionTagMatch }
From source file:com.crawljax.plugins.testilizer.generated.claroline_EXND.GeneratedTestCase11.java
public void checkState156_AllAssertions() { if (!(driver.findElement(By.cssSelector("div.claroDialogBox.boxSuccess")).getText() .matches("^[\\s\\S]*Properties for Wiki, \\(CLWIKI\\) are now effective on server\\.[\\s\\S]*$"))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return;/*from w w w . j a v a 2 s.c o m*/ } // original assertion element = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("class=\"claroDialogBox boxSuccess\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("style=\"padding-left:1em;padding-right:1em;\""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("class=\"claroDialogMsg msgSuccess\"")))); childrenElements.add(new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("")))); // if(!(isElementRegionFullPresent(parentElement , element, childrenElements))){System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return;} // generated assertion in case of AEP for Original element = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"campusFooter\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"claroPage\""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements .add(new DOMElement("HR", "", new ArrayList<String>(Arrays.asList("id=\"campusFooterLeft\"")))); childrenElements .add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("id=\"campusFooterRight\"")))); childrenElements .add(new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"campusFooterCenter\"")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("DIV", "AdministratorforClaroline:mmnainyPhone:7788814476", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add( new DOMElement("DIV", "PoweredbyClaroline2001-2013", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagAttPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // predicted region assertion element = new DOMElement("DIV", "Claroline", new ArrayList<String>(Arrays.asList("id=\"platformBanner\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"topBanner\""))); childrenElements.clear(); childrenElements .add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("id=\"campusBannerLeft\"")))); childrenElements.add(new DOMElement("DIV", "Claroline", new ArrayList<String>(Arrays.asList("id=\"campusBannerRight\"")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("class=\"spacer\"")))); childrenElements.add(new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagAttPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // predicted region assertion element = new DOMElement("TABLE", "", new ArrayList<String>(Arrays.asList("border=\"0\"", "cellpadding=\"5\"", "width=\"100%\""))); parentElement = new DOMElement("FORM", "", new ArrayList<String>(Arrays.asList( "action=\"/claroline-1.11.7/claroline/admin/module/module.php?config_code=CLWIKI&module_id=11&item=LOCAL\"", "method=\"post\"", "name=\"editConfClass\""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("TBODY", "", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagAttPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // predicted region assertion }
From source file:com.crawljax.plugins.testilizer.generated.claroline_EXND.GeneratedTestCase11.java
public void checkState160_GeneratedAssertions() { element = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"claroBody\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"claroPage\""))); childrenElements.clear();//w w w . j a v a 2s.com childrenElements .add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("class=\"toolTitleBlock\"")))); childrenElements.add(new DOMElement("#comment", "Pagecontent", new ArrayList<String>(Arrays.asList("")))); childrenElements .add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("class=\"toolTitleBlock\"")))); childrenElements.add(new DOMElement("DIV", "Modulesettings:Coursedescription", new ArrayList<String>(Arrays.asList("")))); childrenElements .add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("class=\"toolTitleBlock\"")))); childrenElements.add(new DOMElement("DIV", "GlobalsettingsLocalsettingsAbout", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("class=\"spacer\"")))); childrenElements.add(new DOMElement("DIV", "Description", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("P", "Nodescription", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements .add(new DOMElement("DIV", "GeneralInformations", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("TABLE", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements .add(new DOMElement("#comment", "EndofPageContent", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagAttPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of RegionTagAttMatch if (!(isElementPresent(By.cssSelector("div.toolTitleBlock[class=\"toolTitleBlock\"]")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of ElementTagAttMatch if (!(isElementPresent(By.id("claroBody")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of ElementTagAttMatch }
From source file:com.crawljax.plugins.testilizer.generated.claroline_EXND.GeneratedTestCase12.java
@Test public void method12() { driver.get(url);/* www . ja v a 2 s. com*/ //From state 0 to state 1 //Eventable{eventType=click, identification=cssSelector button[type="submit"], element=Element{node=[BUTTON: null], tag=BUTTON, text=Enter, attributes={tabindex=3, type=submit}}, source=StateVertexImpl{id=0, name=index}, target=StateVertexImpl{id=1, name=state1}} mutateDOMTree(0); checkState0_OriginalAssertions(); checkState0_ReusedAssertions(); checkState0_GeneratedAssertions(); checkState0_LearnedAssertions(); checkState0_AllAssertions(); checkState0_RandAssertions1(); checkState0_RandAssertions2(); checkState0_RandAssertions3(); checkState0_RandAssertions4(); checkState0_RandAssertions5(); driver.findElement(By.id("login")).clear(); driver.findElement(By.id("login")).sendKeys("nainy"); driver.findElement(By.id("password")).clear(); driver.findElement(By.id("password")).sendKeys("nainy"); driver.findElement(By.cssSelector("button[type=\"submit\"]")).click(); //From state 1 to state 2 //Eventable{eventType=click, identification=text Platform administration, element=Element{node=[A: null], tag=A, text=Platform administration, attributes={href=/claroline-1.11.7/claroline/admin/, target=_top}}, source=StateVertexImpl{id=1, name=state1}, target=StateVertexImpl{id=2, name=state2}} mutateDOMTree(1); checkState1_OriginalAssertions(); checkState1_ReusedAssertions(); checkState1_GeneratedAssertions(); checkState1_LearnedAssertions(); checkState1_AllAssertions(); checkState1_RandAssertions1(); checkState1_RandAssertions2(); checkState1_RandAssertions3(); checkState1_RandAssertions4(); checkState1_RandAssertions5(); driver.findElement(By.linkText("Platform administration")).click(); //From state 2 to state 107 //Eventable{eventType=click, identification=text Modules, element=Element{node=[A: null], tag=A, text=Modules, attributes={href=module/module_list.php}}, source=StateVertexImpl{id=2, name=state2}, target=StateVertexImpl{id=107, name=state107}} mutateDOMTree(2); checkState2_OriginalAssertions(); checkState2_ReusedAssertions(); checkState2_GeneratedAssertions(); checkState2_LearnedAssertions(); checkState2_AllAssertions(); checkState2_RandAssertions1(); checkState2_RandAssertions2(); checkState2_RandAssertions3(); checkState2_RandAssertions4(); checkState2_RandAssertions5(); driver.findElement(By.linkText("Modules")).click(); //From state 107 to state 108 //Eventable{eventType=click, identification=cssSelector img[alt="Properties"], element=Element{node=[IMG: null], tag=IMG, text=, attributes={alt=Properties, src=/claroline-1.11.7/web/img/settings.png?1232379976}}, source=StateVertexImpl{id=107, name=state107}, target=StateVertexImpl{id=108, name=state108}} mutateDOMTree(107); checkState107_OriginalAssertions(); checkState107_ReusedAssertions(); checkState107_GeneratedAssertions(); checkState107_LearnedAssertions(); checkState107_AllAssertions(); checkState107_RandAssertions1(); checkState107_RandAssertions2(); checkState107_RandAssertions3(); checkState107_RandAssertions4(); checkState107_RandAssertions5(); driver.findElement(By.cssSelector("img[alt=\"Properties\"]")).click(); //From state 108 to state 151 //Eventable{eventType=click, identification=text Local settings, element=Element{node=[A: null], tag=A, text=Local settings, attributes={href=module.php?module_id=11&item=LOCAL}}, source=StateVertexImpl{id=108, name=state108}, target=StateVertexImpl{id=151, name=state151}} mutateDOMTree(108); checkState108_OriginalAssertions(); checkState108_ReusedAssertions(); checkState108_GeneratedAssertions(); checkState108_LearnedAssertions(); checkState108_AllAssertions(); checkState108_RandAssertions1(); checkState108_RandAssertions2(); checkState108_RandAssertions3(); checkState108_RandAssertions4(); checkState108_RandAssertions5(); driver.findElement(By.linkText("Local settings")).click(); //From state 151 to state 156 //Eventable{eventType=click, identification=cssSelector input[type="submit"], element=Element{node=[INPUT: null], tag=INPUT, text=, attributes={type=submit, value=Ok}}, source=StateVertexImpl{id=151, name=state151}, target=StateVertexImpl{id=156, name=state156}} mutateDOMTree(151); checkState151_OriginalAssertions(); checkState151_ReusedAssertions(); checkState151_GeneratedAssertions(); checkState151_LearnedAssertions(); checkState151_AllAssertions(); checkState151_RandAssertions1(); checkState151_RandAssertions2(); checkState151_RandAssertions3(); checkState151_RandAssertions4(); checkState151_RandAssertions5(); driver.findElement(By.cssSelector("input[type=\"submit\"]")).click(); //From state 156 to state 160 //Eventable{eventType=click, identification=text About, element=Element{node=[A: null], tag=A, text=About, attributes={href=module.php?module_id=11&item=About}}, source=StateVertexImpl{id=156, name=state156}, target=StateVertexImpl{id=160, name=state160}} mutateDOMTree(156); checkState156_OriginalAssertions(); checkState156_ReusedAssertions(); checkState156_GeneratedAssertions(); checkState156_LearnedAssertions(); checkState156_AllAssertions(); checkState156_RandAssertions1(); checkState156_RandAssertions2(); checkState156_RandAssertions3(); checkState156_RandAssertions4(); checkState156_RandAssertions5(); driver.findElement(By.linkText("About")).click(); //From state 160 to state 87 //Eventable{eventType=click, identification=text Logout, element=Element{node=[A: null], tag=A, text=Logout, attributes={href=/claroline-1.11.7/index.php?logout=true, target=_top}}, source=StateVertexImpl{id=160, name=state160}, target=StateVertexImpl{id=87, name=state87}} mutateDOMTree(160); checkState160_OriginalAssertions(); checkState160_ReusedAssertions(); checkState160_GeneratedAssertions(); checkState160_LearnedAssertions(); checkState160_AllAssertions(); checkState160_RandAssertions1(); checkState160_RandAssertions2(); checkState160_RandAssertions3(); checkState160_RandAssertions4(); checkState160_RandAssertions5(); driver.findElement(By.linkText("Logout")).click(); //Sink node at state 87 mutateDOMTree(87); checkState87_OriginalAssertions(); checkState87_ReusedAssertions(); checkState87_GeneratedAssertions(); checkState87_LearnedAssertions(); checkState87_AllAssertions(); checkState87_RandAssertions1(); checkState87_RandAssertions2(); checkState87_RandAssertions3(); checkState87_RandAssertions4(); checkState87_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.claroline_EXND.GeneratedTestCase19.java
@Test public void method19() { driver.get(url);// w w w .j av a2 s . com //From state 0 to state 1 //Eventable{eventType=click, identification=cssSelector button[type="submit"], element=Element{node=[BUTTON: null], tag=BUTTON, text=Enter, attributes={tabindex=3, type=submit}}, source=StateVertexImpl{id=0, name=index}, target=StateVertexImpl{id=1, name=state1}} mutateDOMTree(0); checkState0_OriginalAssertions(); checkState0_ReusedAssertions(); checkState0_GeneratedAssertions(); checkState0_LearnedAssertions(); checkState0_AllAssertions(); checkState0_RandAssertions1(); checkState0_RandAssertions2(); checkState0_RandAssertions3(); checkState0_RandAssertions4(); checkState0_RandAssertions5(); driver.findElement(By.id("login")).clear(); driver.findElement(By.id("login")).sendKeys("nainy"); driver.findElement(By.id("password")).clear(); driver.findElement(By.id("password")).sendKeys("nainy"); driver.findElement(By.cssSelector("button[type=\"submit\"]")).click(); //From state 1 to state 2 //Eventable{eventType=click, identification=text Platform administration, element=Element{node=[A: null], tag=A, text=Platform administration, attributes={href=/claroline-1.11.7/claroline/admin/, target=_top}}, source=StateVertexImpl{id=1, name=state1}, target=StateVertexImpl{id=2, name=state2}} mutateDOMTree(1); checkState1_OriginalAssertions(); checkState1_ReusedAssertions(); checkState1_GeneratedAssertions(); checkState1_LearnedAssertions(); checkState1_AllAssertions(); checkState1_RandAssertions1(); checkState1_RandAssertions2(); checkState1_RandAssertions3(); checkState1_RandAssertions4(); checkState1_RandAssertions5(); driver.findElement(By.linkText("Platform administration")).click(); //From state 2 to state 107 //Eventable{eventType=click, identification=text Modules, element=Element{node=[A: null], tag=A, text=Modules, attributes={href=module/module_list.php}}, source=StateVertexImpl{id=2, name=state2}, target=StateVertexImpl{id=107, name=state107}} mutateDOMTree(2); checkState2_OriginalAssertions(); checkState2_ReusedAssertions(); checkState2_GeneratedAssertions(); checkState2_LearnedAssertions(); checkState2_AllAssertions(); checkState2_RandAssertions1(); checkState2_RandAssertions2(); checkState2_RandAssertions3(); checkState2_RandAssertions4(); checkState2_RandAssertions5(); driver.findElement(By.linkText("Modules")).click(); //From state 107 to state 108 //Eventable{eventType=click, identification=cssSelector .claroTable > tbody:nth-child(2) > tr:nth-child(11) > td:nth-child(6) > a:nth-child(1) > img:nth-child(1), element=Element{node=[IMG: null], tag=IMG, text=, attributes={alt=Properties, src=/claroline-1.11.7/web/img/settings.png?1232379976}}, source=StateVertexImpl{id=107, name=state107}, target=StateVertexImpl{id=108, name=state108}} mutateDOMTree(107); checkState107_OriginalAssertions(); checkState107_ReusedAssertions(); checkState107_GeneratedAssertions(); checkState107_LearnedAssertions(); checkState107_AllAssertions(); checkState107_RandAssertions1(); checkState107_RandAssertions2(); checkState107_RandAssertions3(); checkState107_RandAssertions4(); checkState107_RandAssertions5(); driver.findElement(By.cssSelector( ".claroTable > tbody:nth-child(2) > tr:nth-child(11) > td:nth-child(6) > a:nth-child(1) > img:nth-child(1)")) .click(); //From state 108 to state 151 //Eventable{eventType=click, identification=text Local settings, element=Element{node=[A: null], tag=A, text=Local settings, attributes={href=module.php?module_id=11&item=LOCAL}}, source=StateVertexImpl{id=108, name=state108}, target=StateVertexImpl{id=151, name=state151}} mutateDOMTree(108); checkState108_OriginalAssertions(); checkState108_ReusedAssertions(); checkState108_GeneratedAssertions(); checkState108_LearnedAssertions(); checkState108_AllAssertions(); checkState108_RandAssertions1(); checkState108_RandAssertions2(); checkState108_RandAssertions3(); checkState108_RandAssertions4(); checkState108_RandAssertions5(); driver.findElement(By.linkText("Local settings")).click(); //From state 151 to state 156 //Eventable{eventType=click, identification=cssSelector input[type="submit"], element=Element{node=[INPUT: null], tag=INPUT, text=, attributes={type=submit, value=Ok}}, source=StateVertexImpl{id=151, name=state151}, target=StateVertexImpl{id=156, name=state156}} mutateDOMTree(151); checkState151_OriginalAssertions(); checkState151_ReusedAssertions(); checkState151_GeneratedAssertions(); checkState151_LearnedAssertions(); checkState151_AllAssertions(); checkState151_RandAssertions1(); checkState151_RandAssertions2(); checkState151_RandAssertions3(); checkState151_RandAssertions4(); checkState151_RandAssertions5(); driver.findElement(By.cssSelector("input[type=\"submit\"]")).click(); //From state 156 to state 160 //Eventable{eventType=click, identification=text About, element=Element{node=[A: null], tag=A, text=About, attributes={href=module.php?module_id=11&item=About}}, source=StateVertexImpl{id=156, name=state156}, target=StateVertexImpl{id=160, name=state160}} mutateDOMTree(156); checkState156_OriginalAssertions(); checkState156_ReusedAssertions(); checkState156_GeneratedAssertions(); checkState156_LearnedAssertions(); checkState156_AllAssertions(); checkState156_RandAssertions1(); checkState156_RandAssertions2(); checkState156_RandAssertions3(); checkState156_RandAssertions4(); checkState156_RandAssertions5(); driver.findElement(By.linkText("About")).click(); //Sink node at state 160 mutateDOMTree(160); checkState160_OriginalAssertions(); checkState160_ReusedAssertions(); checkState160_GeneratedAssertions(); checkState160_LearnedAssertions(); checkState160_AllAssertions(); checkState160_RandAssertions1(); checkState160_RandAssertions2(); checkState160_RandAssertions3(); checkState160_RandAssertions4(); checkState160_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase38.java
@Test public void method38() { driver.get(url);//from ww w . j a va 2 s. c o m //From state 0 to state 13 //Eventable{eventType=click, identification=text Admin Page, element=Element{node=[A: null], tag=A, text=Admin Page, attributes={href=admin.php, title=Login to the Administration Region}}, source=StateVertexImpl{id=0, name=index}, target=StateVertexImpl{id=13, name=state13}} mutateDOMTree(0); checkState0_OriginalAssertions(); checkState0_ReusedAssertions(); checkState0_GeneratedAssertions(); checkState0_LearnedAssertions(); checkState0_AllAssertions(); checkState0_RandAssertions1(); checkState0_RandAssertions2(); checkState0_RandAssertions3(); checkState0_RandAssertions4(); checkState0_RandAssertions5(); driver.findElement(By.linkText("Admin Page")).click(); //From state 13 to state 14 //Eventable{eventType=click, identification=cssSelector input.submit, element=Element{node=[INPUT: null], tag=INPUT, text=, attributes={class=submit, type=submit, value=??????Login??????}}, source=StateVertexImpl{id=13, name=state13}, target=StateVertexImpl{id=14, name=state14}} mutateDOMTree(13); checkState13_OriginalAssertions(); checkState13_ReusedAssertions(); checkState13_GeneratedAssertions(); checkState13_LearnedAssertions(); checkState13_AllAssertions(); checkState13_RandAssertions1(); checkState13_RandAssertions2(); checkState13_RandAssertions3(); checkState13_RandAssertions4(); checkState13_RandAssertions5(); driver.findElement(By.id("loginAdminPass")).clear(); driver.findElement(By.id("loginAdminPass")).sendKeys("editor"); driver.findElement(By.cssSelector("input.submit")).click(); //Sink node at state 14 mutateDOMTree(14); checkState14_OriginalAssertions(); checkState14_ReusedAssertions(); checkState14_GeneratedAssertions(); checkState14_LearnedAssertions(); checkState14_AllAssertions(); checkState14_RandAssertions1(); checkState14_RandAssertions2(); checkState14_RandAssertions3(); checkState14_RandAssertions4(); checkState14_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase38.java
public void checkState0_OriginalAssertions() { if (!(isElementPresent(By.cssSelector("div#Granny")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return;/*from ww w. j a v a 2s . co m*/ } // original assertion }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase38.java
public void checkState0_AllAssertions() { if (!(isElementPresent(By.cssSelector("div#Granny")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return;//from ww w . java 2 s . c o m } // original assertion element = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"Granny\""))); parentElement = new DOMElement("CENTER", "", new ArrayList<String>(Arrays.asList(""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("id=\"sidecol\"")))); childrenElements.add(new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("id=\"maincol\"")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); // if(!(isElementRegionFullPresent(parentElement , element, childrenElements))){System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return;} // generated assertion in case of AEP for Original element = new DOMElement("DIV", "StoriesPhotos[0]DefaultStory[6]", new ArrayList<String>(Arrays.asList("class=\"submenu\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("class=\"part\""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("class=\"item\"")))); childrenElements .add(new DOMElement("DIV", "Photos[0]", new ArrayList<String>(Arrays.asList("class=\"item\"")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("DIV", "DefaultStory[6]", new ArrayList<String>(Arrays.asList("")))); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagAttPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // predicted region assertion element = new DOMElement("DIV", "EtcEmailRSSAdminPagePoweredbyPhormer3.31", new ArrayList<String>(Arrays.asList("class=\"titlepart\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("class=\"part\""))); childrenElements.clear(); childrenElements.add(new DOMElement("SPAN", "", new ArrayList<String>(Arrays.asList("class=\"reddot\"")))); childrenElements.add(new DOMElement("#text", "Poweredby", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagAttPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // predicted region assertion element = new DOMElement("SPAN", "RSS", new ArrayList<String>(Arrays.asList("class=\"dot\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("class=\"item\""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagAttPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // predicted region assertion }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase38.java
public void checkState13_GeneratedAssertions() { if (!(isElementPresent(By.cssSelector("div#Granny[id=\"Granny\"]")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return;// ww w. j ava 2s.c om } // generated assertion in case of ElementTagAttMatch }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase38.java
public void checkState14_GeneratedAssertions() { if (!(isElementPresent(By.cssSelector("div#Granny[id=\"Granny\"]")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return;//from w ww .ja va 2 s . c o m } // generated assertion in case of ElementTagAttMatch if (!(isElementPresent(By.cssSelector("div.method[class=\"method\"]")))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of ElementTagAttMatch element = new DOMElement("IMG", "", new ArrayList<String>(Arrays.asList("id=\"ss_photo\"", "onload=\"javscript:ss_loaddone();\"", "src=\"images/000006_rryky_0.jpg\""))); parentElement = new DOMElement("A", "", new ArrayList<String>( Arrays.asList("href=\".?p=6\"", "id=\"ss_link2\"", "style=\"display:inline;\""))); childrenElements.clear(); if (!(isElementRegionTagPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of RegionTagMatch element = new DOMElement("SPAN", "1", new ArrayList<String>(Arrays.asList("id=\"ss_n\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("class=\"titlepart\"", "style=\"letter-spacing: 2px; padding-bottom: 1em; margin-bottom: 0px;\""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "1", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of RegionTagMatch element = new DOMElement("SPAN", "2", new ArrayList<String>(Arrays.asList("id=\"ss_n\""))); parentElement = new DOMElement("DIV", "", new ArrayList<String>(Arrays.asList("class=\"titlepart\"", "style=\"letter-spacing: 2px; padding-bottom: 1em; margin-bottom: 0px;\""))); childrenElements.clear(); childrenElements.add(new DOMElement("#text", "2", new ArrayList<String>(Arrays.asList("")))); if (!(isElementRegionTagPresent(parentElement, element, childrenElements))) { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); return; } // generated assertion in case of RegionTagMatch }