Cannot click Submit Button-CppBuzz-Forum
There are five Dialog boxes and each Dialog box has the same code for the Submit Button except the value changes for "id" and "onclick". A single Dialog box has five question and when one answer for each question is selected the Submit button gets enabled. Code before button gets Enabled -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------- Code after button gets Enabled ------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ The code which I used to click the Submit button JavascriptExecutor executor1 = (JavascriptExecutor)driver; WebElement element1 = driver.findElement(By.xpath("//*[contains(@class,'btn btn-primary review-submission') and contains(@style,'opacity: 1;')]")); executor1.executeScript("arguments[0].click();", element1); The above code works fine for the First Submit button but not for the rest. The exception that throws is : org.openqa.selenium.NoSuchElementException: Unable to locate element: //*[contains(@class,'btn btn-primary review-submission') and contains(@style,'opacity: 1;')] Thanks & Regards, Small World
Posted by SmallWorld 2020-06-29 22:40:29
No Ans Posted
Recent Links
- ty-CppBuzz-Forum..
- ty-CppBuzz-Forum..
- Write a program to do the following:-Cpp..
- recursive function-CppBuzz-Forum..
- System command and variable-CppBuzz-Foru..
- best fitness tracker under 2000-CppBuzz-..
- How do I arrange this code so the 3 arti..
- library management system-CppBuzz-Forum..
- c++-CppBuzz-Forum..
- SWITCH STATEMENT-CppBuzz-Forum..
- more..