What is the problem with the Alert function in the Selenium IDE

0 votes

How do I verify or assert an alert command with a message that contains a variable in the form of text?

For example, I have to capture an alert command with this particular message: Answer number (var id_answer) successfully accepted. id_answer is the variable and I don't know if this value should be present before the alert command is written. This alert is triggered for a flash command in a controller, for example (in Rails). And I need to simulate the click the button "ok" inside an alert window with a selenium command too. Is it possible?

Can anyone help me with this by providing an example with the complete syntax command in Selenium IDE?

Mar 5, 2019 in Selenium by Vaishnavi
• 1,170 points
357 views

1 answer to this question.

0 votes

To simulate the button OK and click it, you could use command assertAlert: helps in getting an alert has the same effect as manually clicking OK. You could also use a getAlert function: It helps in retrieving the message of a JavaScript alert generated during the previous action, or else it fails if there are no alerts.

answered Mar 5, 2019 by Surya
• 970 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

What is the role of TestNG & JUnit frameworks in Selenium?

Well TestNG and JUnit are test frameworks ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,690 points
440 views
0 votes
1 answer

what is the need of xpath when you have attributes like id ,class,name in selenium?

It is not necessary that every element ...READ MORE

answered Jun 1, 2018 in Selenium by Vinita
• 220 points
302 views
0 votes
1 answer

There is an problem with the Recursion in Java. Method is returning empty list

checkMonth(driver) Ignore the List returned by that call. Perhaps you want ...READ MORE

answered Jun 6, 2018 in Selenium by jonss
89 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

What is the difference between findElement and findElements in Selenium Webdriver?

Hi Nilaabh, Selenium Webdriver uses findElement and ...READ MORE

answered May 8, 2019 in Selenium by Anvi
• 14,010 points
1,082 views
0 votes
1 answer

How to automate the Instagram search bar with selenium

Hi, please don't search by any placeholder ...READ MORE

answered Mar 8, 2019 in Selenium by Surya
• 970 points
803 views
0 votes
1 answer

How to check if an image is displayed on web page while working with Selenium WebDriver?

I've come across a similar situation before, where the image ...READ MORE

answered May 10, 2019 in Selenium by Surya
• 970 points
934 views