List of usage examples for org.openqa.selenium By linkText
public static By linkText(String linkText)
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase40.java
@Test public void method40() { driver.get(url);//from ww w. ja v a 2s . com //From state 0 to state 1 //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=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.linkText("Admin Page")).click(); //From state 1 to state 2 //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=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.id("loginAdminPass")).clear(); driver.findElement(By.id("loginAdminPass")).sendKeys("editor"); driver.findElement(By.cssSelector("input.submit")).click(); //From state 2 to state 3 //Eventable{eventType=click, identification=text Manage Stories, element=Element{node=[A: null], tag=A, text=Manage Stories, attributes={href=?page=stories}}, source=StateVertexImpl{id=2, name=state2}, target=StateVertexImpl{id=3, name=state3}} 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("Manage Stories")).click(); //From state 3 to state 4 //Eventable{eventType=click, identification=cssSelector input.submit, element=Element{node=[INPUT: null], tag=INPUT, text=, attributes={class=submit, type=submit, value=??????Add Story??????}}, source=StateVertexImpl{id=3, name=state3}, target=StateVertexImpl{id=4, name=state4}} mutateDOMTree(3); checkState3_OriginalAssertions(); checkState3_ReusedAssertions(); checkState3_GeneratedAssertions(); checkState3_LearnedAssertions(); checkState3_AllAssertions(); checkState3_RandAssertions1(); checkState3_RandAssertions2(); checkState3_RandAssertions3(); checkState3_RandAssertions4(); checkState3_RandAssertions5(); driver.findElement(By.name("desc")).clear(); driver.findElement(By.name("desc")).sendKeys("Greenery !!"); driver.findElement(By.id("name")).clear(); driver.findElement(By.id("name")).sendKeys("Photos"); driver.findElement(By.cssSelector("input.submit")).click(); //From state 4 to state 5 //Eventable{eventType=click, identification=cssSelector a[title="Log Out"], element=Element{node=[A: null], tag=A, text=, attributes={href=?page=logout, title=Log Out}}, source=StateVertexImpl{id=4, name=state4}, target=StateVertexImpl{id=5, name=state5}} mutateDOMTree(4); checkState4_OriginalAssertions(); checkState4_ReusedAssertions(); checkState4_GeneratedAssertions(); checkState4_LearnedAssertions(); checkState4_AllAssertions(); checkState4_RandAssertions1(); checkState4_RandAssertions2(); checkState4_RandAssertions3(); checkState4_RandAssertions4(); checkState4_RandAssertions5(); driver.findElement(By.cssSelector("a[title=\"Log Out\"]")).click(); //Sink node at state 5 mutateDOMTree(5); checkState5_OriginalAssertions(); checkState5_ReusedAssertions(); checkState5_GeneratedAssertions(); checkState5_LearnedAssertions(); checkState5_AllAssertions(); checkState5_RandAssertions1(); checkState5_RandAssertions2(); checkState5_RandAssertions3(); checkState5_RandAssertions4(); checkState5_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase41.java
@Test public void method41() { driver.get(url);/*from w w w . ja v a 2s . c o m*/ //From state 0 to state 1 //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=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.linkText("Admin Page")).click(); //From state 1 to state 2 //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=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.id("loginAdminPass")).clear(); driver.findElement(By.id("loginAdminPass")).sendKeys("editor"); driver.findElement(By.cssSelector("input.submit")).click(); //From state 2 to state 42 //Eventable{eventType=click, identification=xpath /HTML[1]/BODY[1]/CENTER[1]/DIV[2]/DIV[2]/A[1], element=Element{node=[A: null], tag=A, text=, attributes={href=?page=photos, title=Manage Photos}}, source=StateVertexImpl{id=2, name=state2}, target=StateVertexImpl{id=42, name=state42}} 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.xpath("/HTML[1]/BODY[1]/CENTER[1]/DIV[2]/DIV[2]/A[1]")).click(); //Sink node at state 42 mutateDOMTree(42); checkState42_OriginalAssertions(); checkState42_ReusedAssertions(); checkState42_GeneratedAssertions(); checkState42_LearnedAssertions(); checkState42_AllAssertions(); checkState42_RandAssertions1(); checkState42_RandAssertions2(); checkState42_RandAssertions3(); checkState42_RandAssertions4(); checkState42_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase42.java
@Test public void method42() { driver.get(url);//from w w w.java2 s.co m //From state 0 to state 1 //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=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.linkText("Admin Page")).click(); //From state 1 to state 30 //Eventable{eventType=click, identification=xpath /HTML[1]/BODY[1]/CENTER[1]/DIV[2]/DIV[1]/SPAN[1]/A[1], element=Element{node=[A: null], tag=A, text=???My PhotoGallery???, attributes={href=., style=color: black, target=_blank}}, source=StateVertexImpl{id=1, name=state1}, target=StateVertexImpl{id=30, name=state30}} 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.xpath("/HTML[1]/BODY[1]/CENTER[1]/DIV[2]/DIV[1]/SPAN[1]/A[1]")).click(); //From state 30 to state 31 //Eventable{eventType=click, identification=text Log Out, element=Element{node=[A: null], tag=A, text=Log Out, attributes={href=?page=logout}}, source=StateVertexImpl{id=30, name=state30}, target=StateVertexImpl{id=31, name=state31}} mutateDOMTree(30); checkState30_OriginalAssertions(); checkState30_ReusedAssertions(); checkState30_GeneratedAssertions(); checkState30_LearnedAssertions(); checkState30_AllAssertions(); checkState30_RandAssertions1(); checkState30_RandAssertions2(); checkState30_RandAssertions3(); checkState30_RandAssertions4(); checkState30_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase43.java
@Test public void method43() { driver.get(url);/* w ww . j a v a 2 s . c o m*/ //From state 0 to state 1 //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=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.linkText("Admin Page")).click(); //From state 1 to state 30 //Eventable{eventType=click, identification=xpath /HTML[1]/BODY[1]/CENTER[1]/DIV[2]/DIV[1]/A[1], element=Element{node=[A: null], tag=A, text=Administration Region, attributes={href=?, style=color: snow;}}, source=StateVertexImpl{id=1, name=state1}, target=StateVertexImpl{id=30, name=state30}} 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.xpath("/HTML[1]/BODY[1]/CENTER[1]/DIV[2]/DIV[1]/A[1]")).click(); //From state 30 to state 31 //Eventable{eventType=click, identification=text Log Out, element=Element{node=[A: null], tag=A, text=Log Out, attributes={href=?page=logout}}, source=StateVertexImpl{id=30, name=state30}, target=StateVertexImpl{id=31, name=state31}} mutateDOMTree(30); checkState30_OriginalAssertions(); checkState30_ReusedAssertions(); checkState30_GeneratedAssertions(); checkState30_LearnedAssertions(); checkState30_AllAssertions(); checkState30_RandAssertions1(); checkState30_RandAssertions2(); checkState30_RandAssertions3(); checkState30_RandAssertions4(); checkState30_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase44.java
@Test public void method44() { driver.get(url);/* www. j a va 2s . c om*/ //From state 0 to state 27 //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=27, name=state27}} 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 27 to state 28 //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=27, name=state27}, target=StateVertexImpl{id=28, name=state28}} mutateDOMTree(27); checkState27_OriginalAssertions(); checkState27_ReusedAssertions(); checkState27_GeneratedAssertions(); checkState27_LearnedAssertions(); checkState27_AllAssertions(); checkState27_RandAssertions1(); checkState27_RandAssertions2(); checkState27_RandAssertions3(); checkState27_RandAssertions4(); checkState27_RandAssertions5(); driver.findElement(By.id("loginAdminPass")).clear(); driver.findElement(By.id("loginAdminPass")).sendKeys("editor"); driver.findElement(By.cssSelector("input.submit")).click(); //From state 28 to state 29 //Eventable{eventType=click, identification=text Manage Categories, element=Element{node=[A: null], tag=A, text=Manage Categories, attributes={href=?page=categories}}, source=StateVertexImpl{id=28, name=state28}, target=StateVertexImpl{id=29, name=state29}} mutateDOMTree(28); checkState28_OriginalAssertions(); checkState28_ReusedAssertions(); checkState28_GeneratedAssertions(); checkState28_LearnedAssertions(); checkState28_AllAssertions(); checkState28_RandAssertions1(); checkState28_RandAssertions2(); checkState28_RandAssertions3(); checkState28_RandAssertions4(); checkState28_RandAssertions5(); driver.findElement(By.linkText("Manage Categories")).click(); //From state 29 to state 30 //Eventable{eventType=click, identification=text << Admin Page, element=Element{node=[A: null], tag=A, text=<< Admin Page, attributes={href=?}}, source=StateVertexImpl{id=29, name=state29}, target=StateVertexImpl{id=30, name=state30}} mutateDOMTree(29); checkState29_OriginalAssertions(); checkState29_ReusedAssertions(); checkState29_GeneratedAssertions(); checkState29_LearnedAssertions(); checkState29_AllAssertions(); checkState29_RandAssertions1(); checkState29_RandAssertions2(); checkState29_RandAssertions3(); checkState29_RandAssertions4(); checkState29_RandAssertions5(); driver.findElement(By.linkText("<< Admin Page")).click(); //From state 30 to state 31 //Eventable{eventType=click, identification=text Log Out, element=Element{node=[A: null], tag=A, text=Log Out, attributes={href=?page=logout}}, source=StateVertexImpl{id=30, name=state30}, target=StateVertexImpl{id=31, name=state31}} mutateDOMTree(30); checkState30_OriginalAssertions(); checkState30_ReusedAssertions(); checkState30_GeneratedAssertions(); checkState30_LearnedAssertions(); checkState30_AllAssertions(); checkState30_RandAssertions1(); checkState30_RandAssertions2(); checkState30_RandAssertions3(); checkState30_RandAssertions4(); checkState30_RandAssertions5(); driver.findElement(By.linkText("Log Out")).click(); //Sink node at state 31 mutateDOMTree(31); checkState31_OriginalAssertions(); checkState31_ReusedAssertions(); checkState31_GeneratedAssertions(); checkState31_LearnedAssertions(); checkState31_AllAssertions(); checkState31_RandAssertions1(); checkState31_RandAssertions2(); checkState31_RandAssertions3(); checkState31_RandAssertions4(); checkState31_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase46.java
@Test public void method46() { driver.get(url);// ww w. j av a2s . c o m //From state 0 to state 27 //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=27, name=state27}} 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 27 to state 28 //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=27, name=state27}, target=StateVertexImpl{id=28, name=state28}} mutateDOMTree(27); checkState27_OriginalAssertions(); checkState27_ReusedAssertions(); checkState27_GeneratedAssertions(); checkState27_LearnedAssertions(); checkState27_AllAssertions(); checkState27_RandAssertions1(); checkState27_RandAssertions2(); checkState27_RandAssertions3(); checkState27_RandAssertions4(); checkState27_RandAssertions5(); driver.findElement(By.id("loginAdminPass")).clear(); driver.findElement(By.id("loginAdminPass")).sendKeys("editor"); driver.findElement(By.cssSelector("input.submit")).click(); //From state 28 to state 29 //Eventable{eventType=click, identification=text Manage Categories, element=Element{node=[A: null], tag=A, text=Manage Categories, attributes={href=?page=categories}}, source=StateVertexImpl{id=28, name=state28}, target=StateVertexImpl{id=29, name=state29}} mutateDOMTree(28); checkState28_OriginalAssertions(); checkState28_ReusedAssertions(); checkState28_GeneratedAssertions(); checkState28_LearnedAssertions(); checkState28_AllAssertions(); checkState28_RandAssertions1(); checkState28_RandAssertions2(); checkState28_RandAssertions3(); checkState28_RandAssertions4(); checkState28_RandAssertions5(); driver.findElement(By.linkText("Manage Categories")).click(); //Sink node at state 29 mutateDOMTree(29); checkState29_OriginalAssertions(); checkState29_ReusedAssertions(); checkState29_GeneratedAssertions(); checkState29_LearnedAssertions(); checkState29_AllAssertions(); checkState29_RandAssertions1(); checkState29_RandAssertions2(); checkState29_RandAssertions3(); checkState29_RandAssertions4(); checkState29_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase6.java
@Test public void method6() { driver.get(url);//from w ww .j a v a 2 s .c om //From state 0 to state 6 //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=6, name=state6}} 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 6 to state 7 //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=6, name=state6}, target=StateVertexImpl{id=7, name=state7}} mutateDOMTree(6); checkState6_OriginalAssertions(); checkState6_ReusedAssertions(); checkState6_GeneratedAssertions(); checkState6_LearnedAssertions(); checkState6_AllAssertions(); checkState6_RandAssertions1(); checkState6_RandAssertions2(); checkState6_RandAssertions3(); checkState6_RandAssertions4(); checkState6_RandAssertions5(); driver.findElement(By.id("loginAdminPass")).clear(); driver.findElement(By.id("loginAdminPass")).sendKeys("editor"); driver.findElement(By.cssSelector("input.submit")).click(); //From state 7 to state 8 //Eventable{eventType=click, identification=text Manage Categories, element=Element{node=[A: null], tag=A, text=Manage Categories, attributes={href=?page=categories}}, source=StateVertexImpl{id=7, name=state7}, target=StateVertexImpl{id=8, name=state8}} mutateDOMTree(7); checkState7_OriginalAssertions(); checkState7_ReusedAssertions(); checkState7_GeneratedAssertions(); checkState7_LearnedAssertions(); checkState7_AllAssertions(); checkState7_RandAssertions1(); checkState7_RandAssertions2(); checkState7_RandAssertions3(); checkState7_RandAssertions4(); checkState7_RandAssertions5(); driver.findElement(By.linkText("Manage Categories")).click(); //From state 8 to state 11 //Eventable{eventType=click, identification=cssSelector input.submit, element=Element{node=[INPUT: null], tag=INPUT, text=, attributes={class=submit, type=submit, value=??????Add Category??????}}, source=StateVertexImpl{id=8, name=state8}, target=StateVertexImpl{id=11, name=state11}} mutateDOMTree(8); checkState8_OriginalAssertions(); checkState8_ReusedAssertions(); checkState8_GeneratedAssertions(); checkState8_LearnedAssertions(); checkState8_AllAssertions(); checkState8_RandAssertions1(); checkState8_RandAssertions2(); checkState8_RandAssertions3(); checkState8_RandAssertions4(); checkState8_RandAssertions5(); driver.findElement(By.name("desc")).clear(); driver.findElement(By.name("desc")).sendKeys("contains photos of all the flowers !"); driver.findElement(By.id("name")).clear(); driver.findElement(By.id("name")).sendKeys("flowers"); driver.findElement(By.cssSelector("input.submit")).click(); //From state 11 to state 12 //Eventable{eventType=click, identification=cssSelector a[title="Log Out"], element=Element{node=[A: null], tag=A, text=, attributes={href=?page=logout, title=Log Out}}, source=StateVertexImpl{id=11, name=state11}, target=StateVertexImpl{id=12, name=state12}} mutateDOMTree(11); checkState11_OriginalAssertions(); checkState11_ReusedAssertions(); checkState11_GeneratedAssertions(); checkState11_LearnedAssertions(); checkState11_AllAssertions(); checkState11_RandAssertions1(); checkState11_RandAssertions2(); checkState11_RandAssertions3(); checkState11_RandAssertions4(); checkState11_RandAssertions5(); driver.findElement(By.cssSelector("a[title=\"Log Out\"]")).click(); //Sink node at state 12 mutateDOMTree(12); checkState12_OriginalAssertions(); checkState12_ReusedAssertions(); checkState12_GeneratedAssertions(); checkState12_LearnedAssertions(); checkState12_AllAssertions(); checkState12_RandAssertions1(); checkState12_RandAssertions2(); checkState12_RandAssertions3(); checkState12_RandAssertions4(); checkState12_RandAssertions5(); }
From source file:com.crawljax.plugins.testilizer.generated.photogallery_EXND.GeneratedTestCase9.java
@Test public void method9() { driver.get(url);//w w w. j a v a 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(); //From state 14 to state 8 //Eventable{eventType=click, identification=text Manage Categories, element=Element{node=[A: null], tag=A, text=Manage Categories, attributes={href=?page=categories}}, source=StateVertexImpl{id=14, name=state14}, target=StateVertexImpl{id=8, name=state8}} mutateDOMTree(14); checkState14_OriginalAssertions(); checkState14_ReusedAssertions(); checkState14_GeneratedAssertions(); checkState14_LearnedAssertions(); checkState14_AllAssertions(); checkState14_RandAssertions1(); checkState14_RandAssertions2(); checkState14_RandAssertions3(); checkState14_RandAssertions4(); checkState14_RandAssertions5(); driver.findElement(By.linkText("Manage Categories")).click(); //From state 8 to state 11 //Eventable{eventType=click, identification=cssSelector input.submit, element=Element{node=[INPUT: null], tag=INPUT, text=, attributes={class=submit, type=submit, value=??????Add Category??????}}, source=StateVertexImpl{id=8, name=state8}, target=StateVertexImpl{id=11, name=state11}} mutateDOMTree(8); checkState8_OriginalAssertions(); checkState8_ReusedAssertions(); checkState8_GeneratedAssertions(); checkState8_LearnedAssertions(); checkState8_AllAssertions(); checkState8_RandAssertions1(); checkState8_RandAssertions2(); checkState8_RandAssertions3(); checkState8_RandAssertions4(); checkState8_RandAssertions5(); driver.findElement(By.name("desc")).clear(); driver.findElement(By.name("desc")).sendKeys("contains photos of all the flowers !"); driver.findElement(By.id("name")).clear(); driver.findElement(By.id("name")).sendKeys("flowers"); driver.findElement(By.cssSelector("input.submit")).click(); //From state 11 to state 19 //Eventable{eventType=click, identification=xpath (//a[contains(text(),'Delete / Clear')])[2], element=Element{node=[A: null], tag=A, text=Delete / Clear, attributes={href=?page=categories&cmd=doDel&cid=2}}, source=StateVertexImpl{id=11, name=state11}, target=StateVertexImpl{id=19, name=state19}} mutateDOMTree(11); checkState11_OriginalAssertions(); checkState11_ReusedAssertions(); checkState11_GeneratedAssertions(); checkState11_LearnedAssertions(); checkState11_AllAssertions(); checkState11_RandAssertions1(); checkState11_RandAssertions2(); checkState11_RandAssertions3(); checkState11_RandAssertions4(); checkState11_RandAssertions5(); driver.findElement(By.xpath("(//a[contains(text(),'Delete / Clear')])[2]")).click(); //From state 19 to state 21 //Eventable{eventType=click, identification=cssSelector input.submit, element=Element{node=[INPUT: null], tag=INPUT, text=, attributes={class=submit, type=submit, value=??????Delete it!??????}}, source=StateVertexImpl{id=19, name=state19}, target=StateVertexImpl{id=21, name=state21}} mutateDOMTree(19); checkState19_OriginalAssertions(); checkState19_ReusedAssertions(); checkState19_GeneratedAssertions(); checkState19_LearnedAssertions(); checkState19_AllAssertions(); checkState19_RandAssertions1(); checkState19_RandAssertions2(); checkState19_RandAssertions3(); checkState19_RandAssertions4(); checkState19_RandAssertions5(); driver.findElement(By.cssSelector("input.submit")).click(); //From state 21 to state 22 //Eventable{eventType=click, identification=cssSelector a[title="Log Out"], element=Element{node=[A: null], tag=A, text=, attributes={href=?page=logout, title=Log Out}}, source=StateVertexImpl{id=21, name=state21}, target=StateVertexImpl{id=22, name=state22}} mutateDOMTree(21); checkState21_OriginalAssertions(); checkState21_ReusedAssertions(); checkState21_GeneratedAssertions(); checkState21_LearnedAssertions(); checkState21_AllAssertions(); checkState21_RandAssertions1(); checkState21_RandAssertions2(); checkState21_RandAssertions3(); checkState21_RandAssertions4(); checkState21_RandAssertions5(); driver.findElement(By.cssSelector("a[title=\"Log Out\"]")).click(); //Sink node at state 22 mutateDOMTree(22); checkState22_OriginalAssertions(); checkState22_ReusedAssertions(); checkState22_GeneratedAssertions(); checkState22_LearnedAssertions(); checkState22_AllAssertions(); checkState22_RandAssertions1(); checkState22_RandAssertions2(); checkState22_RandAssertions3(); checkState22_RandAssertions4(); checkState22_RandAssertions5(); }
From source file:com.day.cq.social.comments.CloudServiceMTIT.java
@Test public void testConfigureTIFOnPublish() throws InterruptedException { browseTo(getURL(cloudServiceMTPage), true); WebElement tranIntegration = driver.findElement(By.cssSelector("div.product.machine-translation a")); tranIntegration.click();//from ww w . ja v a 2 s.c om assertTrue("Unable to find configuration button", isElementPresent(By.cssSelector("#machine-translation-more"))); WebElement defaultConfig = driver .findElement(By.linkText("Default configuration (Translation Integration configuration)")); defaultConfig.click(); assertTrue("Unable to find go to translation integration button", isElementPresent(By.linkText("Go to Translation Integration Framework"))); assertTrue("Unable to find edit button", isElementPresent(By.id("cq-gen13"))); WebElement edit = driver.findElement(By.id("cq-gen14")); assertEquals("Edit", edit.getText()); edit.click(); assertTrue("Unable to find edit component", isElementPresent(By.id("cq-gen40"))); assertEquals("Edit Component", driver.findElement(By.id("cq-gen40")).getText()); assertEquals("Machine Translation Configuration", driver.findElement(By.id("ext-comp-1010")).getText()); assertEquals("Go to Translation Integration Framework", driver.findElement(By.cssSelector("#ext-comp-1014 a")).getText()); assertTrue("Unable to find category", isElementPresent(By.id("ext-comp-1024"))); }
From source file:com.day.cq.social.comments.CloudServiceMTIT.java
@Test public void testConfigureMSConnectorOnPublish() throws InterruptedException { browseTo(getURL(cloudServiceMTPage), true); WebElement msConnector = driver.findElement(By.cssSelector("div.product.msft-translation a")); msConnector.click();/* w ww . ja v a 2 s . co m*/ assertTrue("Unable to find configuration button", isElementPresent(By.cssSelector("#msft-translation-more"))); assertTrue("Unable to find default configuration", isElementPresent( By.linkText("Microsoft Translator Default Configuration (Microsoft Translation Configuration)"))); assertTrue("Unable to find trail configuration", isElementPresent( By.linkText("Microsoft Translator Trial License (Microsoft Translation Configuration)"))); WebElement defaultConfig = driver.findElement( By.linkText("Microsoft Translator Default Configuration (Microsoft Translation Configuration)")); defaultConfig.click(); WebElement edit = driver.findElement(By.id("cq-gen14")); edit.click(); WebElement label = driver.findElement(By.cssSelector("#x-form-el-ext-comp-1021 input")); WebElement attribution = driver.findElement(By.cssSelector("#x-form-el-ext-comp-1022 input")); WebElement workspaceID = driver.findElement(By.cssSelector("#x-form-el-ext-comp-1023 input")); WebElement clientID = driver.findElement(By.cssSelector("#x-form-el-ext-comp-1024 input")); WebElement clientSecret = driver.findElement(By.cssSelector("#x-form-el-ext-comp-1025 input")); label.clear(); label.sendKeys("test"); attribution.clear(); attribution.sendKeys("test"); workspaceID.clear(); workspaceID.sendKeys("test"); clientID.clear(); clientID.sendKeys("AdobeAEMTrial"); clientSecret.clear(); clientSecret.sendKeys("AEMTrialAccount9468uTp"); WebElement verifyButton = driver.findElement(By.id("cq-gen65")); verifyButton.click(); WebElement okButton = driver.findElement(By.id("cq-gen90")); okButton.click(); okButton = driver.findElement(By.id("cq-gen44")); okButton.click(); Thread.sleep(2000); List<WebElement> property = driver.findElements(By.cssSelector("#cq-gen8 li")); Iterator it = property.iterator(); it.next(); assertEquals("Translation Label: test", ((WebElement) it.next()).getText()); }