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 in Selenium by Vaishnavi
• 1,080 points
109 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 by Surya
• 950 points

Related Questions In Selenium

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,590 points
192 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
88 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
28 views
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 in Selenium by Anvi
• 10,310 points
112 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 in Selenium by Surya
• 950 points
212 views
0 votes
1 answer