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,180 points
925 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
2 answers

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

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

answered Sep 4 in Selenium by Sri
• 2,970 points
931 views
0 votes
2 answers
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
205 views
0 votes
2 answers
0 votes
1 answer
0 votes
2 answers
+1 vote
2 answers
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
2,315 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
3,923 views