I have a scenario like a question. I need to answer the 1st question with 1st option 2nd question with the 2nd option like round .Any one suggest how can I perform using Geb.

I Have written the code for selecting multiple choice selecting randomly but now I need to select the answer round robin :

def answerQuestions(numQuestions, numAnswers, sectionName) {
        for(int i = 0; i < numQuestions; i++) {
            log.info(" ${bookingcode}t"+sectionName+": "+ i)

//I need to select the 1st option for 1 st question instead random
            def index = rand.nextInt(numAnswers)
            doThink()
            waitFor {
                cover.displayed == false
                mcQuestions*.displayed 
                clickHammer(mcQuestions[index])
                mcQuestions[index].value() != null
                nextButton.displayed
            }
            nextButton.click()
        }
    }



Source link https://sqa.stackexchange.com//35256/answering-a-multiple-choice--with-round-robin-fashion-using-selenium

LEAVE A REPLY

Please enter your comment!
Please enter your name here